boolean filter

hhhhhhhqathhhhhhhqat Member Posts: 111
i have one column is posted procces is boolean variable not exist in the source table , it just variable in the form , how can i add filter to this column , coz i can't use F7 to filter whatever true or false value

any help please

Comments

  • hhhhhhhqathhhhhhhqat Member Posts: 111
    this helk urgent
  • hhhhhhhqathhhhhhhqat Member Posts: 111
    any one can help please
  • lyotlyot Member Posts: 202
    You can't, you can only filter on field values who are present in the table.
  • JedrzejTJedrzejT Member Posts: 267
    Hello

    You can't setfilter on variable field with F7. What is this field? It must be a variable? Try change it to normal field (and calc value in some validate triggers) or flowfield (if it is not a big list of record)
  • afarrafarr Member Posts: 287
    As lyot said, you can only filter on fields that exist in the table.

    But I'm curious - how is the boolean defined on the form (i.e. what is the source expression)?
    And is it editable?
    Alastair Farrugia
  • lyotlyot Member Posts: 202
    afarr wrote:
    As lyot said, you can only filter on fields that exist in the table.

    But I'm curious - how is the boolean defined on the form (i.e. what is the source expression)?
    And is it editable?

    My guess is that blnBoolean is declared as a global variable.
    The value of it will be altered depending on a condition set in the OnAfterGetRecord trigger of the form.

    example
    IF lrecPurchaseHeader.GET("Document No.")THEN BEGIN
      IF lrecPurchaseHeader.Status = lrecPurchaseHeader.Status::Released THEN  
        blnBoolean := TRUE
      ELSE
        blnBoolean := FALSE;
    END;
    

    Something like that I guess... :)
  • hhhhhhhqathhhhhhhqat Member Posts: 111
    this my code


    OutQty := 0;
    InQty := 0;
    OutCost := 0;
    TransShptLine.SETRANGE("Document No.","No.");
    IF TransShptLine.FIND('-') THEN
    REPEAT
    OutQty := OutQty + TransShptLine.Quantity;
    UNTIL TransShptLine.NEXT = 0;

    TransREcptHead.RESET;
    TransREcptHead.SETCURRENTKEY("Transfer Order No.");
    TransREcptHead.SETRANGE("Transfer Order No.","Transfer Order No.");
    IF TransREcptHead.FIND('-') THEN BEGIN
    TransClosed := TRUE;
    ReciptNo := TransREcptHead."No.";
    ReceiptDate := TransREcptHead."Posting Date";
    TransRecptLine.SETRANGE("Document No.",ReciptNo);
    IF TransRecptLine.FIND('-') THEN
    REPEAT
    InQty := InQty + TransRecptLine.Quantity;
    UNTIL TransRecptLine.NEXT = 0;
    END ELSE BEGIN
    TransClosed := FALSE;
    ReciptNo := '';
    ReceiptDate := 0D;
    END;


    i want to add filter to "TransClosed" variable
  • lyotlyot Member Posts: 202
    The answer remains the same :)
    Add it as a field in your table, or else no go.

    When adding fields to a form it's always advised to ask a customer if those fields contain purely "nice to have information"
    or if they also want to filter on the values in that field.
    In the first case your solution is adequate, in the second you need an extra field on table level.
  • afarrafarr Member Posts: 287
    That's right.

    You could do this with two FlowFields (one in the TransREcptHead table to check if any lines exist; and one in your table to see if there is a TransREcptHead record where lines exist and where the Transfer Order No. matches).
    Alastair Farrugia
Sign In or Register to comment.