#1
|
|||
|
|||
![]()
I am trying to ensure that no matter the amount variable tagged text elements we have, that we can search the output for missing variables from the data.
I know I would have to do something along the lines of the following JS for each variable we use, but I am hoping I can do this in the OnRecordStart rule and it will work in the individual text rules that already exist outside of the ORS. Code:
var greetingText = '<span color="' + Greet_color + '" font="' + Greet_font + '" pointsize="' + Greet_size + '">'; //Inserting Empty Field! when data is absent if (Field("Greeting") == "") greetingText += "Empty Field!" + '</span>'; else greetingText += Field("Salutation") + " " + Trim(Field("Greeting")) + Field("Punctuation") + '</span>'; |
#2
|
||||
|
||||
![]()
Hi Josh,
This should get you started. You can put this in your OnRecordRule and it will return "Error" when a field is empty. Code:
for (var field in FusionPro.Fields) { result = Field(field); if (result == "") { result = "ERROR" } FusionPro.Composition.AddVariable(field, result); } More information about this can be found in these threads: http://forums.pti.com/showthread.php?t=5040 http://forums.pti.com/showthread.php?t=1913 UPDATE: This doesn't appear to work to replace fields placed in rules. I will see if I can find a solution unless you or someone else beats me to it. (c: Hope this helps. - K
__________________
Windows 7 | InDesign CC 2017 | Acrobat DC 2019 | FusionPro 11.0.8 | MarcomCentral User Last edited by kjacobson; February 13th, 2019 at 01:23 PM.. Reason: Update |
#3
|
|||
|
|||
![]()
KJacobson,
That worked wonderfully! Thanks a bunch!!! |
![]() |
Tags |
error, onrecordstart, search |
Thread Tools | Search this Thread |
Display Modes | |
|
|