merski007 Posted January 10, 2018 Share Posted January 10, 2018 Hello, I'm having an issue with the Preview not displaying correctly. The rule I'm using validates correctly, but breaks on preview. In a nutshell, here is the code for this function // declare variable color hits HIT_COLOR_BLACK = "black"; HIT_COLOR_WHITE = "white"; // create array of objects HIT_COLOR_CHOICE = {1: HIT_COLOR_BLACK, 2: HIT_COLOR_WHITE}; // retrieve items in desired color function getItem(item, colorNumber){ return '<color name=' + HIT_COLOR_CHOICE[colorNumber] + '>' + '<tracking newsize="6">' + item; } During positioning and proofing, we will switch the color hits globally, just to check our work. When I validate the rule with this function, the correct results appear: <color name=black><tracking newsize="6">pizza but the color does not come through on preview. The text will default to the color set in the text box. I have the 'Treat returned string as tagged text' box checked, so it's not that. If i hardcode the color value into the function, or use the variable name itself, the rule works. This would just cause a lot of work on my end to create a function for each color i have. All help is appreciated. Here are system details: FP: 9.3.36 OS: Mac OS 10.12.6 Acrobat 11 Cheers, Mark Quote Link to comment Share on other sites More sharing options...
merski007 Posted January 10, 2018 Author Share Posted January 10, 2018 I figured out what I was doing wrong. All my functions were declared in OnJobStart via remotes js files. I had to declare the HIT_COLOR_CHOICE object array in OnRecordStart. Once i did that, everything works. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.