function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ivy TAN 1Ivy TAN 1 

Disable create pdf if approval process is met

Anyone has any idea how to hide "create PDF" in quote object when an approval process is fulfilled? The sales managers will need to get their manager to approve before they can create PDFs.

I have a few logics set in the entry criteria:

a. If discount>6% or
b. If country <> South Asia (a list of countries) or
c. If total price>EUR 200k

I did some research online and will need to use record types, page layout and process builder. I am still quite new to these and am struggling to get this work. 

Do not want to use visual force or apex here as my organization is too new to explore that for now.
Ravindra Kashyap 7Ravindra Kashyap 7
Hi Ivy,

I believe Here by cloning Existing "Quote" page layout(remove create PDF button from cloned layout)  and assigning to RecordType after approval finish, you can achieve this requirement.

Please follow the step:
1. Clone "Quote" page layout and from remove "create PDF" button. Once you remove "Buttons" section will look like this

User-added image
have removed "create PDF" from Quote Detail section. 

2. After this create a RecordType and assing to this page layout
User-added image
in profile set Master RecordType as default, if you want.


3. Now go to approval process which you are using and in Final Approval Actions/Final Rejection Actions(based on requirement) add New Field Update. In this field update you can change RecordType. 
User-added image

User-added image
In your case select Quote Record Type.

Let me know this works for your use case or not.

I hope it will help you 😀
Regards,
Ravindra Nath

 
Ivy TAN 1Ivy TAN 1
Thanks Ravindra for your fast response!
I am going to try this out later. Do we not need process builder? I was brainstorming if I can do this configuration "seamlessly"

Sharing this workflow here, in case others had something in mind too.
approval process
 
Ravindra Kashyap 7Ravindra Kashyap 7
Yes Ivy, if you are using Approval Process on Quote Object then you can utilize Field Update option to change record type. If You are not using Approval process on Quote Object, in this situation you have to create Process Builder or Workflow rule to assing RecordType. 
Ivy TAN 1Ivy TAN 1
Hi Ravindra!
I am almost there! I managed to set the unapprove quote page layout to default, however, there are times where sales manager do not require approval. The Iogic i set now is always going to have the sales manager submit an approval.

This is my current approval process. Attempted to use process builder, however, it kepy throwing me errors. Now I just need to check 

What I am still missing here?
User-added image
 
Ravindra Kashyap 7Ravindra Kashyap 7
This Approval process seems fine, not sure why you are getting error. 
Can you please put more light on what error you are getting?

And also if you are setting RecordType in Approval Process then why you need Process Builder(If you are adding different logic then fine)?
Ivy TAN 1Ivy TAN 1
Hi Ravindra!

I removed the process builder totally as it is confusing me. I am doing thorough testing now, and I managed to get to:

1. Submit approval
2. Manager approve
3. Attempt to creadte pdf and save quote

Got the "Error saving PDF to Quote. Please Try again"
error saving pdf
What could be the cause?
 
 
Ivy TAN 1Ivy TAN 1
I manage to find the error. Let me test out again to see it works! Thanks Ravindra!
​​​​​​Very much appreciated!