You need to sign in to do that
Don't have an account?
Staci
trigger to check box after approval process
I have an approval process set for solutions. What I want is if the INTERNAL ONLY checkbox is unchecked and the status is Accepted, the Visible in Self-Service Portal box needs to get checked. A workflow isn't working as I don't think it thinks it has been edited. If I go into the solution and change something and it fits the criteria, it will then check the box. It won't do this right after the approval process is run.
Can I accomplish this in a trigger? If so, please tell me how. I SUCK at triggers!
Hi,
Lets see if this approach works for you..
I suggest you create a Checkbox custom field on Solutions called isApproved__c and in your ApprovalProcess under 'Final Approval Actions' add a field update and update this checkbox with 'Checked'. So once some approves a Solution record you'll have that custom field Checked. Now add this trigger on Solutions object and this should update the field 'Visible in Self-Service Portal' to checked if IsApproved__c and Internal_Only__c checkbox are selected. I'm assuming the api name of Internal_only__c field.
Here is your test class.
All Answers
Hi,
Lets see if this approach works for you..
I suggest you create a Checkbox custom field on Solutions called isApproved__c and in your ApprovalProcess under 'Final Approval Actions' add a field update and update this checkbox with 'Checked'. So once some approves a Solution record you'll have that custom field Checked. Now add this trigger on Solutions object and this should update the field 'Visible in Self-Service Portal' to checked if IsApproved__c and Internal_Only__c checkbox are selected. I'm assuming the api name of Internal_only__c field.
Here is your test class.
Thank you Magicforce! I just changed one small thing, !Internal_only__c and it worked beautifully!