Hello everybody!,
I have a question regarding Fieldgroups in a table:
On the Sales Order Page there is a dropdown on the Sell-to Customer No. Field. to the Customer Table. This is created by setting the Customer Table as TableRelation, and adding Fieldgroups to the Customer Table. This works perfect as it is! Now I added code on the Lookup Trigger to do some filtering, that I can't do in the TableRelation -> Filters. Only the problem is that I can do a Lookup to a Form, but not to a Fieldgroup in a table. Does anyone know if this is even possible?? Or found a workaround?
The code I have now on the Lookup Triigger:
//--> MGL000001
IF eHotel THEN
CustomerRec.SETRANGE(CustomerRec."eHotel active",TRUE);
FormCustomer.LOOKUPMODE(TRUE);
FormCustomer.SETRECORD(CustomerRec);
FormCustomer.SETTABLEVIEW(CustomerRec);
IF FormCustomer.RUNMODAL= ACTION::LookupOK THEN BEGIN
IF CustomerRec.FINDFIRST THEN BEGIN
FormCustomer.GETRECORD(CustomerRec);
Rec."Sell-to Customer No." := CustomerRec."No.";
VALIDATE("Sell-to Customer No.");
END;
END;
//<--MGL000001
With kind regards,
Michael Glashouwer
0
Comments
The only code filtering that works together with fieldgroups is code that is placed on the OnOpenPage() Trigger of the LookupPage that is defined on the table. In Some cases this allows you to do code filtering like a Department Filter based on User settings. But i asume this will not solve your problem...