Record Producer to set value in table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 10:44 AM
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";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2023 07:54 PM - edited 01-20-2023 07:55 PM
@Elizabeth26x_location_type field is a reference field or choice field if it's choice field then you can check choice value and it's reference field then check with sysid of the location type
var location = producer.x_location_type;
if (location == 'Facility') { //can you check the choice value is same or different it should match with the target table field choice value
current.x_on_premises_selection = "Building"; //x_on_premises_selection is choice field they we can assign choice value to the same
}
if (location == 'Non-Site Facility') {
current.x_off_premises_selection = "Site";
}
Regards,
RJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 08:41 AM
It's a choice field. The choice values do match the values I am using.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 09:32 AM
@Elizabeth26 are you able to log the location type value in the script gs.info(producer.x_location_type) Can you share the log?
Regards,
RJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 11:56 AM
Can you share some screenshots of your field and choice list. Is your choice field referencing a table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 12:25 PM