Syntax

code

Function: MeetsInputCondition


Description

Returns true if the InputCondition has been met.


Code Reference


code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

procedure psMeetsInputCondition;

var

  ps: IPlanSwift;

  itm: IItem;

  prop: IPropertyObject;

begin

  //Create the Planswift Interface

  ps := coPlanswift.Create;

  //get the selected item

  itm := ps.SelectedItem.ParentItem;

  //Check to see if there is an item selected

  if varisclear(itm) then begin

    ShowMessage('Please Select an Item');

    ps := nil;

    Exit;

  end;

  //Create a new Property

  prop := itm.NewProperty('MeetsInputCondition','Hello World',ptText);

  //Set input Condition to true

  prop.IsInput := True;

  //Set its Input condition to check if qty is greater than zero

  prop.InputCondition := '[Qty] > 0';

  //Check if the condition is met

  if prop.MeetsInputCondition then

    //if it is met show a message stating so

    ShowMessage('Quanity is not blank');

  // Clear the Planswift Interface

  ps := nil;

end;