Scripting in a scope application for a record producer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 01:36 PM
Hey Everyone,
I am pretty new with the scripting for a record producer. What I want to do is map a field from the variable to the field on the table. The field that I am trying to access is dot walked from another table.
How can I map the variable to the dot walked field?
current.incident.u_lab = producer.variablename;
current.incident.contact_type = producer.variablename;
When I do the sample code above I get an error message stating, "Error MessageAccess to api 'put(sys_user.u_lab_variable)' from scope 'x_g_cfd_elims' has been refused due to the api's cross-scope access policy"
I have created a sys_user cross scope read operation privilege, but it still isn't working.
What am I missing? Any help would be very helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 01:53 PM
Hello,
From the error, the u_lab field seems to be a field in sys_user table but probably displayed in incident form. Can you check that. Your script is trying to update that field on insert. Is that a valid update you want to happen on sys_user record? I think you are trying to update the incident from the Record producer.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 02:15 PM
I have a table that extends from case (sn_customerservice_case), I am able to access the incident fields from that. The sys_user table doesn't have those fields, but the incident table does.
I want to map the variables from the record producer to those fields on my table. My table is u_elims_cases.
Do I need to do more dot walking to make it work?
current.u_elims_cases.incident.u_lab = producer.variablename ?
This is in a scoped app too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 06:06 PM
Hi,
Are you asking the incident number in your record producer along with the u_lab value?. Then it would be something like below:-
var inc = producer.incident_variable;
var lab= producer.input_of_u_lab_variable;
gt.addQuery('sys_id', inc);
gt.query();
if (gt.next())
gt.u_lab = lab;
gt.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2023 10:36 AM
Hi,
Did that resolve your issue?
Please mark as resolved if it helped.
Thanks.