Skip to main content

Hi friends,

we are having one trigger on the Invoice object which I want to edit. In the invoice we are having 3 fields:

  1. Account owner ( it can be CMS roles user that reporting to SM role, or it can be SM user which reports to SD role)
  2. SM
  3. SD

We have one trigger but when testing and the Account owner is a CSM role user but the SM and/or SD is empty it's not populating the exact user name.

So what we want is to display the user name of the SM and SD depending on who is the Account Owner is.

If the owner is CMS 1.1 or CMS 1.2 then the SM field should be SM1.1 or SM1.2, if the SM role doesn't have users assigned then we want to display only the label of that role(SM_1).

In the same way, if the owner is SM1.1 or SM 1.2 then the SM field should display the own name of the user who is the owner and the SD should be SD1 because they are reporting to SD1. 

If SD1 doesn't have users assigned then we want to display the label of that Role (SD_1). How can I achieve this? Attached is the screenshot of our Roles, hope it's clear.

Thanks

How to edit my trigger on role hierarchy

2 Antworten
  1. 28. Okt. 2021, 16:07

    Hi Kermit, thanks for your info. I have already posted my question in the developer forum but no reply yet. 

    By any chance, I can update my 2 fields by process builder?

    Thanks

0/9000