Skip to content

Commit

Permalink
make metafields only edaitable when not imported before export
Browse files Browse the repository at this point in the history
  • Loading branch information
petemchlk committed Oct 31, 2024
1 parent 8484fd2 commit 0594f9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ codeunit 30313 "Shpfy Metafield Owner Company" implements "Shpfy IMetafield Owne

procedure CanEditMetafields(Shop: Record "Shpfy Shop"): Boolean
begin
exit(Shop."Can Update Shopify Companies");
exit((Shop."Can Update Shopify Companies") and (Shop."Company Import From Shopify" <> Enum::"Shpfy Company Import Range"::AllCompanies));
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ codeunit 30333 "Shpfy Metafield Owner Customer" implements "Shpfy IMetafield Own
Parameters.Add('CustomerId', Format(OwnerId));
GraphQLType := GraphQLType::CustomerMetafieldIds;
JResponse := CommunicationMgt.ExecuteGraphQL(GraphQLType, Parameters);
if JsonHelper.GetJsonArray(JResponse, JMetafields, 'data.product.metafields.edges') then
if JsonHelper.GetJsonArray(JResponse, JMetafields, 'data.customer.metafields.edges') then
foreach JItem in JMetafields do
if JsonHelper.GetJsonObject(JItem.AsObject(), JNode, 'node') then begin
Id := CommunicationMgt.GetIdOfGId(JsonHelper.GetValueAsText(JNode, 'legacyResourceId'));
Expand All @@ -45,6 +45,6 @@ codeunit 30333 "Shpfy Metafield Owner Customer" implements "Shpfy IMetafield Own

procedure CanEditMetafields(Shop: Record "Shpfy Shop"): Boolean
begin
exit(Shop."Can Update Shopify Customer");
exit((Shop."Can Update Shopify Customer") and (Shop."Customer Import From Shopify" <> Enum::"Shpfy Customer Import Range"::AllCustomers));
end;
}

0 comments on commit 0594f9a

Please sign in to comment.