bmauer Posted February 11, 2011 Share Posted February 11, 2011 I created a switch rule so that the text field "Division" will change depending on what text is in text field "Function". switch (Field("Function")) { case "A & B PRODUCTS": return "DIVISION OF A & B COMPANIES, INC."; case "A B PRODUCTS": return "DIVISION OF A & B COMPANIES, INC."; default: return ""; } The code works fine as long as in the case, there is no ampersand. if the case is A & B PRODUCTS, it will not return the string DIVISION OF A & B COMPANIES, INC. if the case is A B PRODUCTS, it returns the string DIVISION OF A & B COMPANIES, INC. How do I correct this ampersand issue? Rule code below: switch (Field("Function")) { case "A & B PRODUCTS": return "DIVISION OF A & B COMPANIES, INC."; default: return ""; } Link to comment Share on other sites More sharing options...
jstehman Posted February 11, 2011 Share Posted February 11, 2011 The easiest way to fix this is is to change the dropdown & the case. It will not affect the return: switch (Field("Function")) { case "CONSUMER AND PERSONAL PRODUCTS WORLDWIDE": return "DIVISION OF JOHNSON & JOHNSON CONSUMER COMPANIES, INC."; default: return ""; } Jeff Stehman Technical Support | PTI Marketing Technologies | Printable Technologies, Inc. jstehman@pti.com | http://www.pti.com 858.847.6622 direct | 800.220.1727 office Link to comment Share on other sites More sharing options...
bmauer Posted February 11, 2011 Author Share Posted February 11, 2011 It will also work if in the rule I change the case & to & Thanks Jeff Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.