I am new to this concepts, please explain?
Discussion posts and replies are publicly visible
A null CDT would be a data structure that does not have any values stored in it for your specific instance. So for example you have a cdt of type employee, and it looked like this - CDT - EmployeeFields - empID, firstName, lastNameA populated CDT would look like - type!{namespace}Employee(empID: 1, firstName :"ABC", lastName:"XYZ" )And a null CDT would be one without any values with just an empty structure - where the value would show as 'null'.Another level to look at it is where the CDT exists but having empty fields - 'type!{namespace}Employee(), this creates a CDT with fields that have empty values - type!{namespace}Employee(empID: null, firstName :"", lastName:"" )You will notice this when you have an ri of a CDT on an interface where the CDT has not been populated with values yet. Once it gets populated the ri can be split to see the values for each field.
CDT is a datastructure where you can store your values as a defined manner. To check whether the CDT is null/empty or not, function is available called isNotNullorEmpty. in this function, you can put your local variable in which your are defining your cdt and this function return true/False.
A CDT is like a class. It gives structure to a raw data. To check if it is null, you can simply pass the CDT type variable in a!keys() function and it will give you all the fields. Now you can run a loop on those values and use the property() function in the expression of that loop along with a!isNullOrEmpty()If all the values are null, then the CDT was null. Else it wasn't null.
if I get true then what is solution?
show me one example please i will do till a!keys() and perfectly gets after trying not get any values please show me one example
a!localVariables( local!keys: a!keys(ri!cdt), and( a!forEach( items: local!keys, expression: a!isNullOrEmpty(property(ri!cdt, fv!item, {})) ) ) )
i get true only thats means its a null cdt right or not, if i am passing this cdt through process model we get error like The record to be saved must not be null is it right or not?
This code will only check if it is null or not. So wherever you are calling it from, you can put it in an if condition. Basically, it is for null handling on run time.
You can refer to this code.
This is how you can check whether the CDT is null or not.
Good to know this. thank Keshav Dadhich for sharing.