I have a variable which has been initialised with the value of an ID field (a D365 guid) which points from one entity to another. On occasion the field won't be populated. Question: in these situations, am I correct in assuming that the variable would be NULL?
Peter.
Thanks very much - I think it's working now. Interesting how core knowledge around the difference between NULL and EMPTY is so important. I come from a non developer background and I guess it shows!
Peter.
For a string I normally test by checking the length of the string. If its blank the length will be 0. For a GUID you could go one step further and test whether you have a valid GUID by comparing the length to what the length of a GUID should be. This would depend on the format you are using.
Hi, I am using a string variable. So, it sounds like my test for NOT NULL explains why it isn't working. I don't use the GUID for anything - I'm just checking to see if the link exists. What would be the right test to check whether there is something in the variable.
Appreciate all your help by the way
Peter.
What variable type are you using to hold the guid? There isn't a variable type specific to quid, but it could be object or string. For string it would be empty, not null. But for object it would be null. String is the better choice since that can be converted to an actual GUID.
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional