#1
|
|||
|
|||
![]()
I am trying to activate unused pages using
if ((Field("DATE01") != ""))The presence of data in DATE01 is what I'd like to trigger the page to appear. What the data is irrelevant. I've tried using "!=" and "==". Any help is appreciated. Thanks! -Ryan |
#2
|
||||
|
||||
![]()
That seems right, though I can't say for sure without the job. Is it not working for you? Are there any messages in the log file?
Is the page marked as Unused initially? It won't matter if you do this instead: Code:
FusionPro.Composition.SetBodyPageUsage("Itinerary", Field("DATE01") != ""); Code:
FusionPro.Composition.SetBodyPageUsage("Itinerary", Trim(Field("DATE01")) != "");
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com. Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs. This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data. Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages. Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance. Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support. How To Ask Questions The Smart Way The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript. Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5. return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)}); ![]() |
#3
|
|||
|
|||
![]()
Here's the .zip file. I've deleted some assets to make the .zip smaller and deleted other sensitive info. Some art or merge fields might not appear correctly.
Thank you for taking a look at it. -Ryan Last edited by ryanceot; February 25th, 2022 at 10:02 AM.. |
#4
|
||||
|
||||
![]()
Thanks for posting the job.
The line of code you posted is fine. But this error message appears in the log file: Quote:
Code:
if (((((Field("PCOMP") == "6") || (Field("PCOMP") == "2")) || (Field("PCOMP") == "D")) || (Field("PCOMP") == "4")) && (Field("PINSC") == "Y")) { FusionPro.Composition.SetBodyPageUsage("TM",true); } if ((Field("PINSC") == "Y") && (Field("PCOMP") == "Y")) { FusionPro.Composition.SetBodyPageUsage("TM",true); } if ((Field("HOST") == "Y")) { FusionPro.Composition.SetBodyPageUsage("TH",true); } if ((Field("SCC") == "1")) { FusionPro.Composition.SetBodyPageUsage("BC",true); } if ((Field("DATE01") != "")) { FusionPro.Composition.SetBodyPageUsage("Itinerary",true); Print("Itinerary page activated."); } This is why I asked: Almost always, there's something in there that's at least a hint as to what the problem is. It's also why it's often difficult, if not impossible, to figure out what the problem is from just a snippet of code. The short answer to how to fix this is: remove the code that's calling out a page that doesn't exist (or add a page with that name). The longer answer is, if you might have callouts for pages that don't exist, then you can put each call into its own try/catch block, so that, even if an exception is thrown, the rest of the rule still runs, like so: Code:
if (((((Field("PCOMP") == "6") || (Field("PCOMP") == "2")) || (Field("PCOMP") == "D")) || (Field("PCOMP") == "4")) && (Field("PINSC") == "Y")) { try { FusionPro.Composition.SetBodyPageUsage("TM",true); } catch (ex) { Print(ex); } } if ((Field("PINSC") == "Y") && (Field("PCOMP") == "Y")) { try { FusionPro.Composition.SetBodyPageUsage("TM",true); } catch (ex) { Print(ex); } } if ((Field("HOST") == "Y")) { try { FusionPro.Composition.SetBodyPageUsage("TH",true); } catch (ex) { Print(ex); } } if ((Field("SCC") == "1")) { try { FusionPro.Composition.SetBodyPageUsage("BC",true); } catch (ex) { Print(ex); } } if ((Field("DATE01") != "")) { try { FusionPro.Composition.SetBodyPageUsage("Itinerary",true); } catch (ex) { Print(ex); } }
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com. Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs. This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data. Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages. Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance. Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support. How To Ask Questions The Smart Way The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript. Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5. return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)}); ![]() |
#5
|
|||
|
|||
![]()
Thank you Dan! Just realized I never posted a thank you. With all the work done on the dates, I think I'll leave as is for now, but I'm interested to know the shortcut.
|
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|