Change "Employee" look up field matchin the record owner upon creating the record

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • Answered
In the table "Ticket requests", I have a lookup field to the parent table "Employees". I would like that the ticket request record automatically sets the value of the look up field to match the record owner. Reason is that I want to profile "ticket request" depending on certain information that is related to the employee creating it (BU, country, supervisor, etc), ie the record owner.
How I can do this?
I have tried to create a rule that upon creating the record changes the "Employee" lookup to the record owner, but it fails to do this, as record owner is allocated after this moment. If I edit the same record after saving and save it again, then the rule functions and "Employee" matches the record owner. 
Photo of Pablo

Pablo

  • 112 Points 100 badge 2x thumb

Posted 7 months ago

  • 0
  • 1
I suggest having the rule only fire when the field you want to populate is blank, and also unchecking that innocuous checkbox at the bottom that says to only fire when the record changes.
Photo of Pablo

Pablo

  • 112 Points 100 badge 2x thumb
Hi,
I have tried but still not working.
The reasons is that it seems that the values of system fields (Record owner, Record ID, etc) is allocated to the record at the end of the saving process when the record is first added.
I believe, the form rules applies sometime before this allocation, and therefore, that is why they do not work because the condition cannot be applied as Record owner is still blank when it run. When the record is created, edited and saved again, then the rule runs correctly.
Photo of Evan Martinez

Evan Martinez, Community Manager

  • 12,658 Points 10k badge 2x thumb
Have you tried setting up a Formula-user field with the function for current user User() and set it up to pass that value along when that Lookup field isn't populated as an alternative? That way it should be able to capture the current user, who should be the record owner upon save, and pass it along since the formula can evaluate before the save. 
Photo of Pablo

Pablo

  • 112 Points 100 badge 2x thumb
Txs Evan. It worked but using Formula E-mail totext(User()). Then the rule applies upon the adding the record.
Reason is that the key field in my "Employee" table is the e-mail.
(Edited)