Jump to content

Switch Rule and Ampersand


bmauer

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...