Forum Discussion

PabloDarna's avatar
PabloDarna
Qrew Trainee
6 years ago

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

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. 

4 Replies

  • 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.
    • PabloDarna's avatar
      PabloDarna
      Qrew Trainee
      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.
    • EvanMartinez's avatar
      EvanMartinez
      Qrew Elite
      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. 
    • PabloDarna's avatar
      PabloDarna
      Qrew Trainee
      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.