Jump to content

Search the Community

Showing results for tags 'onrecordstart'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome
    • Start Here!
    • News
  • Software-Related Talk
    • Documentation
    • Getting Started
    • The JavaScript Library
    • FusionPro® VDP Creator
    • FusionPro® VDP Producer
    • FusionPro® VDP Server (API)
    • FusionPro® Expression®
    • MarcomCentral®
  • Support
    • Issues, Questions, Etc.
    • Digital Workflow Documents
    • Fonts
  • Off Topic
    • Customer Polls
    • Job Board (Moderated)
    • Reviews, Rants, and General Musings

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Location


Occupation


FusionPro VDP software version


OS


Acrobat Version


Homepage


ICQ


AIM


Yahoo


MSN


Skype


User Title

Found 16 results

  1. Hello, I am a newbie will little Javascript training. I am setting up a template that has two pages; one being a welcome and thank you letter and the second being a material request. The document only needs to be printed if there are actual requests in variables 1-14. If one of those fields are populated the document will be printed. Upon composing all records are being composed, instead of just the records with material requests. if(Field("VARIABLE1") || Field("VARIABLE2") || Field("VARIABLE3") || Field("VARIABLE4") || Field("VARIABLE5") || Field("VARIABLE6") ||Field("VARIABLE7")||("VARIABLE8") || Field("VARIABLE9") || Field("VARIABLE10") || Field("VARIABLE11") || Field("VARIABLE12") || Field("VARIABLE13") ||Field("VARIABLE14")!="") FusionPro.Composition.ComposeThisRecord = true else if(Field("VARIABLE1") || Field("VARIABLE2") || Field("VARIABLE3") || Field("VARIABLE4") || Field("VARIABLE5") || Field("VARIABLE6") ||Field("VARIABLE7")||("VARIABLE8") || Field("VARIABLE9") || Field("VARIABLE10") || Field("VARIABLE11") || Field("VARIABLE12") || Field("VARIABLE13") ||Field("VARIABLE14")=="") FusionPro.Composition.ComposeThisRecord = false;
  2. 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. 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>';
  3. I am trying to create a banner with a few fields and some size changes based upon one of the fields. I have 3 sizes for banners (18x12, 60x30, 72x36) based upon the number of years selected 1-5 = 18x12 10-15 = 18x12 20-25 = 60x30 30+ = 72x36 With 3 layouts for the background Style 1 Style 2 Style 3 The field for "Years of service" is entered in manually while the background is based on a pick list of the 3 styles. I believe that OnRecordStart would be my best bet for this, but I'm not getting the result I was hoping for. I have set all pages to "Body, unused" and then I get no records to show. Originally I had all pages set to "Body" and each page displayed, which was not what I was looking for either. I couldn't find anything that was similar enough for me to build off of on the forum yet, so I decided to post my javascript here and maybe someone would be able to find out what I am missing. Thanks for the look and any and all help! var Background = Field("Background"); if (Field("Years of Service") >=1 && Field("Years of Service")<= 5) + Field("Background") == "Style 1"; return ("Style 1 18x12"); if (Field("Years of Service") >=10 && Field("Years of Service")<= 15) + Field("Background") == "Style 1"; return ("Style 1 18x12"); if (Field("Years of Service") >=20 && Field("Years of Service")<= 25) + Field("Background") == "Style 1"; return ("Style 1 60x30"); if (Field("Years of Service") >=30 + (Field("Background") == "Style 1")); return ("Style 1 72x36"); if (Field("Years of Service") >=1 && Field("Years of Service")<= 5) + Field("Background") == "Style 2"; return ("Style 1 18x12"); if (Field("Years of Service") >=10 && Field("Years of Service")<= 15) + Field("Background") == "Style 2"; return ("Style 2 18x12"); if (Field("Years of Service") >=20 && Field("Years of Service")<= 25) + Field("Background") == "Style 2"; return ("Style 2 60x30"); if (Field("Years of Service") >=30 + (Field("Background") == "Style 2")); return ("Style 2 72x36"); if (Field("Years of Service") >=1 && Field("Years of Service")<= 5) + Field("Background") == "Style 3"; return ("Style 3 18x12"); if (Field("Years of Service") >=10 && Field("Years of Service")<= 15) + Field("Background") == "Style 3"; return ("Style 3 18x12"); if (Field("Years of Service") >=20 && Field("Years of Service")<= 25) + Field("Background") == "Style 3"; return ("Style 3 60x30"); if (Field("Years of Service") >=30 + (Field("Background") == "Style 3")); return ("Style 3 72x36"); switch(Background) { case "Style 1 18x12": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",true); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); break; case "Style 1 60x30": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",true); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); break; case "Style 1 72x36": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",true); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); break; case "Style 2 18x12": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",true); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); break; case "Style 2 60x30": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",true); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); break; case "Style 2 72x36": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",true); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); break; case "Style 3 18x12": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",true); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); break; case "Style 3 60x30": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",true); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",false); break; case "Style 3 72x36": FusionPro.Composition.SetBodyPageUsage("Style 1 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 1 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 1 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 2 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 2 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 2 72x36",false); FusionPro.Composition.SetBodyPageUsage("Style 3 18x12",false); FusionPro.Composition.SetBodyPageUsage("Style 3 60x30",false); FusionPro.Composition.SetBodyPageUsage("Style 3 72x36",true); break; }
  4. So I was able to come up with a good rule for On Record Start for a Name/Title field, but then had to add in a condition for the address as well. It worked perfectly fine until I added the address portion & now it will only use the 'long page', even when the 'short page' is supposed to be used. Is there something missing below? I've been racking my brain to figure out what is going on, but every time I validate, FusionPro returns 'Expressions Ok'. Thanks for the look. var name = Field("Name"); var title = Field("Title"); var nametitle = name + "," + title; if (nametitle.length <= 26){ FusionPro.Composition.SetBodyPageUsage("Short Name", true); FusionPro.Composition.SetBodyPageUsage("Long Name", false); } else{ FusionPro.Composition.SetBodyPageUsage("Short Name", false); FusionPro.Composition.SetBodyPageUsage("Long Name", true); }; var address = Rule("Format Address"); if (address.length <= 40){ FusionPro.Composition.SetBodyPageUsage("Short Name", true); FusionPro.Composition.SetBodyPageUsage("Long Name", false); } else{ FusionPro.Composition.SetBodyPageUsage("Short Name", false); FusionPro.Composition.SetBodyPageUsage("Long Name", true); }
  5. My data file has a field that has two parts I only want to create a new output file when the first part of the data changes. See the sample data below. Can I use an array to only create a new output file when T1 changes to T2 or do I need to split my data into two fields before using it into FusionPro? Sample data looks like (Sack and Pa is one data field currently) Sack and Pa T1 P1 T1 P1 T1 P2 T1 P2 T2 P1 T2 P1 T2 P2 ... ... Thanks in advance for any help you can provide
  6. Hello, I'm having some issues with a tricky file I need to compose. I have 2 documents and 1 set of data to use for both. Normally to pull up a page you could use a Field that has been defined in the data for that purpose, however there isn't one exactly for this case. Which 6-page document I use is determined by the value of the ASK field. http://i.imgur.com/aXzSuCz.png Now I've set up an OnRecordStart rule that checks if there is a value in that field or not Like so: http://i.imgur.com/2iE7EyO.png And the body pages like so: http://i.imgur.com/o5ppLCn.png It seems pretty straightforward, if there is no value or a null value then the 6 body pages that will be composed for a record will be NO ASK-P1 through P6. However all I get are errors. http://i.imgur.com/UZ8t42m.png What am I missing?
  7. I have a business card with two text boxes: TextBoxLeft and TextBoxRight. TextBoxLeft contains the following fields/rules: - Name - Title 1 - Title 2 - Title 3 - Email Address TextBoxRight contains the following fields/rules: - Address Line 1 - Address Line 2 - City, State Zip Code - Phone Number - Fax Number - Website Regarding TextBoxLeft ... sometimes the titles are so long that the Email Address gets truncated (even with CopyFit). So I want to write a rule that does this: - If all of the text in TextBoxLeft does not fit Move the Email Address field to TextBoxRight - Otherwise, Email Address remains in TextBoxLeft
  8. I have a document that imposes to 4-Up, perfectly fine. I have also used the OnRecordStart call to create new output files when a field changes on other projects. However, I have been searching through the forum to find a way to combine these two tasks. I have a data file and need 91 separate imposed documents. I want to avoid processing each of the 91 files separately, but each time I use the imposition with the combined data, the FieldChanged command doesn't execute correctly. I haven't been able to find a post that addresses this specific topic, but would appreciate any guidance available. Thanks
  9. Hello, Has anyone out there has found a way to adjust Linked Text Frames in the OnRecordStart rule or any other rule? I have 3 linked Text Frames that have continuous text flowing through them. When I linked the text frames, the program applied the same name to all three. However, when I add the code to my OnRecordStart rule to adjust the y coordinate for the text frames with that name, it will only move the first box in the series. Example: (moving frames 1 inch down on the y axis) var ExFrame = FindTextFrame("Example Text"); if (Field("SampleField")== "Yes"){ ExFrame.y = (ExFrame.y) + (1 * 7200); } Thoughts? P.S. 1 text box with multiple columns are not an option.
  10. For each template that we create we are adding an OnRecordStart rule that sets the quantity to print for each record from a field in the data base. What I would like to know is if there is a way to set this up as a global rule or function so I don't have to keep copying and pasting it at template creation. I couldn't find anything in the documentation which indicated how to create a callback rule, just text or graphics. Thanks.
  11. sometimes I need to compose simple letters with names, addresses and dates. The problem is that it's never today's date. Or any predictable date. The customer simply tells me the date when they give me the data file. The date is NOT in the data file. Is there a way using OnRecordStart to bring up a dialog box and ask for the date to use? I've tried using window.prompt("Enter Date ","") but have not been getting very far. Thanks George
  12. I have product that has an option for page size, orientation, and bleed. As of now, my product will suppress all pages that are not the size or orientation selected. However, when I compose my record, regardless of my selection for bleed, the "Bleed" and "NoBleed" graphic box appears. Each page has a two graphic fields on them [bleed, NoBleed]. Is the fact that there are multiple graphic frames with the same name an issue? I assume that it should suppress all graphic fields with this name. if (Field("Bleed") == "Yes"){ FindGraphicFrame("Bleed").suppress = false; FindGraphicFrame("NoBleed").suppress = true; } else { FindGraphicFrame("Bleed").suppress = true; FindGraphicFrame("NoBleed").suppress = false; } if (Field("Orientation")== "Portrait") { FusionPro.Composition.SetBodyPageUsage("small_L", false); FusionPro.Composition.SetBodyPageUsage("large_L", false); if (Field("Size") == '11" x 17"' ) { FusionPro.Composition.SetBodyPageUsage("small_P", false); FusionPro.Composition.SetBodyPageUsage("large_P", true); } else if (Field("Size") == '8.5" x 11"' ) { FusionPro.Composition.SetBodyPageUsage("small_P", true); FusionPro.Composition.SetBodyPageUsage("large_P", false); } } else if (Field("Orientation")== "Landscape") { FusionPro.Composition.SetBodyPageUsage("small_P", false); FusionPro.Composition.SetBodyPageUsage("large_P", false); if (Field("Size") == '11" x 17"' ) { FusionPro.Composition.SetBodyPageUsage("small_L", false); FusionPro.Composition.SetBodyPageUsage("large_L", true); } else if (Field("Size") == '8.5" x 11"' ) { FusionPro.Composition.SetBodyPageUsage("small_L", true); FusionPro.Composition.SetBodyPageUsage("large_L", false); } }
  13. I am trying to execute 2 independent if statements in the OnRecordStart rule. One is meant to manage a text box: if (Field("FieldName") =="") { FindTextFrame("MyTextFrame").fillColorName = "white"; FindTextFrame("MyTextFrame").content = "<span color=white>" + FindTextFrame("MyTextFrame").content; } The other activates a page in the document: if (Field("FieldName2") != "") { FusionPro.Composition.SetBodyPageUsage("OtherPage",true) } Can anyone explain how to keep these two statements independent of each other? I am unable to create 2 different OnRecordStart rules, so I am forced to place them in the same rule. I assume I can insert instructions to treat these statements on their own, but my searches for a solution have been fruitless so far. Thank you for taking the time to look at this.
  14. I have a multi-page PDF that will use only one of the pages based on the state the user selects. I've set all of the pages to "Unused" under manage pages, and have created a rule for OnRecordStart. This rule works fine and gives me the results I expect. However, it gives me the error "Function Does Not Return a Value" when I save the rule. It also gives me an error when I compose it, but the composed file IS correct. I'm guessing that my script is missing something. Here's what I have in OnRecordStart: if (Field("State") == "Florida") { FusionPro.Composition.SetBodyPageUsage("MC34310_FL", true); } else if (Field("State") == "New Hampshire") { FusionPro.Composition.SetBodyPageUsage("MC34285_NH", true); } else if (Field("State") == "New York") { FusionPro.Composition.SetBodyPageUsage("MC34467_NY", true); } else if (Field("State") == "Texas") { FusionPro.Composition.SetBodyPageUsage("MC34700_TX_1210", true); } else { FusionPro.Composition.SetBodyPageUsage("MC34188", true); }
  15. Have three pages in my PDF (Body 1, Body 2, Body 3) Trying to get them to displayed based on values entered in a field called "SelectStyle" Basically what I want to accomplish is this: IF Field SelectStyle = "FJ Icon (M)" then display Body 2 IF Field SelectStyle = "DryJoys Tour (M)" then display Body 3 ELSE display Body 1 Here is what I got that's not working: if (GetFileName(Field("SelectStyle")) == "FJ Icon (M)") { FusionPro.Composition.SetBodyPageUsage("Body2", true); FusionPro.Composition.SetBodyPageUsage("Body1", false); FusionPro.Composition.SetBodyPageUsage("Body3", false) { if (GetFileName(Field("SelectStyle")) == "DryJoys Tour (M)") { FusionPro.Composition.SetBodyPageUsage("Body3", true); FusionPro.Composition.SetBodyPageUsage("Body2", false); FusionPro.Composition.SetBodyPageUsage("Body1", false) } else FusionPro.Composition.SetBodyPageUsage("Body1", true); FusionPro.Composition.SetBodyPageUsage("Body2",false); FusionPro.Composition.SetBodyPageUsage("Body3",false) }} Can anyone see what I'm doing wrong?!? Thanks ahead of time!
  16. I am using overflow pages to create a multi-page document. There are 62 different data scenarios (the template data file). My issue: the overflow pages do not render in the template's "preview" mode. I can only see them after composition. I need to see them in preview mode because there are a few data scenarios that cause excessive pages to be added. I need to know which ones (in preview mode) so I can examine the rules and determine why. I think there should be an "OnRecordStart" rule I could write to invoke the overflow pages during preview... but I cannot seem to craft one. Any ideas?
×
×
  • Create New...