how to use testfield function with example

Ashish_ChoudharyAshish_Choudhary Member Posts: 15
dear all,
i know about testfield function. But i don't know how to use .because i read it in theory way not practically environment.
so plz. help me with example that how to use it.

Comments

  • krikikriki Member, Moderator Posts: 9,110
    You generally use it when a field is mandatory.
    For example, you can put in the insert-trigger or modify-trigger something like:
    TESTFIELD("Some Mandatory Field");
    

    If that field is blank, an error will be raised.

    Another use is this: if you fill in a certain value in a certain field, another field needs to have a certain value (generally it needs to be blank):
    IF "Field 1" = 'Some Value' THEN
      TESTFIELD("Field 2",'Some Other Value'); //or TESTFIELD("Field 2",''); if it needs to be blank
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.