The CreatorCon Call for Content is officially open! Get started here.

Current Ticket Number in Record Producer

cnharris1
Kilo Sage

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

16 REPLIES 16

Hi Mohammad,

Thanks for replying...I tried the script you gave me but the number didn't show up in the message.

Here's a screenshot of the table and field name:

find_real_file.png

Hi Ankur,

I have the same requirement as the initial question asked here. See how there is no reference number after "number is".

 

Record Producer Script:

gs.addInfoMessage ('The reference number is ' + current.number + '.');

What I get on submitting:

The reference number is .
 
However, using current.number is not working for me and the likely reason is I have the below property set to true.
 

 

 

 

I tried setting this property to false and only then current.number works fine, but I cannot actually set the property to false as doing so creates gaps in numbering which I don't want either.

Is there any workaround to do it from inside the record producer only? I thought of creating a business rule but how to make the BR trigger only when the record is created using record producer?