Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ codeunit 30238 "Shpfy Fulfillment Orders API"

internal procedure ExtractFulfillmentOrder(var ShopifyShop: Record "Shpfy Shop"; JFulfillmentOrder: JsonToken; var Cursor: Text)
var
DataCapture: Record "Shpfy Data Capture";
FulfillmentOrderHeader: Record "Shpfy FulFillment Order Header";
Id: BigInteger;
JNode: JsonObject;
Expand All @@ -98,13 +99,15 @@ codeunit 30238 "Shpfy Fulfillment Orders API"
FulfillmentOrderHeader."Delivery Method Type" := ConvertToDeliveryMethodType(JsonHelper.GetValueAsText(JNode, 'deliveryMethod.methodType'));
if not FulfillmentOrderHeader.Insert() then
FulfillmentOrderHeader.Modify();
DataCapture.Add(Database::"Shpfy FulFillment Order Header", FulfillmentOrderHeader.SystemId, JNode);
GetFulfillmentOrderLines(ShopifyShop, FulfillmentOrderHeader);
end;
end;

internal procedure ExtractFulfillmentOrderLines(var ShopifyShop: Record "Shpfy Shop"; var FulfillmentOrderHeader: Record "Shpfy FulFillment Order Header"; JResponse: JsonObject; var Cursor: Text): Boolean
var
FulfillmentOrderLine: Record "Shpfy FulFillment Order Line";
DataCapture: Record "Shpfy Data Capture";
Modified: Boolean;
Id: BigInteger;
JFulfillmentOrderLines: JsonArray;
Expand Down Expand Up @@ -165,6 +168,7 @@ codeunit 30238 "Shpfy Fulfillment Orders API"
end;
end;
end;
DataCapture.Add(Database::"Shpfy FulFillment Order Header", FulfillmentOrderHeader.SystemId, JFulfillmentOrderLines.AsToken());
exit(true);
end;
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,39 @@ page 30141 "Shpfy Fulfillment Orders"
}
}
}

actions
{
area(navigation)
{
action("Retrieved Shopify Data")
{
ApplicationArea = All;
Caption = 'Retrieved Shopify Data';
Image = Entry;
ToolTip = 'View the data retrieved from Shopify.';

trigger OnAction();
var
DataCapture: Record "Shpfy Data Capture";
begin
DataCapture.SetCurrentKey("Linked To Table", "Linked To Id");
DataCapture.SetRange("Linked To Table", Database::"Shpfy FulFillment Order Header");
DataCapture.SetRange("Linked To Id", Rec.SystemId);
Page.Run(Page::"Shpfy Data Capture List", DataCapture);
end;
}
}
area(promoted)
{
group(Category_Inspect)
{
Caption = 'Inspect';

actionref("Retrieved Shopify Data_Promoted"; "Retrieved Shopify Data")
{
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,39 @@ page 30140 "Shpfy Fulfillment Order Card"
}
}
}

actions
{
area(navigation)
{
action("Retrieved Shopify Data")
{
ApplicationArea = All;
Caption = 'Retrieved Shopify Data';
Image = Entry;
ToolTip = 'View the data retrieved from Shopify.';

trigger OnAction();
var
DataCapture: Record "Shpfy Data Capture";
begin
DataCapture.SetCurrentKey("Linked To Table", "Linked To Id");
DataCapture.SetRange("Linked To Table", Database::"Shpfy FulFillment Order Header");
DataCapture.SetRange("Linked To Id", Rec.SystemId);
Page.Run(Page::"Shpfy Data Capture List", DataCapture);
end;
}
}
area(promoted)
{
group(Category_Inspect)
{
Caption = 'Inspect';

actionref("Retrieved Shopify Data_Promoted"; "Retrieved Shopify Data")
{
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,16 @@ table 30143 "Shpfy FulFillment Order Header"
trigger OnDelete()
var
FulfillmentOrderLine: Record "Shpfy FulFillment Order Line";
DataCapture: Record "Shpfy Data Capture";
begin
FulfillmentOrderLine.Reset();
FulfillmentOrderLine.SetRange("Shopify Fulfillment Order Id", Rec."Shopify Fulfillment Order Id");
FulfillmentOrderLine.DeleteAll(true);

DataCapture.SetCurrentKey("Linked To Table", "Linked To Id");
DataCapture.SetRange("Linked To Table", Database::"Shpfy FulFillment Order Header");
DataCapture.SetRange("Linked To Id", Rec.SystemId);
if not DataCapture.IsEmpty then
DataCapture.DeleteAll(false);
end;
}
Loading