Peoplecode setting value to Null

Peoplecode setting value to Null

String

Always use space to assign a null value to a string.
e.g. &Test_Str = ” “;

Number

Use 0 (zero) to assign a null value to a number.
e.g. &Test_Num = 0;

Date

Always 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 Types

For 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 Properties

We 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.

Leave a Reply

Your email address will not be published. Required fields are marked *