Jump to content

TotalChoiceNate

Registered Users - Approved
  • Posts

    17
  • Joined

Posts posted by TotalChoiceNate

  1. Hello,

     

    We just received a "New Sales Order" for a regular item which we use and there was no job ticket sent along with it. I checked the settings in the product and everything seems to be in order. It was working yesterday as well. Any ideas what the issue could be?

     

    Thanks

  2. Follow up question on this. I am now needing to implement a rule on this template, that incorporates the "Change case selection of name field" to one of the XDF fields that are being pulled in to the template.

     

    The problem that I am running in to, is when I write the rule to add the name field, it is giving me an error saying that the field doesn't exist (because it doesn't exist in the template, only in the XDF). Is there a way to write it in-line in the text box where the rule is to convert just that line to small caps?

     

    Below is the rule set that I currently have:

     

    My Rule Trying to convert "STPL1" field from my XDF to small caps:

     

    // Rule converted from XML Template "Case selection for a name field Rule":

    // Please specify a field and choose the appropriate case.

    // Begin XML Template selections //

    var Var1 = "STPL1"; // "Choose a field for the conversion to appropriate case." (Required): FieldList

    var CaseSelection = "smallcaps"; // "Choose case.": PickList ["allcaps" (ALL CAPS), "smallcaps" (small caps), "propercase" (Proper Case or Title Case), "lowercase" (lower case)]

    // End XML Template selections //

     

     

     

    if(CaseSelection == "allcaps")

    return ToUpper(Field(Var1));

     

    if(CaseSelection == "smallcaps")

    return "<smallcap>" + Field(Var1) + "</smallcap>";

     

    if(CaseSelection == "propercase")

    return ToTitleCase(Field(Var1));

     

    if(CaseSelection == "lowercase")

    return ToLower(Field(Var1));

     

     

     

     

     

    And my "OnRecordStart" Rule:

     

    var XDF = new ExternalDataFileEx("MasterDeparmentsListFinal.txt");

    var found = XDF.FindRecord("Full Name", Field("Department"));

    if (found > 0)

    {

    for (var i = 0; i < XDF.fieldCount; i++)

    FusionPro.Composition.AddVariable(XDF.GetFieldValue(0, i), XDF.GetFieldValue(found, i));

    }

  3. Good afternoon!

     

    I am having trouble with my first external data file and hoping someone can help. What I am needing to do is simply call office names from a data file and it isn't working. I've attached my rules below, any help is greatly appreciated!

     

    // This is in "OnJobStart"

    XDF = new ExternalDataFileEx("MasterDeparmentsListFinal.txt"); //MasterDepartmentsListFinal.txt is housed in the same folder as the master PDF file.
    
    return XDF.valid;
    

     

    This is contained in a blank javascript text rule:

    if (FusionPro.inValidation)
    Rule("OnJobStart");
    
    primaryline1 = "";
    
    for (i = 1; i < XDF.recordCount+1; i++)
    
    {
    Department = XDF.GetFieldValue(i, 2);
    	{
    		if (Field("Department") == Department)
    			{	
    				var primaryline1 = XDF.GetFieldValue(i, 3);
    			}
    	}
    }
    
    return primaryline1;
    

     

    The below text is the beginning of the External file, whereas the Template column corresponds to a Set page usage rule to control which template it is dropped in to, Full name is the name of the Office/Department that will be contained in a drop down list on our portal, and PrimaryLine1, PrimaryLine2 and Secondary Line1 correspond to values that need to populate the variable information inside of the template.

     

    Template	Sequence	Full Name	PrimaryLine1	PrimaryLine2	Secondary Line1
    1line	1	Division of Humanities 	Division of Humanities		
    1line	2	Art and Art History Department 	Art and Art History Department		
    1line	3	Chinese and Japanese Department 	Chinese and Japanese Department		
    1line	4	Classics Department 	Classics Department		
    1line	5	English Department 	English Department		
    1line	6	French and Arabic Department 	French and Arabic Department		
    1line	7	German Department 	German Department		
    1line	8	Music Department 	Music Department		
    1line	9	Philosophy Department 	Philosophy Department		
    1line	10	Religious Studies Department 	Religious Studies Department		
    1line	11	Russian Department 	Russian Department		
    1line	12	Spanish Department 	Spanish Department		
    1line	13	Theatre and Dance Department 	Theatre and Dance Department		
    1line	14	Division of Science 	Division of Science		
    1line	15	Biological Chemistry Department 	Biological Chemistry Department

     

    If anyone has any idea of how to write a set page usage rule to set the active pages to the corresponding named pages in the template, that would be much appreciated as well! I'm sure I can figure it out once I understand the XDF rules, but that would skip a step for sure. Thank you in advance!

  4. Good afternoon,

     

    I am attempting to hide a couple column rows on the billing checkout page and not having any luck. Anyone more experienced have any ideas?

     

    Basically, what we are running in to, is that we want to allow them to key in an account number, but not give them the ability to change that account number on a product by product basis (hence the need to hide the column rows that are generated.) Screenshot example is attached.

     

    6lmwu7r6f

    ScreenShot2018-05-08at2_01_19PM.jpg.523c6d61cd6dc67de9f040d58ae24637.jpg

  5. Greetings!

     

    Question for fellow MarcomCentral users out there, what is your preferred method, if any, in how to handle rush fees? Currently we have it set up that the end user is to select a Custom Shipping method with that is associated with the preferred rush (2 day, next day, same day) but the problem that we are running in to is that people are needing rushes, but not selecting the rush which then does not apply the fee.

     

    Any suggestions would be greatly appreciated!

  6. That's correct, this rule appears to be the perfect solution, but I'm not sure it is seaching the fields to replace characters as nothing is changing. Normally these quotes are used to specify an Alumni year and by using the class year as its own field it inserts the apostrophe fine (see below)

     

    if (Field("Class Year") == "")
    return "";
    else
    return ' ’'+Field("Class Year");

     

    But once they type the custom text (same characters) in to a storefront field it breaks. I replaced the rule within the template to what I have below and it doesn't seem to be working.

     

    // An object of values to find as the keys,
    // and the string to replace them with as the value.
    var charMap = {
    // Find      : Replace
      "&rsquor;":"’",
      "&rsquor;":"'",
      "¼":"¼",
      "½":"½",
      "¾":"¾",
      "—":"–",
      "—":"—",
    }
    
    // Loop through all of the fields.
    for (var [color="red"]field[/color] in FusionPro.[color="red"]Fields[/color]) {
     // Loop through all of the find/replace values for current field.
     for (var find in charMap) {
       var replace = charMap[find];
       FusionPro.Composition.AddVariable([color="red"]field[/color],
         ReplaceSubstring([color="Red"]Field[/color]([color="red"]field[/color]), find, replace), true);
     }
    }

     

    Just so I understand correctly, I should replace the red text with "TaggedDataField"? Currently this is the only rule that I have in the template and is an OnRecordStart callback which doesn't give me the option to treated returned strings as tagged text.

  7. Hello all!

     

    I am working with a bit of a pain customer. When I enter certain extended characters in the MCC Storefront it either switches them with greek symbols or switches them back to a standard char set (The character in question is this special apostrophe that their style guide requires).

     

    The support workaround for this is to type in the entity with a replace substring rule, but the way that they set it up is on an individual field basis, which on some templates can get quite long!

     

    So, my question is a two-fold question:

    • Is there a way to clean up the code below in to a single rule rather than having a separate line for each character?
    • Is there a way to do this as a global replace substring rule versus having to list each field on its own line?

     

    Code in question:

    //The end-user needs to enter in entity values to access special characters. However the following is necessary as MCC tries to "help"
    //in converting entities. The following replace substring will fix the "help" provided so that you can actually return the entity typed in.
    FusionPro.Composition.AddVariable("Date and Time Information",ReplaceSubstring(Field("Date and Time Information"),"&","&"),true);
    FusionPro.Composition.AddVariable("Event Information",ReplaceSubstring(Field("Event Information"),"&","&"),true);
    FusionPro.Composition.AddVariable("Direction 1 Information",ReplaceSubstring(Field("Direction 1 Information"),"&","&"),true);
    FusionPro.Composition.AddVariable("Direction 2 Information",ReplaceSubstring(Field("Direction 2 Information"),"&","&"),true);
    FusionPro.Composition.AddVariable("Direction 3 Information",ReplaceSubstring(Field("Direction 3 Information"),"&","&"),true);
    FusionPro.Composition.AddVariable("Direction 4 Information",ReplaceSubstring(Field("Direction 4 Information"),"&","&"),true);
    
    FusionPro.Composition.AddVariable("Date and Time Information",ReplaceSubstring(Field("Date and Time Information"),"&rsquor","’"),true);
    FusionPro.Composition.AddVariable("Event Information",ReplaceSubstring(Field("Event Information"),"&rsquor","’"),true);
    FusionPro.Composition.AddVariable("Direction 1 Information",ReplaceSubstring(Field("Direction 1 Information"),"&rsquor","’"),true);
    FusionPro.Composition.AddVariable("Direction 2 Information",ReplaceSubstring(Field("Direction 2 Information"),"&rsquor","’"),true);
    FusionPro.Composition.AddVariable("Direction 3 Information",ReplaceSubstring(Field("Direction 3 Information"),"&rsquor","’"),true);
    FusionPro.Composition.AddVariable("Direction 4 Information",ReplaceSubstring(Field("Direction 4 Information"),"&rsquor","’"),true);
    
    FusionPro.Composition.AddVariable("Date and Time Information",ReplaceSubstring(Field("Date and Time Information"),"'","’"),true);
    FusionPro.Composition.AddVariable("Event Information",ReplaceSubstring(Field("Event Information"),"'","’"),true);
    FusionPro.Composition.AddVariable("Direction 1 Information",ReplaceSubstring(Field("Direction 1 Information"),"'","’"),true);
    FusionPro.Composition.AddVariable("Direction 2 Information",ReplaceSubstring(Field("Direction 2 Information"),"'","’"),true);
    FusionPro.Composition.AddVariable("Direction 3 Information",ReplaceSubstring(Field("Direction 3 Information"),"'","’"),true);
    FusionPro.Composition.AddVariable("Direction 4 Information",ReplaceSubstring(Field("Direction 4 Information"),"'","’"),true);

  8. Has anyone else had trouble with the new Modal view pixelating proofs very badly? I like the feature and the look of it, but when I refresh a proof it is hardly readable making the feature un-usable. Hoping someone else has run in to this problem and knows a fix for it?
  9. Hello all!

     

    I am needing to show the input of a custom order field on the invoice that is generated through the distribution tiles. Right now, I have it set up to show up on the job tickets, however when I plug the code in to the invoice custom content (.griditem-CustomOrderField1{text-align: left;}) it does not show up in the table that is generated. Any help would be greatly appreciated.

     

    Thanks!

  10. Hello!

     

    Relatively new to FP and Javascript and had a hard time finding anything about this on the forum, and I'm hoping it is a quick fix. Basically the issue that I am running in to is that my customer has a calendar date input on their portal for an event date that needs formatted, and the rule right now is returning todays date regardless of the input due to the "MyDate = FormatDate(Today(), "ld, lm d, yyyy");" The thing is that I know how it is breaking, but when i change the FormatDate(Today() to FormatDate(Field(Date) it breaks the code. I've attached the full code below, any help would be much appreciated!

     

     

    MyColor = Field("ColorChoice");

    MyDate = FormatDate(Today(), "ld, lm d, yyyy");

    MyTime = Field("Time");

     

     

    if (Field("Date") != "" && Field("Time") != "")

    {

    return '<color name = "'+MyColor+'">' + MyDate + ", " + MyTime;

    }

     

    else if (Field("Date") != "" && Field("Time") == "")

    {

    return '<color name = "'+MyColor+'">' + MyDate;

    }

     

    else if (Field("Date") == "" && Field("Time") != "")

    {

    return '<color name = "'+MyColor+'">' + MyTime;

    }

     

    else

    {

    return "";

    }

×
×
  • Create New...