Record Producer to set value in table

Elizabeth26
Tera Contributor

I am trying to set a value in the destination table of where a record producer is sent.

 

I tried within the script part of the record producer and also catalog client script but neither seem to work. I am not sure which option is better. I have tried in the script producer and current. It works for other things I am mapping this way in the script but not sure why it's not working for these? 

 

if (producer.x_location_type == 'Facility') {
current.x_on_premises_selection = "Building";

}

if (producer.x_location_type == 'Non-Site Facility') {
current.x_off_premises_selection = "Site";

}

17 REPLIES 17

@Elizabeth26,

Ok, that's the issue.  When you use a reference table you don't use the choice list.  You set the value to the sys_id of the record (on the referenced table) for Site or Building etc...

Copy the sys_ids from reference records and put them in the quotes.  You don't want to leave the sys_ids in your scripts, if this works you'll want to make properties to store the sys_ids instead of having them in your script.

if (producer.x_location_type == 'Facility') {
current.x_on_premises_selection = "<SysID Here>";

}

if (producer.x_location_type == 'Non-Site Facility') {
current.x_off_premises_selection = "<SysID Here>";

}

 

I tried that and it did not work. 

I am probably not explaining this very good.

 

We have a record producer. That record producer creates a record/case in a custom table (which is in a custom scoped app) and in that we are asking the "Location Type" 

If the location is facility it then write "Building" but this field is in a parent table.

We have a table that contains most of the fields - let's call it "Case" and then we extend off it to a table let's called it "Security". So, the building field is actually in the Case table.

 

We are doing the same for other fields which have no issues. I am not sure why this one in particular is having these issues. 

@Elizabeth26,

Can you describe what you did and what happened?  When you manually create a record and set the value of the field with the choice box what does the value look like in the XML?

What do you mean by Building being on a different table?  Is it dotwalked from a reference field or or referencing another table?

Can you share screenshots of configuration?