Options

Page field show/hide code

slingenfelterslingenfelter Member Posts: 3
edited 2014-02-18 in NAV Three Tier
Is it possible to make a Boolean page field visible only if it is True/Yes?

Explanation:
Salesperson/Purchaser table has a field "Inactive". I have a added a Lookup field on the sales line for the Salesperson/Purchaser "Inactive" field. I want the field to show Yes if it is checked but I want it to appear blank if it is not.

Is this possible? :-k

Comments

  • Options
    MBergerMBerger Member Posts: 413
    why not fill a text variable according with "yes" or "", and show that on the page ?
  • Options
    JohnHunterJohnHunter Member Posts: 45
    on page for your field set BlankZero to Yes :)
  • Options
    slingenfelterslingenfelter Member Posts: 3
    Thanks for the replies! I do have the BlankZero set as Yes and the field still shows as No. But thanks for the suggestion!

    On the text variable will you please elaborate?
  • Options
    geordiegeordie Member Posts: 655
    I think MBerger referred to some code like this:
    IF Inactive THEN
      InactiveText := FORMAT(TRUE)
    ELSE
      InactiveText := "";
    
  • Options
    JohnHunterJohnHunter Member Posts: 45
    blankzero example
  • Options
    MaaaxMaaax Member Posts: 14
    Hello,

    You can set a Boolean var in the Visiblility (or Enable) property of your field.
    Then you can set this var on TRUE or FALSE on trigger "OnModify".
    Like:

    IF "Salesperson/Purchaser"."Inactive" THEN BEGIN
    isVisible := TRUE;
    CurrPage.UPDATE;
    END ELSE BEGIN
    isVisible := FALSE;
    CurrPage.UPDATE;
    END;

    But be careful with the CurrPage.UPDATE to save your values, ...

    PS: Sorry for my bad english... You know, i'm french :D
    Maxime JUND
    Talent Business Solutions
    Technical Expert of Microsoft Dynamics 365 Business Central
    Website | Mail | LinkedIn
Sign In or Register to comment.