You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, we need additional event in the report 511 "Complete IC Inbox Action" in order to keep Inbox Transaction without showing the error to the user if insert of Handled Inbox Transaction fails.
```
trigger OnAfterGetRecord()
var
InboxTransaction2: Record "IC Inbox Transaction";
HandledInboxTransaction2: Record "Handled IC Inbox Trans.";
ICCommentLine: Record "IC Comment Line";
ICPartner: Record "IC Partner";
IsHandled: Boolean;
// Start
IsRecordInserted: Boolean;
SkipRecord: Boolean;
// End
begin
if "Line Action" = "Line Action"::"No Action" then
CurrReport.Skip();
InboxTransaction2 := "IC Inbox Transaction";
if ("Source Type" = "Source Type"::Journal) and
(InboxTransaction2."Line Action" <> InboxTransaction2."Line Action"::Cancel) and
(InboxTransaction2."Line Action" <> InboxTransaction2."Line Action"::"Return to IC Partner")
then begin
TempGenJnlLine.TestField("Journal Template Name");
TempGenJnlLine.TestField("Journal Batch Name");
end;
if (InboxTransaction2."Line Action" <> InboxTransaction2."Line Action"::Cancel) and
ICPartner.Get(InboxTransaction2."IC Partner Code")
then
ICPartner.TestField(Blocked, false);
HandledInboxTransaction2.TransferFields(InboxTransaction2);
case InboxTransaction2."Line Action" of
InboxTransaction2."Line Action"::Accept:
HandledInboxTransaction2.Status := HandledInboxTransaction2.Status::Accepted;
InboxTransaction2."Line Action"::"Return to IC Partner":
HandledInboxTransaction2.Status := HandledInboxTransaction2.Status::"Returned to IC Partner";
InboxTransaction2."Line Action"::Cancel:
HandledInboxTransaction2.Status := HandledInboxTransaction2.Status::Cancelled;
end;
IsHandled := false;
OnBeforeHandledInboxTransactionInsert(HandledInboxTransaction2, InboxTransaction2, IsHandled);
// Start
IsRecordInserted := HandledInboxTransaction2.Insert();
OnAfterHandledInboxTransactionInsert(HandledInboxTransaction2, InboxTransaction2, IsRecordInserted, SkipRecord);
if SkipRecord then
CurrReport.Skip();
if not IsRecordInserted and (not IsHandled) then
//if not HandledInboxTransaction2.Insert() and (not IsHandled) then //-> deleted
// End
Error(
Text001, InboxTransaction2.FieldCaption("Transaction No."),
InboxTransaction2."Transaction No.", InboxTransaction2."IC Partner Code",
HandledInboxTransaction2.TableCaption());
InboxTransaction2.Delete();
ICIOMgt.HandleICComments(ICCommentLine."Table Name"::"IC Inbox Transaction",
ICCommentLine."Table Name"::"Handled IC Inbox Transaction", "Transaction No.",
"IC Partner Code", "Transaction Source");
Forward := false;
end;
...
// Start
[IntegrationEvent(false, false)]
local procedure OnAfterHandledInboxTransactionInsert(var HandledICInboxTrans: Record "Handled IC Inbox Trans."; var InboxTransaction: Record "IC Inbox Transaction"; IsRecordInserted: Boolean; var SkipRecord: Boolean)
begin
end;
// End
### Additional context
If HandledInboxTransaction2.Insert() fails,
we want to keep InboxTransaction2 without showing the error to the user,
but want to continue, that is why we need the CurrReport.Skip.
The text was updated successfully, but these errors were encountered:
Describe the request
Hi, we need additional event in the report 511 "Complete IC Inbox Action" in order to keep Inbox Transaction without showing the error to the user if insert of Handled Inbox Transaction fails.
The text was updated successfully, but these errors were encountered: