Boolean field having AssistEdit Button on Pages

imclever1205imclever1205 Member Posts: 94
Hello guys,

I have a form which had a boolean field and an assist button next to it. While converting the Form into a Page I tried to write the code on the AssistEdit Trigger of the boolean field but it was a hopeless case.
Any suggestion will be well appreciated.

Answers

  • MarkHamblinMarkHamblin Member Posts: 118
    Here's a solution that will work:
    1. Create a text variable (e.g., MyTempText) and add a field for it on the page
    2. Add code to the OnLookup trigger of the field:
      MyBoolField := NOT MyBoolField;
      MyTempText := FORMAT(MyBoolField);
      
    3. Add whatever code you need to the AssistEdit trigger of the text field
    4. Add code to the OnValidate trigger:
      CASE UPPERCASE(COPYSTR(MyTempText, 1, 1)) OF
        'Y': MyBoolField := TRUE;
        'N': MyBoolField := FALSE;
      END;//case
      MyTempText := FORMAT(MyBoolField);
      
    That will get you a field that has both a drop-down button and assist edit, and that toggles between true and false when you hit the drop down button. Pretty close to normal NAV behavior, so won't throw users off.

    (Oh - and don't forget to set MyTempText when the record changes).
  • imclever1205imclever1205 Member Posts: 94
    Thanks a lot for the reply......
Sign In or Register to comment.