Copy link to clipboard
Copied
Hello,
I have a requirement to fulfill in Adobe forms:
I already have a checkbox that is checked based on an Export Value that I have set and that value comes from Salesforce. The requirement is to fill another text field if that checkbox is checked. The problem is that when I do this the only value that comes is "Off" or ""(empty string). The good thing is that the checkbox is checked if the value that comes from Salesforce is true - so the checkbox is working. The problem is only for the text field which has the following javascript:
if (this.getField("CheckBox").isBoxChecked(0))
{event.value = "Test";}
else {event.value = "";}
Also if I try to not use the value from the Adobe Form Checkbox and instead use the value from Salesforce(that helps to check the checkbox), still it is not working:
if (this.getField("Field From Salesforce").value == True)
{event.value = "Test";}
else {event.value = "";}
Copy link to clipboard
Copied
To fill a text field based on whether a checkbox is checked in Adobe forms, use this Javascript: `if (this.getField("CheckBox").isBoxChecked(0)) { event.value = "Test"; } else { event.value = ""; }`. If you're using a value directly from Salesforce, ensure it's correctly interpreted as `true` or `false`, possibly by checking if the Salesforce value is a string like `"true"` or `"false"`.
Copy link to clipboard
Copied
To fill a text field based on whether a checkbox is checked in Adobe forms, use this Javascript: `if (this.getField("CheckBox").isBoxChecked(0)) { event.value = "Test"; } else { event.value = ""; }`. If you're using a value directly from Salesforce, ensure it's correctly interpreted as `true` or `false`, possibly by checking if the Salesforce value is a string like `"true"` or `"false"`.
Copy link to clipboard
Copied
Your first script should work, where did you place the script?
Check console for errors.
Copy link to clipboard
Copied
I forgot to mention that we use Conga Composer to make the relation between Salesforce and Adobe. Also, how to check for console errors? I just get a generated pdf with my mappings in it.
Copy link to clipboard
Copied
In Acrobat, make sure console is enabled in preferences, then you can press CTRL+J to open console, also if you can post your file so we can take a look and see if it's an issue with the script or problem is somewhere else.
Copy link to clipboard
Copied
In your 2nd script, is the name of the field "Field From Salesforce" or "CheckBox" as in your first script? Are you sure the value is True and not true (lower case t)? If it is True it should be in quotes ("True"). In your first script, is there only one widget of the CheckBox field? The 0 in brackets is for the first widget.
Copy link to clipboard
Copied
Doesn't make much sense to use !="Off" if there are multiple checkboxes, if there aren't checkThisBox is fine.
Copy link to clipboard
Copied
Correct.