I need to trigger lifecycleevent for a list of users ID’s. The list of users is available in custom object. How can I read the user list in custom object and trigger life cycle event?
Trying to use the dropdown “Script” in the “Included Identities” option. What should be the return type of the script? and how the returned objects will be used by the lifecycle Event? Please share if any documentation is there around this.
Also, any of you have used this option in your implementation? If yes, Please share sample code.
In the included identities, you can select rule and, in that rule, check if the identity for which the LCE is evaulated is part of the custom object or not. if it’s then return true else false;
@DivyaSubha What are your other conditions to trigger LCE? If it is just that user part of the custom object, trigger the event. Then you can try keeping in the IdentityTrigger Rule (Event Type → Rule), then return true or false and no need to set the Included Identities.
There is another one criteria to be considered. isDormantUser should be true.
But the lifecycle event should be triggered for all the users having isDormantUser=true. IF the user is not present in custom file, then the user should be skipped.
Hi @neel193 Having the code to check the custom object increases the number of times the custom object is read. As a temporary solution, we added check in the Identity trigger rule. Keeping the Event “Disabled” helps reducing the number of times the custom object is read.
@DivyaSubha You can also store it in customGlobal to avoid accessing custom object multiple time. You can load it once and check if entry is there, if yes, then use the value which is there in custom global.
It is not recommended to use context.decache(), always use context.decache(object). If you use decache(), it may lead to lazily initialization exception.
However, decache is not needed in IdentityTrigger rule.. When you are iterating over multiple identities, or handling multiple objects, then it is required to do decache periodically..
In identity trigger, you are only dealing with the single user at a time. so it’s not needed to do it.