Jump to content

ilona

Registered Users - Approved
  • Posts

    26
  • Joined

Everything posted by ilona

  1. Hello! Does anyone know if there is an FP rule that replaces text in a text frame? Here is what I'm trying to accomplish: op1=Field("xyz"); if (op1!="") { FindTextFrame("abc").value=op1; } I was hoping that the above would replace the "value"(the actual text) in the frame with whatever is in op1, but it doesn't... I wonder what the "value" property of a text frame is then... I can't use a simple return statement. This rule is in onRecordStart, and it's more complex than the above, but it's essentially what I need. Any ideas?
  2. True, I could return the value, and then see what gets displayed in the preview in MCC. The GetFileName function really is all I should ever need. Why the need to know the details then? Pure curiosity...and just in case I ever find myself in the unfortunate 1%. I suppose my question here was related to the input data and UI Rules in MarcomCentral vs. resources and FusionPro(yes, Desktop) rules. For example, if I have a rule in FP that looks at a text field A, and if the value in A is "green", then it returns a resource green.jpg for some graphic field B. Then, I go ahead and create a UI rule in MCC that contradicts the FP rule, for example a "Cascading Drop-Down" where if A has a value of "green", then the graphic field B is "blue"(which would be some image blue.jpg). Who wins here? What will be displayed in the MCC preview for the customer? Of course I could simply test this case, and see the results myself, but what I was looking for is more so a general answer where either MCC overpowers FP rules or vice versa no matter what the rule/case is....or does it simply depend on what evil contradicting rules I come up with(meaning case-by-case basis)? I suppose I already have the answer to that: Thanks for answering my confusing questions...watch me be back with more.
  3. That's what I needed... As suspected MCC adds some additional info that gets returned as the field value. In my rule in FP, I replaced: [color=#696969]var img= Field("Gfieldname");[/color] with [color=#696969]var img= GetFileName(Field("Gfieldname"));[/color] and... it works like a charm... Thank you...Much appreciated! I still have two questions: 1. Could you(or anybody else) give me an example of an actual graphic field value in MCC? For example, let's say I have a graphic field named XYZ, and I select a gallery image in MCC which is mypic.jpg for the XYZ field. When I click on the preview button in MCC, what does my field value in the XYZ field become? In other words, what value is getting passed to the GetFileName function? 2. As far as the overriding question: does MCC override FusionPro rules or does FP override MCC selections? Or is it all on a case-by-case basis?
  4. What actual value(after selecting an image) does any graphic field have in MCC? Here is what I'm trying to accomplish: In my template(FP) I have a rule that looks at a graphic field's value, and then returns the name of that value as a string. For example, if the value is "<p>somepic.jpg</p>", the rule returns only the name part: "somepic". Then another rule uses that name to display a resource. The return statement is this: new=somepic+'.pdf'; return Resource(new); The second rule simply displays a resource using the name of the jpg that is used for the first graphic field. This works all great in FusionPro, but it doesn't work in MCC. Both graphic fields in MCC are using library images. My first guess is that maybe the value in the first graphic field is not what I expect it to be. Is the value of any graphic field in MCC the "display name" that gets assigned in the library or the actual image("somepic.jpg" for example)? Also, does MCC override FusionPro rules or does FP override MCC selections?
  5. I got it to work. I was just missing the two forms. I guess it helps if you read the tutorial first... Thanks!
  6. Here are my columns: Product Name, Product ID, User Context ID, Template Field, Value, Quantity, Customer Cost, Seller Cost, Fee Type, Active. There is no "Priority" and the 3rd column is "User Context ID".
  7. Here is the error I'm getting when I try to upload a spreadsheet with dynamic pricing: "- User Context ID does not exist". The User Context ID is blank for all records in the spreadsheets(in order to have it applied to all users). What am I missing? Thanks!
  8. That's exactly what I needed! We actually do have iForms activated, but I couldn't find any info on the usage(except for the forum threads). Thanks for the link! I will probably be back with more questions once I start playing with the pricing...
  9. It is a versioned product, so I guess iForms is the way. Thanks David!
  10. How do I set up different pricing that depends on a drop-down selection? Let's say a drop-down has two values: A and B. If they select A, the pricing is $1, but if they select B, then the pricing changes to $2(lot pricing).
  11. I'm glad that RawTextFromTagged function(that includes special characters like &amp) will be available in FusionPro 8.1. When I did my little research the other day, I only found TaggedTextFromRaw and, as you know, I had to implement the reverse myself. Let me explain exactly what MCC is doing... MarcomCentral is not applying formatting to all the fields. I have it set to apply the formatting to the label fields and the number fields. Why? It's because the user is supposed to have different font formatting available to select from. He/she inputs a phone number, selects font face & font color for the label and the number fields(the two(face&color) drop-downs are set to apply the formatting to all the label and all the number fields). The labels are generated automatically once phone numbers is typed in -that's what the "if phone number not empty, display label + number" rule is supposed to do. Why don't I apply the formatting drop-downs to the label fields only and have numbers as tag free fields? This works just fine in FP as the formatting from the label field gets applied to the whole line(labels and numbers that follow), but it doesn't work in MCC. In MCC the preview displays the selected formatting for labels, but the formatting is not carried over to the phone number that follows the label. It just keeps the formatting the was used in the VariableTextEditor for the number field. I am not sure why that's the case, but because of these differences in behavior between FP and MCC, the OnRecordStart functions don't work correctly either. I used your code, and again, it works just fine in FP, but doesn't work in MCC. I even modified it a little to have it do exactly what I need it to do: function StripTags(text) { var start=-2; var end=-2; var sub=0; var stripped=""; var loopend=text.length; for(i=0; i<loopend; i++) { if (text.indexOf("<") > -1) { start=text.indexOf("<"); end=text.indexOf(">"); sub=(end+1)-start; if (start=="0") { text=Right(text,text.length-sub); loopend=text.length; } else { stripped=text.split('<')[0]; return stripped; break; } } else { stripped=text; return stripped; } } return stripped; } function CheckIfEmpty(text,label) { if (text=="") { return ""; } else { return label; } } var phoneFields = ["TollFree", "Direct", "Cell", "Fax"]; var labels=["TollFreeLabel", "DirectLabel", "CellLabel", "FaxLabel"]; var val=""; for (var i in labels) { val=CheckIfEmpty(StripTags(Field(phoneFields[i])),Field(labels[i])); FusionPro.Composition.AddVariable(labels[i], val); } I will definitely be using the OnRecordStart and the functions available in the future(and variable injection - thanks for introducing the concept to me), but it looks like in this specific case the 8 rules that I created before are the one and only solution that works the same way in both FP and MCC. Thanks again for all your help!
  12. Unfortunately, that will not work in this case(works perfectly in FP, but not in MarcomCentral -that's what my initial post was all about) because font formatting gets applied(the user makes a selection from a drop-down) to the Field("Cell") in MCC. When that happens the rule sees the field as not empty - once a font is selected, the field becomes a string with font tags which makes it not empty. That's why I created a rule to take away the tags and return the remaining string(empty or not)...the returned string is then compared exactly the same way you have it(except I add the '<t>'+Field in the Variable Text Editor instead of having it in the rule itself)...it all seems to work just fine.
  13. FP doesn't magically turn strings into objects?! Bummer. Knowing that Field("") returns a tagged string is quite important... so after doing some research on the functions available in FP, here is my solution... I have a TaggedToRaw rule(returns a string or nothing) that takes away string's tags(if any): var num= Field("Cell"); var start=-2; var end=-2; var sub=0; var stripped=""; var loopend=num.length; for(i=0; i<loopend; i++) { if (num.indexOf("<") > -1) { start=num.indexOf("<"); end=num.indexOf(">"); sub=(end+1)-start; if (start=="0") { num=Right(num,num.length-sub); loopend=num.length; } else { stripped=num.split('<')[0]; return stripped; break; } } else { stripped=num; return stripped; } } return stripped; Then another rule(returns the label) is used to check if the string is empty, and displays(or not) the label: var lab=Field("CellLabel"); if (Rule("TaggedToRawCellRule") == "") { return ""; } else { return lab; } Here is a sample line in the Variable Text Editor:«HideCellLabelRule» «Cell». As you know the problem with the different functionality was that in MCC the number field was not "truly" empty. Having a rule to test for a truly empty string allows for both, the label variables and the number variables, to have the font formatting being applied to them in MCC without causing any issues with the rules...and voila! All working just fine. Thanks so much for all your help Dan! Just a quick question...Right now I have 4 different rules for 4 different labels and phone numbers(8 if you count them all). If I could have a rule with parameters, I would only need one rule for all 4 labels(total of 2 rules would replace the current 8!).Is there a way of having a rule with parameters?
  14. For whatever reason MCC is not cooperating with me... the last idea I had(in my previous post) is not working. In theory, my rule looks at the label variable, grabs the font info, applies it to the number field...but MCC displays the font that was set in the Variable Text Editor. The rule: if (Field("Cell") == "") return ""; else { var val=Field("CellLabel"); var fontName=val.font; var fontSize=val.pointSize; var fontColor=val.Color; var num=Field("Cell"); num.font=fontName; num.pointSize=fontSize; num.Color=fontColor; return '<f name=fontName; size=fontSize; color=fontColor>Cell:</f><t>'+ num; }
  15. They don't have any separate formatting tags. They ARE of a sample font, but, being text variables, they have to have a font. There is no option of choosing no font for a text in the Variable Text Editor. Therefore they always end up being a tagged string. I have tried that already. In fact, everything is set up to "Suppress if Containing Empty Variables" right now. If I set the labels as static text, the formatting of them stays the same(whatever it was set to in the Variable Text Editor and the formatting for the number fields becomes whatever it's selected in MCC). That's why I ended up setting them up as variables. Having them as variables doesn't change the fact that they always have to have a static value: "Cell:" for example. That makes the "Suppress if Containing Empty Variables" pointless in this case. How would I code that? How do you grab a text variable and take the tags away? Would you just delete the last, let's say 7 for "</span>", chars? Also, another idea that I had was to grab the font info from the number fields and then apply that same font to the label fields. I came up with a rule that looked similar to this: if (Field("Cell") == "") return ""; else { var val=Field("Cell"); var fontName=val.font; var fontSize=val.pointSize; var fontColor=val.Color; return '<f name=fontName; size=fontSize; color=fontColor>Cell:</f><t>'+ Field("Cell"); The rule validates and works fine in FP, but when uploaded to MCC, it complains about the number field(Field("Cell")) having undefined font. Wait a second...how about I have it the other way around...and have the formatting applied(in MCC) to label variables(which are never empty and have the font tags) and have the FP rule pull the lables font and apply it to the number fields...I can also set(in MCC) the drop-down font to always have the first value selected(hope you can follow my madness here!). Hmm...it's worth trying. I will try setting it up this way and let you know how it goes.
  16. I see what you are saying about an empty tagged string not being truly empty. I just tried having the formatting apply to labels only, and obviously the rule is now working(other labels are not showing)...but the formatting doesn't carry over to the string after the label(the phone number field) although they are on the same line... Any other ideas?
  17. Here is the issue guys... I have a simple phone label rule in FP: if (Field("Cell") == "") return ""; else{ return Field("CellLabel")+'<t>';} The template's text frame has the following: «Addr1» «Addr2» «City», «State» «Zip» «HideTollFreeLabelRule»«TollFree» «HideDirectLabelRule»«Direct» «HideCellLabelRule»«Cell» «HideFaxLabelRule»«Fax» All the "hide" rules are similar to the one above having instead of Field("CellLabel") a "Direct" field for example. All the rules work just fine when I preview the template using FP...but not in MarcomCentral... Let me just explain how the fields are set-up in MC... All the LABEL VDP fields are active, but hidden and ALWAYS have a value. For example the "CellLabel" field always has the value: "Cell:". In addition, format fields use the label fields to apply different font styles to the label fields. Having said all of the above what I'm trying to achieve is simply what the FP rule is doing, which is: if the field "Cell" is empty display nothing and if it isn't empty, display cell label field + cell field. Why is it all set-up this way? Simply because the phone labels are supposed to have the same font format as the actual number fields. The logic behind all this is fine, but the template is not working in MarcomCentral. It displays the cell label field(for example) even if the cell field is empty. It is doing so because a font style is applied to the cell label field...so the questions is: why is it doing so? Why do the label fields display(just because the font style is being applied to them) and why is the FP rule completely ignored in MC? Can this functional difference between FP and MC be fixed? See attached picture for visual representation of what the issue is. Any suggestion for doing what I'm trying to achieve in a different way would also be much appreciated... Thanks!
  18. I knew it was something simple hiding from me. I will play with the settings. Thanks!
  19. For some reason the "section" fields are not displaying on any of the forms in the store. When I add the section design feature, it shows in the manager, but when I go to order the product, the sections are not displaying on the form. Attached jpgs are the manager set-up view and the form itself... What am I missing?
×
×
  • Create New...