EXEC in PDFRun JavaScript inside PDF templates to calculate values such as deposits or project durations on the fly.Oct 14, 2025Knowledge
InformationArticle BodyExamples Use Case 1: Project duration If you wanted to calculate the duration of a project, you could use the following EXEC block. Example data: { Project: { Project_Start_Date__c: "2025-01-01", Project_End_Date__c: "2025-01-10" }} Template Document: Output: Notes If an EXEC is the only MergeUp syntax in a PDF text field, that field will be removed from your output document.Avoid duplicating business logic already handled in Salesforce, you don't want to maintain that logic in two places. Next Steps About EXEC EXEC in Word EXEC in Excel EXEC in PowerPoint TitleEXEC in PDFURL NameEXEC-in-PDF