Tas Posted February 18, 2009 Posted February 18, 2009 I have a rule that includes a tag for line breaks. Some of the data that is being returned contain &'s. The & is being omitted from the output. I've checked the composition log and I am getting an "Unknown Entity" error. Any suggestions?
Alex Marshall Posted February 18, 2009 Posted February 18, 2009 Is the field value being used in a rule which is returning tags? If so, you'll need to use the NormalizeEntities function on the field value. For example: return NormalizeEntities((Field(Var1))); Don't forget to check the box for "Treat Return Strings As Tagged Text".
Tas Posted February 18, 2009 Author Posted February 18, 2009 Yes, the rule is returning tags and I have checked the "Treat Return Strings As Tagged Text" box. I've added the Normalize Entities function and am getting the same result. Do I have it in the incorrect location or am I using the wrong syntax? I don't want to uppercase this text, is that an issue? Here is the rule: if (Field("DISTRIBUTION_INSTRUCTIONS") == "home address") { var window = Field("FIRST_NAME") + " " + Field("LAST_NAME"); if (Field("ADDRESS2") != "") {var window = window + "<br>" + Field("ADDRESS2");} if (Field("ADDRESS3") != "") {var window = window + "<br>" + Field("ADDRESS3");} if (Field("ADDRESS4") != "") {var window = window + "<br>" + Field("ADDRESS4");} if (Field("COUNTY") != "") {var window = window + "<br>" + Field("COUNTY");} if (Field("POSTAL_CODE") != "") {var window = window + "<br>" + Field("POSTAL_CODE");} } else { var window = Field("FIRST_NAME") + " " + Field("LAST_NAME"); if (Field("PROJ_LOCN") != "") {var window = window + "<br>" + Field("PROJ_LOCN");} if (Field("OPER_UNIT") != "") {var window = window + "<br>" + NormalizeEntities(Field("OPER_UNIT"));} if (Field("OPER_UNIT_2") != "") {var window = window + "<br>" + Field("OPER_UNIT_2");} } return window;
Tas Posted February 18, 2009 Author Posted February 18, 2009 Alex, thank you for your help with the NormalizeEntities function. It works great! I mentioned in my previous note that it didn't seem to be working, as I was getting the same result. I have since realized that I was applying the function to the wrong field... It's one of those days. Anyway, thanks for your help!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.