Someone created an "Item Tracking Required" flowfield on our Purchase Line table to help the end-user easily notice if there is item tracking for an item. This flowfield has been added to the PO subform. Here's the flowfield's calcformula:
Exist(Item WHERE (No.=FIELD(No.),Item Tracking Code=FILTER(<>'')))
This works fine when "Purchase Line".Type is Item, but sometimes confusing when Type is G/L Account. Confusing because some G/L Account numbers are identical to Item numbers having Item Tracking Codes.
So, I want the flowfield calcformula to work when the Purchase Line's Type is Item, and not work when it is G/L Account. I don't know how to write the calcformula to check the value in the Purchase Line's Type field, and execute accordingly. Any ideas?
I have a partial solution that I do not like. In the PO subform's OnAfterGetRecord I can put code to ignore the calcformula when the Type is not Item. Here's the code:
IF Type <> 2 THEN //2 is type Item
BEGIN
"Item Tracking Required" := FALSE;
END;
But this solution does not address the issue at the table level.
Thanks in advance for help.
0
Comments
use the assist edit.
http://www.BiloBeauty.com
http://www.autismspeaks.org
It's the same principle like on field "Qty. on Sales Order" in the item talble.
Regards
Using the elipses, I am only able to select fields in the Item table. I want to reference the Purchase Line table's own Type field. I am wondering if there is a way to do this.
Basically, I want to enable the flowfield (in Purchase Line) when the Type (in Purchase Line) is 'Item'.
Please let me know if I am still unclear, or if I am missing something.
Thanks.
so the tracking no thing is on the item card.
leave the field as type boolean but remove the calcformula
Anyway how about on after validate of the item number on the purchase line you add
if item.get("no.") then begin
if (type = type::item) and (Item."item tracking no." <>'')
then "Item Tracking Required" := true
else "Item Tracking Required" := false;
end;
http://www.BiloBeauty.com
http://www.autismspeaks.org