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

Sebas Di Loreto
Kilo Sage
Kilo Sage

@Elizabeth26 

Try to see if this works.

 

var location = producer.x_location_type + "";
if (location == 'Facility') {
      current.x_on_premises_selection = "Building";
}
if (location == 'Non-Site Facility') {
     current.x_off_premises_selection = "Site";
}

If I helped you with your case, please click the Thumb Icon and mark as Correct.


Hi,

 

It still does not input the values in the table the record producer is created in. The field values are empty for both. 

@Elizabeth26,

Make sure those are the correct field names.  What type of fields are they?  You can check the XML to see if they have a value but no display value.

The field names are correct. They are choice fields. In the XML I see location type value but nothing for both on or off premises.