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
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)
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;
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;
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.
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).
Comments
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)
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
Something like that I guess...
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
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.
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).