MIXED_DML_OPERATION

MIXED_DML_OPERATION

Ever getting this error "MIXED_DML_OPERATION: DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): User, original object: ServiceResource."?

What I was trying to achieve is I wanted to update an inactive service resource without going to the user detail and activating it and that has to happen via flow.

I created a Screen flow on the Service resource and I set the user to be isActive=True when the update happens.

For Deactivating the user you may need a scheduled trigger flow which runs daily for my use case and find the resource which was set to active and set it to false.

Doing this way I was able to make the user IsActive true or false.

Hope that helps for anyone who is getting the same error.

要查看或添加评论,请登录

Deepak Raj的更多文章

  • Email Action

    Email Action

    Create a Link to the Record Are you having any trouble directing a user to a record from the email sent by a flow, here…

    2 条评论
  • How to get Record Type Dynamically

    How to get Record Type Dynamically

    This is one of the common scenarios Salesforce admins wonder "How to get Record Type Dynamically over hard coding Id of…

    2 条评论
  • 2 ways of sending email from Salesforce

    2 ways of sending email from Salesforce

    Email functionality is one of the main and essential features in Salesforce, it helps the customer to be updated on…

    1 条评论
  • Flow

    Flow

    Understanding Flow elements can be very tricky, I feel that pain because I have been through that. I also purchased a…

    8 条评论

社区洞察

其他会员也浏览了