You need to sign in to do that
Don't have an account?
sfadm sfdev
Avoid Error: MIXED_DML_OPERATION vol. 2
Hello,
I'd like to continue my conversation from my previous discussion with subject "Avoid Error: MIXED_DML_OPERATION".
What I'd like know now is how to set the permission set
The Approval process is actually over when the stage of the current Opportunity is changed to "Proposal".
In order to find out when the Opportunity stage will be changed from "Discovery" to "Proposal" I was thinking of implementing an event listener which will monitor the Opportinity stage. And when the Opportunity stage is changed to "Proposal" the listener will invoke the DeletePErmissionSetAssignemt() method. I know this can be achieved in Java but in I'm not fully aware how to implement such an event listener in Salesforce. Could you please advise and give an example of how to implement an event listener in Salesforce? If there is no such way can you suggest an appropriate solution to what I'm trying to achive?
Thank you
I'd like to continue my conversation from my previous discussion with subject "Avoid Error: MIXED_DML_OPERATION".
What I'd like know now is how to set the permission set
PermissionSetAssignment psa = new PermissionSetAssignment(PermissionSetId = '0PS7E000000DBGA', AssigneeId = currentuserId);when the Approval process is over.
The Approval process is actually over when the stage of the current Opportunity is changed to "Proposal".
In order to find out when the Opportunity stage will be changed from "Discovery" to "Proposal" I was thinking of implementing an event listener which will monitor the Opportinity stage. And when the Opportunity stage is changed to "Proposal" the listener will invoke the DeletePErmissionSetAssignemt() method. I know this can be achieved in Java but in I'm not fully aware how to implement such an event listener in Salesforce. Could you please advise and give an example of how to implement an event listener in Salesforce? If there is no such way can you suggest an appropriate solution to what I'm trying to achive?
Thank you
you can assign Permission set to user when the status changes through a trigger.
Setp1 : Write a trigger on Opp After update.
get the Opp status
If Condition Check the if its "Proposal"
Added the below Code:
Hope it will clear. it may help you to solve your probelm
Thanks
karthik
And Another Suggestion: (with out Code)
Create Flow for PermissionSetAssignment
using process builder to excute the flow Assignment
Thanks
karthik
Thank you for your comment and advise.
I'll try to create an after update trigger in the Opportunity object,
but I was wondering could you be more specific and can you please give an example on how to create flow for PermissionSetAssignment using process builder?
Thank you
sorry for late reply
Kinldy go through below link to assign permission set using process builder.
https://automationchampion.com/2014/07/18/automatically-add-permission-sets-to-new-user/
Hope this will help you. Make it solved its clear for you.
Thanks
karthik