IsBlank

You can use this function for any Optiva script type: workflow, equations, copy methods, script hooks, etc.

Purpose

Determines if a value from a field is blank or contains characters. Null is tested as well.

Syntax


Dim variable As Integer = IsBlank(Value)

Arguments

Part Description
Value The field that is checked.

Description

IsBlank determines if a variable has a non-null, non-blank value. For example, you can use this function to determine if a formula has an item code associated with it.

The function returns a value of 0 or 1.

Value Description
0 Field is not blank.
1 Field is blank.

Examples

In this example, the first line places the ITEMCODE string of the PIZZASAUCE formula into the local variable oItemcode.

The second line checks whether there is a string in oItemcode. The script determines if the formula has a MFG item code.


Dim oItemcode As Object = ObjProperty("ITEMCODE","FORMULA", 
"PIZZASAUCE\003")
Dim iBlank As Integer = IsBlank(oItemcode)
if (iBlank = 1) then
   MessageList("This formula does not have a MFG item code.")
end if

The next example checks if a formula has a work code.


Dim oWorkcode As Object = ObjProperty("WORKCODE","FORMULA", 
"PIZZA_SAUCE\003")
Dim iBlank As Integer = IsBlank(oWorkcode)
if (iBlank = 1) then
   MessageList("This formula does not have a work code.")
end if

In the previous examples, you can leave the last two arguments, representing Symbol and Object, respectively, as empty quotation marks. Empty quotation marks indicate the new object for a copy method.