The Zurich release has arrived! Interested in new features and functionalities? Click here for more

From which Record the UI Action is Triggered

ShubhamK2600572
Tera Contributor

In user Table we have field as department which is reference of cmn_department table. I have created one UI action along with UI page for in Department table to create new Department. I want to fetch record of the user from where we have open the search option of department and click the UI action. 

I want to auto-populate some field in department table by taking the value from that particular user record. Is there any way we can get that record in UI action.  

ShubhamK2600572_0-1758880704588.png

ShubhamK2600572_1-1758880778441.png

 

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@ShubhamK2600572 

that's not how department are created.

Departments are usually loaded as 1 time activity.

what's your actual requirement?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

The Requirement is similar. We have a custom table(say A) in which we have created one custom UI action(using glidedialogwindow along with UI Page) to create new Record . In another table(say B) we have a reference field in which we are using reference of table A. Now we want to create a new record in table A using custom UI action from opening any record in table B. We want some field to be auto populated in UI Page(that will create a new record in table A) which is to be taken from some field present in table B. 

@ShubhamK2600572 

if you are thinking to auto populate some field on UI page based on the form field and when button is clicked, you need to pass the value using setPreference() method of GlideModal

what did you start and where are you stuck?

there are lot of community articles/questions answering this one.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I am not able to find how to pass the field value of table B in UI Action because the UI Action is created on table A as list banner button. That is why I am replicating the requirement in my PDI using user and department table. Here Department is Table A and user is table B. If I click the "create new Dept" UI action i want to fetch value from user records not from department table.