how to Set field value in reference field using BR

Akki1
Tera Contributor

Hi,

How to set reference field value using Business rule?

I have 2 fields on a custom table

u_id-String

UserRef-reference to sys_user

I want Business rule code that when u_id is filled or updated it should go glide record using u_id field to match UserId in sys_user table and that record should be updated in UserRef

15 REPLIES 15

You are correct, if the record is missing, then that will be an issue.

Business rules that run after, will happen almost instantly after the record has been created. And before the next record (possibly the manager record) has been created.

In that case you could create an onComplete transform script, that tries to match the manager record after all records has been imported.

Akki1
Tera Contributor

I have never used it so can you help with it in detail

Akki1
Tera Contributor

Hi @OlaN 

I have never used it so can you help with it in detail

You can learn on how to do transform scripts by checking the Developer site.

https://developer.servicenow.com/dev.do#!/learn/courses/tokyo/app_store_learnv2_importingdata_tokyo_...

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

should be simple enough. What did you try so far?

Why Business rule? you can use flow designer as well with no code.

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