【问题标题】:Item Journal Line Table's Records are getting deleted by itself项目日记帐行表的记录正在自行删除
【发布时间】:2019-08-25 20:00:30
【问题描述】:

我编写了这个程序,通过单击一个名为“问题材料”的按钮将它们添加到项目日记帐行表中 这是程序;

procedure IssueMaterial(IncomingLine: Record "Purchase Requisition Line")
var
ItemCont: Record "Item Journal Line";
begin
IF ItemCont.FindLast then begin
ItemCont."Line No." := ItemCont."Line No." + 10000;
end;
with ItemCont do begin
ItemCont.Init();
ItemCont."Journal Template Name" := 'Item';
Validate("Item No.", IncomingLine."No.");
ItemCont."Posting Date" := WorkDate();
Validate("Location Code", IncomingLine.Location);
ItemCont."Entry Type" := ItemCont."Entry Type"::"Negative Adjmt.";
ItemCont."Journal Batch Name" := 'Default';
ItemCont."Line No." := IncomingLine."Line No.";
Validate(Quantity, IncomingLine.Quantity);
Validate(Amount, IncomingLine.Amount);
Validate("Unit Cost", IncomingLine."Unit Cost");
ItemCont.Insert();
end;
Message('%1 has been successfully created', IncomingLine."No.");
end;

这是我写的动作(按钮)处的代码;

trigger OnAction()
var
codeunitcont: Codeunit "Purchase Req. Mgmt.";
PurchReqLine: Record "Purchase Requisition Line";
begin
CurrPage.SetSelectionFilter(PurchReqLine);
IF PurchReqLine.FindSet then
repeat
PurchReqLine.TestField(PurchReqLine.Location);
codeunitcont.IssueMaterial(PurchReqLine);
until PurchReqLine.Next = 0;
end;

它工作正常。我将我的行移至项目日志表,但是,一旦我重新启动租户或重建并重新发布扩展,我的项目日志表就会丢失其记录! 感谢您就可能出现的问题提出建议

【问题讨论】:

  • 这不应该发生。请联系 Microsoft 支持。

标签: microsoft-dynamics navision cal dynamics-business-central


【解决方案1】:

在 OnOpenPage 上编写了删除项目日记帐行的所有记录的代码!行动。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-20
    相关资源
    最近更新 更多