You need to sign in to do that
Don't have an account?

Lock the contact if the order is approved
I have Orders and Contacts, and is it possible when an order is approved to lock the contact until the event is over.
You need to sign in to do that
Don't have an account?
Please elaborate what you mean lock the contact until event is over.
When an order is approved i need automatically the Contact to put in do not contact for example for 5 days or 8 days
The below blog have a working example for your scenario try it,
https://trailblazers.salesforce.com/answers?id=9063A000000Zkl7QAC
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
That didnt helped me , cause i have different objects , Contacts and Orders.
When an order is approved , i want to lock the contact for example for 3 or 4 days or 1 week.
Thanks
Considering you are using Out of Box Order SObject, where you may be using Status field for Approval.
When you say you want to lock the contact record for 3 to 4 days or 1 week, my presumption is from some date on the Order Sobject or it is until the event is over. How the event and approval duration are related, can you explain please.
Keeping the perspective you are using Out of Box Order SObject, you may be using either BilltoContact or ShiptoContact Id.
Please take a look at the below Approval Class that will help you to lock the Contact either single record or multiple (Bulkify).
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_approval.htm
Once you provide some details and if you need further assistance with the code please let us know Thanks.
Was that helpful?