Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

checking for null JavaScript

$
0
0

Hi,

I want to create salutation text for field "salutation for mail" on Contact's form. I have a field which name is "salutation" and is a OptionSet field. If one option is selected, then the field "salutation for mail" should be filled out with combination of firstname, lastname and Titel. 

But these fields ( firstname, lastname and Titel) can be empty. 

if i check it in a condition like below, i get "null" in field "salutation for mail" if these fields are empty:

 if (Salutation == "" && firstName != null && Titel != null){
formContext.getAttribute("Salutationformail").setValue(Salutation+" "+Titel+" "+firstName+" "+lastName);
}

Does anybody have an idea how can i check these fields for null value so that i dont get null if these are empty?

Thanks

Best Regards!


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images