User ID not updating when other fields are getting updated correctly?

dalejaurigue11
Tera Expert

Hi SN Community, I have an issue regarding User ID(user_name) field value not updating when other fields are getting updated correclty.

Here is the BR script that is responsible for creating/updating the record:

find_real_file.png

find_real_file.png

Consumer email was updated but the Consumer User User ID is not getting updated
find_real_file.png

 

find_real_file.png

5 REPLIES 5

Brad Bowman
Kilo Patron
Kilo Patron

I'm not following your test case.  If you update the email field on the Consumer record, this BR isn't going to trigger, or do anything if it did trigger since it's an insert record script, not update existing - unless you didn't share the entire script.  The BR only triggers when the Consumer record is inserted or updated and the User field on that record is empty (or changes, but that doesn't make sense as you've only shown a script that runs if the user field is empty).  So updating any other field on the Consumer record doesn't trigger this BR.

To test this BR (or the part you've shown) you would need to create or update a Consumer record with at least the First name, Last name, and Email fields populated, and the User field blank.  The script will then create a Consumer User record and link it to the Consumer record via the User field.  If you view the Consumer User record, you will see that the User ID, First name, Last name, and Email match that of the Consumer record (even without toString, setDisplayValue,...).

If you want the Consumer User record to update when the Consumer First name, Last name, or Email are changed, you would need to add these OR conditions to the BR and have an else section of the script to update the existing Consumer User record that matches the User field, with whatever is in the Consumer First name, Last name, and Email fields.