Jump to content

No first name rule?


Tattoued

Recommended Posts

This is probably a REALLY easy formula, but I'm on overload right now, and code is way over my head for the most part, AND I don't very often have the need to create many rules... your help would be SO much appreciated!

 

I have a field called First Name. Some of the names have only an initial. The statement where the variable data will be placed is:

 

">>First Name<<, you don't need to travel to Pinehurst to play an authentic Donald Ross Golf Course!"

 

I'd like to create a rule where if the name is an initial only, remove the comma and space and make the lower case y an upper case Y and just forego the name altogether.

 

I'm trying, but I just can't seem to make it work and I HAVE to get this job out today! HELP PLEASE!:eek:

Link to comment
Share on other sites

return (Field("First Name").length >1) ? Field("First Name") + ", you don't need to travel to Pinehurst to play an authentic Donald Ross Golf Course!" : "You don't need to travel to Pinehurst to play an authentic Donald Ross Golf Course!";

Link to comment
Share on other sites

You could do that one of two ways. You could code it into the existing rule using a break tag ("<br>"). You just need to make sure you have the check box checked to "Treat returned strings as tagged text" in the Rule Editor.

 

return (Field("First Name").length >1) ? Field("First Name") + ", you don't need to travel to Pinehurst[color="Red"]<br>[/color] to play an authentic Donald Ross Golf Course!" : "You don't need to travel to Pinehurst[color="Red"]<br>[/color] to play an authentic Donald Ross Golf Course!";

 

Or you could edit the code to just only return the first name and the "y" and handle the rest of the sentence and the line spacing in the text editor window.

 

return (Field("First Name").length >1) ? Field("First Name") + ", y" : "Y";

 

Then your text editor would like this:

Rule("FirstNameRule")ou don't need to travel to Pinehurst

to play an authentic Donald Ross Golf Course!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...