Current Ticket Number in Record Producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2020 07:23 AM
Good morning developers,
I'm sure there is an easy answer to this question but I have not been successful in figuring it out. My problem is that I'm building out a form using a record producer. I'm trying to capture the current ticket number that will be created once the user clicks submit and display it in info message. I am able to get the sys_id but I can't get the display value. I have used var req = current.sys_id.getDisplayValue(); but that's not working.
I've also tried using this:
var agr = new x_adosy_as.Agreement(current);
var req = agr.record.number;
Here's the info message:
gs.addInfoMessage("Your Agreement Has Been Sent for Signature!" + req);
Any help will be greatly appreciated!
Thanks,
chnarris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2020 07:28 AM
Did you try current.number?
In addition, you are using the above in widget's server side code or directly on record produer's script field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2020 07:42 AM
Is above implemented in Business rule or via server side script of portal.
Better go with Business rule that runs After Insert on record producer table with below snippet.
(function executeRule(current, previous /*null when async*/) {
gs.addInfoMessage("Your Agreement Has Been Sent for Signature!" + current.number);
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2020 08:12 AM
Thanks for responding! I used your code in the business rule and it worked! But would I be able to use that same code inside the record producer script section? I tried it that way but it didn't work, am I doing something wrong or is using a business rule the only way to accomplish this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2020 08:24 AM
Good to know it worked when used Business Rule.
Can you share complete script that is being used in record producer's section.