How do you submit a reference variable from a record producer?

mahudg2
Kilo Expert

I understand that to submit data from a record producer from a variable you can simply name the variable the same thing as what you're submitting.

 

This is working fine for strings, but when I'm trying to submit data into reference field it just shows up blank in the actual record it produces. How would I fix this?

1 ACCEPTED SOLUTION

JonathanJacob
Mega Sage

You can use the 'setDisplayValue' (via a script) if you know the display value since the system stores references as sys_ids. But it sounds like you are trying to create a variable that is a reference that already exists, is that correct? If so just create a reference type variable and point that to the table that you want to reference, this should be the same name as your field on your actual form. Also take a look at the 'Report an Outage' out of box record producer, it uses reference fields.



Hope that helps.


View solution in original post

5 REPLIES 5

So the problem is really the validation, what happens if they enter the wrong verification code.



If you use a string field, you would need to create some sort of validation(client script, ajax call) then you can use the method described at the top within the record producer script. Something like:


current.YOURFORMFIELD.setDisplayValue(producer.YOURPRODUCERREFERENCE);



Again without some validation(client side) you could risk an incorrect value.