how to change value of reference field from some value to blank.

d_kush
Giga Contributor

Hi ,

I am trying to populate a reference field from transform map using field map script. I need to clear out this reference field value sometimes, through field script. so i have given value ='NULL' in the else condition of script.. but it is creating below problems

1. first of all it was not clearing the field value at all.

2. when i have created a null value in the referenced table, then it is clearing field value but it is not making it null, means in the filter it is showing it has empty value, but i want to make this value as blank.

here is my questing is it possible to make reference field value as blank? or

To change reference field value to blank always we need to create an empty field in referenced table?

Thanks

13 REPLIES 13

Chuck Tomasi
Tera Patron

Have you tried simply setting it to two empty single quotes?



if (something)


        target.u_reference = value;


else


        target.u_reference = '';



That sets the reference field to an empty value.


yeah, i have tried this, but it is not working..


Can you clarify what it is doing if it is not working?



Please include details of your transform script and field mapping. I get the sense that we don't have the whole picture since what I described actually does leave an empty value in a reference field.



It could be something as simple as turning off "Run business rules" that is populating it with something after the transform is done.


I tried with Chuck solution and it is working fine(updated from background script).


find_real_file.png