Jump to content

Rules Help needed


printimp

Recommended Posts

I am a very new user to Fusion Pro and this is my first time trying to use a rule

 

I've got the rule below created, but I would like to add " 's " to the first name field when it returns the result

 

Can someone help me get this, everything I try give me an error--I can add in front of the field, but cannot get anything added after the field in the rule

 

Here is what I have so far:

 

if (Field("FIRST") == "")

return "";

else

return Field("FIRST") -------this is where I'd like it to return "(FIRST)'s"

Link to comment
Share on other sites

Hello printimp,

 

Welcome to the world of FusionPro and the FusionPro Users community. You are our 600th member to join the community! As a "congratulations", here an answer to your question:

 

if (Field("FIRST") == "")
    return "";
else
    return Field("FIRST") + "'s";

Your rule was spot on with the exception of the missing bit right there at the end. You can concatenate strings together by using a + as you see above.

 

Also, both double quotes and single quotes can be used when you have strings of text in JavaScript (like this 's we are adding). However, since you have that quote in there, I put single quotes around the string - 's - so it returned correctly. If you had a string that had a double-quote in it, you could wrap that string in single quotes like this - 'Let us say "Hello" to you'

 

Hope this helps.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...