- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2016 03:52 AM
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).
I've got a script within the record producer that saves this data to the associated sys_user fields I've previously added:
Here's an example of the completed sys_user fields:
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)
I'm really stuck. Any idea?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2016 02:47 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2016 01:16 AM
One more thing i need to know is: Is the caller field populated already by previously filled value, when you open record producer?
Also, fields 'u_campus', 'u_field' & 'u_room' are reference fields or not on 'sys_user' table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2016 01:25 AM
Hi Deepak,
Yeah the caller field is populated based on the logged on user accessing the record producer, using some JS magic:
I've also added u_campus, u_building and u_room as reference fields within the sys_user table which do appear to be updating.
I have this script setup to produce the previously saved information (and maybe this is what's not working?):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2016 02:06 AM
Ohh.. Now i got your problem. You are using "gs.getUser().getRecord()", which returns cached record.
Try logging out and then logging again. It will update the "gs.getUser().getRecord()" and the values will show up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2016 02:09 AM
Also, if 'u_building' is a reference field on 'sys_user' table, then, "gs.getUser().getRecord().getValue('u_building')" will give you sys_id of the record.
Instead use:
gs.getUser().getRecord().getDisplayValue('u_building');
It will give you the display value instead of sys_id, in case of reference field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2016 02:29 AM
Hmmm, still no joy here unfortunately.
I've logged off and back on within the Service Portal, opened the record producer and the fields have not been updated reflecting the previously inputted data.
I also gave you some incorrect details earlier sorry, the "u_campus, u_building, u_room" fields within the sys_user table are setup as "string" types, not "reference".
Not sure why this is so tricky