- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 01:35 AM
Hi all,
I think that this question is very simple for an expert developer, but for me it generate a big confusion.
when i prepare an "if" [condition] inside a script based on an hypothetical field storen in a table of the system is better use:
- if ( filed == '' ) { ... }
- if ( field == null ) { ... }
- if ( field === null ) { ... }
Best Regards
Vincenzo
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 10:44 AM
So there are different ways to check if field value is null or undefined or false
1) If you want to look for undefined or null or nil or false, you can use JSUtil.nil(recordReference.fieldName)
2) If you are looking for null / nil check only, you can also use gs.nil() method
3) Already pointed in this thread 🙂
Hope above reply assist you now and in future !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 01:38 AM
Are you looking for valid field or field with valid value ( not null ? )

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 01:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2018 10:44 AM
So there are different ways to check if field value is null or undefined or false
1) If you want to look for undefined or null or nil or false, you can use JSUtil.nil(recordReference.fieldName)
2) If you are looking for null / nil check only, you can also use gs.nil() method
3) Already pointed in this thread 🙂
Hope above reply assist you now and in future !!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2018 05:19 AM
Hi, nil() is good, ok but i write this simple function JS code. Enjoy.