This blog contains some of the Salesforce facts which I have found quite interesting. Happy learning.
Salesforce Fact #545 | $UserRole in formula
Get link
Facebook
X
Pinterest
Email
Other Apps
We can use $UserRole global variable in formula field and validation rule to get the role of the current user, Similar to flow. However, the 'ParentRoleId' field is not accessible in formula.
I searched for the importance of the Salesforce Management system. Thanks, admin, for sharing such wonderful content on this topic. Now I have got everything I need about it.
Generally apex batch jobs are scheduled to run at particular time intervals. But suppose we have a use case where we need to run the batch job on adhoc basis. We can call the batch apex from a screen flow in that case and the screen flow can be invoked from a button. So, the batch job can be executed on demand. Attached are the screenshots.
In apex, in order to get the current user role name we need to query the UserRole object. We cannot get it directly using UserInfo object since it has only one method related to role i.e getUserRoleId(). Using this Id returned we can get the data from UserRole object. But that is not that complex in flow. In case of flow, we can directly get the current user role name using the syntax: {!$UserRole.Name}. Attached are the screenshots.
We can pass list of Sobject records from LWC to flow as well. We need to define the list variable with @api to denote and expose as a public property in the flow. The meta file configuration remains the same i.e. define the property as @salesforce/schema/<SobjectApiName>[]. Attached are the screenshots.
I searched for the importance of the Salesforce Management system. Thanks, admin, for sharing such wonderful content on this topic. Now I have got everything I need about it.
ReplyDelete