Is it possible to programm a LookUp (OnLookUp) for a Bool?

Nokio
Nokio Member Posts: 52
Hi.
i have some standard Code inside the OnLookUp trigger of a Boolean Field:

PurchaseLine.SETCURRENTKEY("Document Type","Job No.","JSP Code");
PurchaseLine.SETRANGE("Job No.","Job No.");
PurchaseLine.SETRANGE("JSP Code","JSP Code");
PurchaseLine.SETRANGE("Document Type",PurchaseLine."Document Type"::Order);
PurchaseLine.SETRANGE("Outstanding Quantity",0);
FORM.RUNMODAL(FORM::"Purchase Lines",PurchaseLine);

Normally there should be a LookUp Button in the Table or Form, but there isnt any one.

If I put the same Code inside the OnLookUp trigger of a Code Field the LookUp Button show Up on the Table respectively the formular and I can use it.

So the Question is. How can I run the OnLookUp function for a Boolean Field or is it generally not possible?

Comments

  • David_Singleton
    David_Singleton Member Posts: 5,479
    I don't think you can do this with a tick box, at least not without some hacking.

    What I always do is just add a textbox with source expression of the boolean field. It will display Yes/No instead of the tick, but it works fine.
    David Singleton
  • Nokio
    Nokio Member Posts: 52
    Yes that would be an option unfotrunately it will not work in my Case.

    I forgot to say that the Boolean is a FlowField with the method Exists..
    So it must be a Field with the DataType "Boolean".

    Are there any other methods bring the OnLookUp function to work?
  • lubost
    lubost Member Posts: 633
    I think that system is in DrillDown mode and OK button is not allowed in this case.
  • Nokio
    Nokio Member Posts: 52
    Which ok Button do you mean?
    Unfortunately you cant use the drilldown either when you use the bool..
  • Nokio
    Nokio Member Posts: 52
    Hey David, your Method works!
    Dont really know how I brought it to work, but ja have a drilldown on the bool field, and thats fine with me.
    thx
  • kine
    kine Member Posts: 12,562
    Nokio wrote:
    Hey David, your Method works!
    Dont really know how I brought it to work, but ja have a drilldown on the bool field, and thats fine with me.
    thx

    May be it is because the checkbox (default control type for Boolean) have no possibility for assist buttons. But if you used text box, it is like other fields and the drilldown button works... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.