Jump to content

Discard Commas before Suffix


mstanton

Recommended Posts

Hello,

 

I am building business cards for a hospital and I need a way to get rid of commas if the field "Suffix" is empty. For example, if Joe Smith doesn't want his suffix on the business card, it should read "Joe Smith"

But if he does want a suffix, let's say MD, it should read "Joe Smith, MD"

 

I have tried some of the code listed in this forum for similar situations, for example:

 

if(Field("Suffix") == "")

return Field("Prefix") + " " + Field("First") + " " + Field("MI") + " " + Field("Last")

else

return (Field("Prefix") + " " + Field("First") + " " + Field("MI") + " " + Field("Last") + "," + " " + Field("Suffix"));

 

but none of it is working. I am using Fusion Pro 6.0. Can anyone help me? Thanks!

Link to comment
Share on other sites

I kept working on it and answered my own question. I just created a rule:

 

if(Field("Suffix") == "")

return ""

else

return ", "

 

Then I went into the variable text field, deleted the comma and space I had between the last name and suffix, and inserted the newly created Comma Out rule in it's place. Works like a charm!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...