You need to sign in to do that
Don't have an account?
Karthikeyan Chandran
How to block users from Active a Contract record?
Hi,
Here my senario, User 1, User 2.
Contract records are auto created under Opportunity when the stage is closed(I used process builder). The newly created Contract records are filled by the user (User 1), Whenever the user (User 1) update the contract records an Approval email is send to User 2, I have created a approval process that notify another user in my org(User 2) for Approve the Contarct record.
We need to prevent the "User 1" from Active(Standard Button) the Contract records(Non Approved Contract Records) until it's approved by the User 2.
Can this possible to do so? if yes, how. validation rule or a trigger, etc..
Thanks & Regards,
Karthikeyan Chandran
+91-9944676540
Here my senario, User 1, User 2.
Contract records are auto created under Opportunity when the stage is closed(I used process builder). The newly created Contract records are filled by the user (User 1), Whenever the user (User 1) update the contract records an Approval email is send to User 2, I have created a approval process that notify another user in my org(User 2) for Approve the Contarct record.
We need to prevent the "User 1" from Active(Standard Button) the Contract records(Non Approved Contract Records) until it's approved by the User 2.
Can this possible to do so? if yes, how. validation rule or a trigger, etc..
Thanks & Regards,
Karthikeyan Chandran
+91-9944676540
I think you can accomplish this by Trigger.on Contract.
In Trigger you can query on record and find out that record is approved or not.
-Thanks
Ashlekh Gera
When you build an Approval Process, while the record is submitted for Approval it is also locked and you've to specify who can modify the record during that phase?
I would suggest you check this configuration within your approval process and you can get this accomplished without any additional code.
At the lowest/softest level, you could use a validation rule to cross check two fields (the status field and some approval status field - which you might have to create, and then set in your final approval actions) - so it would look like this:
and that would stop someone from activating a contract when the approved checkbox (which you set in the approval process) is unticked. (Also use some field level security to stop people manually ticking that box).
Stuff like that sounds complicated, but even as a developer, maintaining lots of fragmented triggers can become a bigger (testing) headache in the future!
There other way is
Hidden Picklist Field Status- Submitted -> Recordtype 1 -> Page Layout 1 -> No Activate Standard Button
After approval of Contract record:
In Final Approval Action update the Hidden Picklist Field Status- Approved. This will fire a workflow and update the Recordtype and associated Page Layout 2 will have the Activate Standard Button
So, After approval the Activate Button will come into existence.
-Thanks
Ashlekh Gera
However, you'd have to make sure the users couldn't manually change the record type (using the "change" link or by editing) - and can you not also "Activate" an order just by changing it's status using the inline editor for the picklist? (ie the button is just one way to activate).
Depending on page layouts to enforce business logic rules is very difficult, because some many things can happen to records outside the page layouts.