How to update a parent record in a UI Action

Mi1
Tera Contributor

Hello,

I have a UI Action('Config Complete') in a child record that I create by associating it with a parent number.

When this UI Action is pressed, the value of the group and owner of the child record is passed to the specific item (for example, info such as Assignment Group and owner) to be kept by the linked parent number(its 'Pass Number'), and the value of the Assignment Group and owner of the child record is passed, and it is set and updated.

For example) When the UI Action ('Config Complete') in DEM0001135 is pressed, the 'Assignment Group' item in DEM0001131 is overwritten and updated with the value of the 'Assignment Group' item held in DEM0001135.

Alas, I wanna overwrite and update the value only if there is a change...

Any help would be appreciated.

Best Regards,

1 ACCEPTED SOLUTION

You are setting the value on a GlideElement and saving the current GlideRecord. Try this instead...

 

var parent = current.parent.getRefRecord();

parent.assignment_group = current.assignment_group;

parent.update();

 

View solution in original post

4 REPLIES 4

Musab Rasheed
Tera Sage
Tera Sage

Hi Mi,

In UI action try writing like below.?

current.parent.assignment_group = current.assignment_group;
current.update();

Update backend name of parent if not correct

Please hit like and mark my response as correct if that helps
Regards,
Musab

Hi,

Thank you .

I tried but it didn't work.

Regards,

You are setting the value on a GlideElement and saving the current GlideRecord. Try this instead...

 

var parent = current.parent.getRefRecord();

parent.assignment_group = current.assignment_group;

parent.update();

 

Mi1
Tera Contributor

Hi,

Thank you so much.

I worked it!

Best Regards,