Understanding blank/null field values for using with all() and none() peoplecode functions

来源:互联网 发布:淘宝十大违规 编辑:程序博客网 时间:2024/05/17 09:37
Initially it was very difficult for me to use all() or none() functions in peoplecode for string, date or number data types. Sometimes it was giving some error during run time or sometime it was correct. Later I came to know that I was asigning them to blank or nullifying them incorrectly.
After trying a lot of approaches I was able to understand properly on how to assign objects to null or blank so that we can use them efficiently with all() or none() peoplecode functions during validations. I am going to summarize my understanding on these in following points:

 

StringAlways use space to assign a null value to a string.
e.g. &Test_Str = " ";
NumberUse 0 (zero) to assign a null value to a number.
e.g. &Test_Num = 0;
DateAlways Use blank value to assign a null value to a date otherwise it will give you invalid date error if it is equated to null or space as string.
e.g. &Test_Date = "";
Other Data TypesFor other data types like record, rowset we can assign them to null so as to get accurate results from all() and none() functions by paasing them as parameter.
e.g. &Test_Rec = null;
Application Class PropertiesWe can not use all() or none() functions to check if any property of application class is set. For this we will need to check by equating it to null or blank or space or zero based on its type in a conditional statement.
原创粉丝点击