auto-displaying fields within a record producer based on previous user input

nathantenaglia
Tera Expert

Hi everyone,

I've created a record producer that's using the sc_cat_item view which obviously has some limitations in what is and isn't supported in comparison to the traditional record producer view.

I'm trying to create some variables that are saved to the sys_user table and then auto-display for the users the next time they open the form (based on feedback, saving them time from having to add the same information each time).

find_real_file.png

I've got a script within the record producer that saves this data to the associated sys_user fields I've previously added:

find_real_file.png

Here's an example of the completed sys_user fields:

find_real_file.png

The problem is that my record producer isn't auto-displaying these custom fields (it does work for the display name, phone number and email address though)

find_real_file.png

I'm really stuck. Any idea?

1 ACCEPTED SOLUTION

From this last screenshot, it seems that you might want to use this:


gs.getUser().getRecord().getValue('utas_building');


Try once, if that works.


If it doesn't, please give a screenshot of your 'sys_user' table columns and labels.


View solution in original post

16 REPLIES 16

Deepak Kumar5
Kilo Sage

You can add this with session if you want to show in the same session or you can add these value for that user preferences and query on User Preference table next time user used this record producer.


Thanks for taking the time to respond DK - unfortunately I'm not quite following though. It's possibly due to my limited knowledge - but this doesn't make a lot of sense to me sorry.


deepakgarg
ServiceNow Employee
ServiceNow Employee

Hi Nathan,



Do you want it to be filled with last filled values? or you want these fields to be populated with corresponding user values whenever 'Name' is changed.?


If you want these fields to be filled with user details selected in "name" variable, in that case you can add a script include and an onchange client script.


Hi Deepak,



I would like the values to be auto-filled in based on the previously filled values by the user. Once this is tackled then I'll look at configuring an onchange script - but just need the auto-displayed fields (with previously saved data) to be working first.