Getting or checking the field type in peoplecode

If you wish to get the type of a field or want to write peoplecode and want to write the conditional statement based on the type of the field then the type property can be used there. 

This property returns the type of field. And peoplecode may be written as: 

Local Field &MYFIELD;

If &MYFIELD.Type = "CHAR" Then
--- processing logic ---
Else
--- processing logic ---
End-If; 

The returned value from type property can be one of the following strings: 

1. CHAR 
2. DATE 
3. DATETIME 
4. IMAGE (for static images) 
5. IMAGEREFERENCE 
6. LONGCHAR 
7. NUMBER 
8. SIGNEDNUMBER 
9. TIME 

Note. Fields of type Attachment have a type of IMAGE. Remember that This property is read-only and you can only get the return value of type string. 

Comments