1

I have a button as per below, that will generate a document for the client when clicked.

However, I want to ensure this only fires when a field Job_Number__c has been filled out. And if the field is blank, some sort of error asking for it to be completed.

Can anyone help? I'm not familiar with javascript or apex coding, but hoping this is an easy add?

/apex/APXTConga4__Conga_Composer 
?serverUrl={!API.Partner_Server_URL_370}  &id={!Opportunity.Id} 
&TemplateId=a0W1r00000SGTCeEAP 
&CurrencyCulture={!Opportunity.Currency_Culture_Codes__c}  &ds7=0 
&SF1=1  &FP0=1  &OFN=LOI
Acknowledgement+{!Opportunity.CPQ_Primary_Quote_Number__c}+ -
+{!Opportunity.Order_LOI_No__c}  &Sc0=1  &sc1=attachments
0

I got the answer from Conga direct. And so easy, it will use this in the my furture cl;ean ups to avoid various record types and page layouts etc.

Basically, make a formula field to answer 1 or 0, (or use a checkbox field), and within the button use the '&DC=1' and '&DCL=text+text+text' parametersfor any error message to users.

https://support.conga.com/Conga_Composer/Customizing_Composer_with_Parameters/Composer_Parameter_Guide/DC

https://support.conga.com/Conga_Composer/Customizing_Composer_with_Parameters/Composer_Parameter_Guide/DCL

0

If you end up requiring multiple validations you can use two formula fields:

I called mine Conga Validation Codes (Formula/Number(1,0) and it's a nested IF statement (Case could work here too): EXAMPLE

IF(NOT(ISPICKVAL(Status, "Approved")), 1,
 IF(ISPICKVAL(Status, "Won") || ISPICKVAL(Status, "Contract Signed"), 2, 
  IF(status_updated__c != 0, 3, 
   IF(ISPICKVAL(Pricing_Approval_Status__c, "Approved") && NOT(ISPICKVAL(Type, "New")), 4, 0 
     ) 
    ) 
   ) 
  )

That outputs a number to generate your text in the validation popup within conga from the next formula field, Conga Validation Message (Formula, Text): EXAMPLE

CASE(Conga_Validation_Codes__c, 
1, "This+is+the+text+for+the+first+error",
2, "This+is+the+text+for+the+second+error",
3, "This+is+the+text+for+the+third+error",
4, "This+is+the+text+for+the+fourth+error",
""
)

Then your button will have the following parameters:

&DC={!IF(Quote.Conga_Validation_Codes__c <> 0, "1", "0" )}

&DCL={!Quote.Conga_Validation_Message__c}

Now you're able to check multiple items. The only downside is, if you have multiple errors, they will only show up one at a time from the nested IF statement. So it would have to be resolved after multiple button presses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.