Understanding blank/null field values for using with all() and none() peoplecode functions
2011-05-11 21:08
2641 查看
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.
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.
相关文章推荐
- Kettle解析JSON错误,We MUST have the same number of values for all paths,We can not find and data with path [$.
- Automation for the people: Improving code with Eclipse plugins
- Performance of Using Keys in SELECT with FOR ALL ENTRIES
- 存档: Automation for the people: Improving code with Eclipse plugins
- Along with all the above benefits, you cannot overlook the space efficiency and performance gains in using DataFrames and Dataset APIs for two reasons.
- [JS Compose] 2. Enforce a null check with composable code branching using Either
- R code for generating standard normals using Metropolis sampler with uniform proposal distribution
- How to dynamically set limit_choices_to for ManyToManyField using values from an instance? - Google Groups
- F4 help functionality for a dynpro screen field using the PROCESS ON VALUE-REQUEST statement
- Example code for using the Selenium 2 Python bindings. — Gist
- WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-
- Handle unmanaged code in managed c# with the help of using statement
- org.apache.ibatis.type.TypeException: Error setting null for parameter #1 with JdbcType OTHER
- Alternative solution for using IF condition with Eval in C# Repeater
- WARN til.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-j
- Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
- Job for postfix.service failed because the control process exited with error code. See "systemctl st
- tomcat 大并发报错 Maximum number of threads (200) created for connector with address null and port 8080
- setValuesForKeysWithDictionary forUndefinedKey
- Faceting on a field in SolrCloud with docValues=true and indexed=false fails