reference field value is populating undefined via field script of transform map after upgrade to SanDiego

Ulka1
Tera Contributor

Hello Expertise,

We have a reference field 'Opened for' and we are setting this field value as null when one other field's value (field name XYZ) is null using field script of transform map.  before upgrade this was working fine but our instance is upgraded from Quebec to San Diego version we are facing the below issue.

Undefined value is auto populating  for the reference field 'Opened for'  instead of null when we import the data using the transform map. Even after updating  and saving the value of reference field 'Opened for' with the correct user, later when we import the data again the reference field 'Opened for' showing undefined value again on the case.

Did any one faced this type of issue earlier?  If any body knows about this issue then please let us know.

 

Thanks,

Ulka

 

 

13 REPLIES 13

Hi,

there you are clearing the value and setting it as empty

why you have used field map script for this?

move this complex logic inside onbefore script

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

As we have another fields also that is mapped for this transform map on HR Situation Management case table

Could you please suggest how we can use in onbefore script.

 

Thanks, 

Ulka

 

Hi Ankur,

We used Onbefore script and the 'Opened for' and 'Assign to' fields are working correct, but the 'Assignment Group' is not setting the value as per the Onbefore script. Means when the source HRBP field is blank then assignment group is not setting the value as 'HR_Group1'.

Please refer below code and if you know then please suggest the solution for the same.

 

if((lineofbusiness == 'A') || (lineofbusiness == 'B')){

if(source.u_hr_business_partner == ''){
if (action == 'insert') {
target.opened_for = '';
target.assignment_group.setDisplayValue('HR_Group1');
target.assigned_to = '';
}
return target.opened_for = '';

 

For the other condition like when HRBP field is not blank then the assignment group is auto populating group value as per the script.

 

Thanks,

Ulka

Hi Ankur,

Could you please suggest how to fix this issue as you said we are clearing the values and setting it as empty. If you know or faced such scenario in past then please assist us to know the solution to set the Assignment group when source HRBP is empty. We got stuck here and need to solve this asap.

 

Thanks,

Ulka