Trying to use setValue to set the value of a reference field

Hi,
I am trying to use the setValue method of glideRecord to set the value of the RFC field. I have a problem record called prob and I am currently in an incident record. i want to link the two using the RFC field and then related lists. However i cannot seem to get this bit of code to work. My RFC field expects a problem number (in the dictionary for the RFC field, i have "problem" in the "Reference:" field. I am definatley getting the problem number OK as I can add it to the short description fiel without any bother. Is there a different method I should be using to write to a reference type field?

current.setValue('short_description', prob.number); //this works
current.setValue('rfc',prob.number); //this doesn't work!!!
current.update();

Or perhaps is there a better way to link these two tickets?

Thanks in advance for your help, fairly stuck at this.
Niall


are you doing this in a client script?

if so you need to use g_form.setValue(

if your in a business rule then
current.setDisplayValue(

should work.

Marc

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.