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

That's it? *sigh* I don't know why I can't "get" code... Thank you. Um... how would I put in a carriage return to split the sentence at the end of "Pinehurst"?

Or maybe I should call it a line break.

Edited by Tattoued
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...