diff --git a/Apps/W1/Shopify/app/src/Logs/Codeunits/ShpfySkippedRecord.Codeunit.al b/Apps/W1/Shopify/app/src/Logs/Codeunits/ShpfySkippedRecord.Codeunit.al new file mode 100644 index 0000000000..9c0f4a5eaf --- /dev/null +++ b/Apps/W1/Shopify/app/src/Logs/Codeunits/ShpfySkippedRecord.Codeunit.al @@ -0,0 +1,44 @@ +namespace Microsoft.Integration.Shopify; + +/// +/// Codeunit Shpfy Skip Record (ID 30313). +/// +codeunit 30313 "Shpfy Skipped Record" +{ + Access = Internal; + Permissions = tabledata "Shpfy Skipped Record" = rimd; + + /// + /// Creates log entry for skipped record. + /// + /// Related Shopify Id of the record. + /// Table Id of the record. + /// Record Id of the record. + /// Reason for skipping the record. + /// Shop record. + internal procedure LogSkippedRecord(ShopifyId: BigInteger; RecordId: RecordID; SkippedReason: Text[250]; Shop: Record "Shpfy Shop") + var + SkippedRecord: Record "Shpfy Skipped Record"; + begin + if Shop."Logging Mode" = Enum::"Shpfy Logging Mode"::Disabled then + exit; + SkippedRecord.Init(); + SkippedRecord.Validate("Shopify Id", ShopifyId); + SkippedRecord.Validate("Table ID", RecordId.TableNo()); + SkippedRecord.Validate("Record ID", RecordId); + SkippedRecord.Validate("Skipped Reason", SkippedReason); + SkippedRecord.Insert(true); + end; + + /// + /// Creates log entry for skipped recordwith empty Shopify Id. + /// + /// Record Id of the record. + /// Reason for skipping the record. + /// Shop record. + internal procedure LogSkippedRecord(RecordId: RecordID; SkippedReason: Text[250]; Shop: Record "Shpfy Shop") + begin + LogSkippedRecord(0, RecordId, SkippedReason, Shop); + end; + +}