Jump to content

brians

Members
  • Posts

    18
  • Joined

Posts posted by brians

  1. I'm trying to figure out if it's possible to return a result and have it populate a field in MarcomCentral and if it is possible how best do I go about implementing this function? The purpose is to return information from the template that can then have a dynamic price associated to the field.
  2. This works perfectly in that it returns the value I'm look for however I'm not sure how I can now apply a price to the value in Marcom. My goal was to have the result of this rule populate a field that could then have a dynamic price attached. Is it possible to have a rule change the data and therefore make it visible to the intelligent forms?
  3. Looking for assistance in creating a rule that will populate a field with a turnaround level based on input from the user into a Mail Drop Date field. Example: If the user chooses a mail drop date of Monday, February 25th, 2013 and today is Friday, February 22, 2013 the rule will set the turnaround field to Express 2 Business Days.

     

    Rush 2 Business Days

    Mail Drop Date <= 2 Business Days from Today

     

    Express 3 Business Days

    Mail Drop Date <= 3 Business Days from Today and > 2 Business Days

     

    Standard 5 Business Days

    Mail Drop Date >= 5 Business Days from Today

     

    Since the input from the user can be controlled by the calendar function in Marcom I can set this to whatever format is easiest to code.

     

    Thanks in advance for any help you can provide.

  4. I was looking for another solution and ran across this post. Any chance this feature has been added that LeberMac showed a sample of? I read the entire post and I understand the point that theres only so many things you can add but I can't imagine this not being a huges selling point to every printer in the variable print business. Almost every print job that involves finishing work results in some waste. I would use this on a daily basis for my reprints. Just throwing this out there from someone in the field.
  5. I had to make on adjustment to get the expression to pass which was, I changed f=0 to f=1 otherwise it would error ("Error: In Field(), no field named Fact0"). Once this was changed the expression passed but empty variables were still returned during preview.
  6. I'm now trying to add one more level of complexity to this project. We want to take this script and make it possible for the orderer to fill in up to 20 facts but only make 5 required. If they leave a fact blank the script would skip it and randomly place only those that contain text. Below is the script in it's current state. Can one of you please assist?

     

    FusionPro.Composition.repeatRecordCount = Field("Quantity");

    var facts = [TaggedDataField("Fact1"),TaggedDataField("Fact2"),TaggedDataField("Fact3"),TaggedDataField("Fact4"),TaggedDataField("Fact5"),TaggedDataField("Fact6"),TaggedDataField("Fact7"),TaggedDataField("Fact8"),TaggedDataField("Fact9"),TaggedDataField("Fact10"),TaggedDataField("Fact11"),TaggedDataField("Fact12"),TaggedDataField("Fact13"),TaggedDataField("Fact14"),TaggedDataField("Fact15"),TaggedDataField("Fact16"),TaggedDataField("Fact17"),TaggedDataField("Fact18"),TaggedDataField("Fact19"),TaggedDataField("Fact20")]; // Create an array of facts

    result = []; // Create an array to hold the facts at random

    for (var i=0; i<3; i++){

    var number = Math.floor(Math.random()*facts.length); // generate a random number between 0 and length of the array

    result.push(facts[number]); // push the fact into the result array

    facts.splice(number,1); // remove that fact from the Facts array so that it won't be pulled again

    }

     

    FindTextFrame("Fact1").content = result[0];

    FindTextFrame("Fact2").content = result[1];

    FindTextFrame("Fact3").content = result[2];

  7. Can you give an example of how one of the text rules might look? This is where I'm having difficulty is in understanding how to grab just the first fact or just the second. Actually I thought I had a way in using the commas but that became a problem when the fact contained a comma.
  8. Thanks step. I'm on to the next template which uses the same type of random facts however for this one I need to return the facts to seperate frames and flowing them from one frame to the next won't work due to variable lengths and being multi-line in some cases. Is there a way to access the random facts on an individual basis from the original rule below?
  9. One final sticking point. I need each fact on a seperate line without the commas. I added \r\n to add the returns but connot seem to get rid of the commas.

     

    var facts = ["fact1","fact2","fact3","fact4","fact5","fact6","fact7","fact8"]; // Create an array of facts

    var result = []; // Create an array to hold the facts at random

    for (var i=0; i<3; i++){

    var number = Math.floor(Math.random()*facts.length); // generate a random number between 0 and length of the array

    result.push(facts[number]+"\r\n"); // push the fact into the result array

    facts.splice(number,1); // remove that fact from the Facts array so that it won't be pulled again

    }

    return result;

  10. You hit the nail on the head. Somehow I copied it from the forum and managed to delete the one line. After making the correction I received the exact result I was looking for. Thank you very much. You just made my day.
  11. I'm attempting to randomly fill 2 out of 8 possible facts into my layout. I've tried to pick apart the Bingo template without much luck. Each fact will feature a variable within the string, but this part hasn't been a problem. The problem I'm having is I don't want the facts to duplicate on a single record. Does anyone out there have a suggestion on how to approach this. Right now I'm running a random number generator as a single rule and then reference this rule in two other 2 rules. Below are the two rules (I've simplified the facts for the example). To avoid duplicates I'm pulling the facts from two seperate pools of facts. It works but isn't a prefered method as it limits the possabilities and requires more facts. Any help would be greatly appreciated.

     

    if (Rule("Number1") == "0")

    {

    return RawText("Fact 1");

    }

    if (Rule("Number1") == "1")

    {

    return RawText("Fact 2");

    }

    if (Rule("Number1") == "2")

    {

    return RawText("Fact 3");

    }

    if (Rule("Number1") == "3")

    {

    return RawText("Fact 4");

    }

    else

    {

    return RawText("Fact 5");

    }

    return "";

     

    -----------------------------------

     

    if (Rule("Number1") == "1")

    {

    return RawText("Fact 6");

    }

    if (Rule("Number1") == "2")

    {

    return RawText("Fact 7");

    }

    if (Rule("Number1") == "3")

    {

    return RawText("Fact 8");

    }

    if (Rule("Number1") == "0")

    {

    return RawText("Fact 9");

    }

    else

    {

    return RawText("Fact 10");

    }

    return "";

    -----------------------------------

×
×
  • Create New...