我有Gen Bus。显示在销售订单子窗体上的过帐组字段。此子窗体还显示了线路的位置代码。
我正在尝试编写这样的逻辑:如果用户选择位置代码作为DROPSHIP,则为Gen Bus。发布组应该是LOCAL-DROPSHIP。
LOCAL-DROPSHIP是Gen.Bus中的记录。发布组。在编写此代码之前,我已经创建了它。但是,它不会分配给我的Rec.Gen Bus。发布组。
这是子窗体上的代码;
modify("Location Code")
{
trigger OnAfterValidate()
var
recLocation: Record Location;
recCustomer: Record Customer;
recSalesLine: Record "Sales Line";
recGenPosting: Record "Gen. Business Posting Group";
begin
recGenPosting.Get('LOCAL-DS');
if rec."Location Code" = 'DROPSHIP' then begin
Message(recGenPosting.Code);
// Validate("Gen. Bus. Posting Group", recGenPosting.Code);
Rec."Gen. Bus. Posting Group" := recGenPosting.Code;
CurrPage.Update();
end;
end;
}