Show name instead of sys_id in string field populated by variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 12:48 AM
Hi,
I have a variable which is referencing a list of data in a bespoke table (x_yobs_regulatory_regulatory_breach_tier_1)
The variable is tier_1
I want the name of the data entry to appear in a mapped string field on the associated table instead of it's sys_id. The field needs to be string for another purpose so this cannot be changed.
Currently when the form is submitted it show the sys_id as below but I need it show show the label/name
How can i achieve this?
Thanks in advance.
Emma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 01:26 AM
is name the correct field name or if it's a custom table it's not u_name is it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 01:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 01:46 AM
strange it's almost like the mapping is still happening rather than the producer script kicking in.
can you just see if we are getting the name by putting a gs.log entry in?
gs.log('tier name is ' + producer.tier_1.name);
then check the log to see if we are picking that up or not?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 02:16 AM
Hi,
I've updated to the following - where do i check the logs please?
gs.log(current.tier_1 = producer.tier_1.name);
gs.log(current.tier_2 = producer.tier_2.name);
gs.log(current.tier_3 = producer.tier_3.name);
Thank you!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2016 02:20 AM
org.mozilla.javascript.EcmaError: "FormInfoHeader" is not defined.
Caused by error in <refname> at line 8
5: s += 'The Regulatory Breach department will contact you if they need any further information<br/>';
6: fi.addMessage(s);
7: current.contact_type = "self-service";
==> 8: gs.log(current.tier_1 = producer.tier_1.name);
9: gs.log(current.tier_2 = producer.tier_2.name);
10: gs.log(current.tier_3 = producer.tier_3.name);