-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Shopify] Customer/Company Metafields #27542
Merged
aholstrup1
merged 25 commits into
microsoft:main
from
GediminasGaubys:dev/pmi/CustomerMetafields
Nov 1, 2024
Merged
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b4b8323
add import customer metafields import
petemchlk 641b9b6
handle metafields removalwhen removed in Shopify
petemchlk 2e391ee
remove old metafield related not working code, add code to update Cus…
petemchlk ddf0b67
add company metafield import
petemchlk 753ab0c
Add metafield export support
petemchlk 321fd5e
small refactors
petemchlk 56a224d
add metafields action to customer/company card
petemchlk 878d2ed
create test cu
petemchlk ce08405
create test codeunit
petemchlk 38d4e03
add test
petemchlk 9e97378
add comany tests, create helper codeunit
petemchlk bf65b47
Merge branch 'main' into dev/pmi/CustomerMetafields
petemchlk cc72822
remove empty spaces
petemchlk abf978e
pr fix, add page editable function to metafield owner interface
petemchlk 33dee95
change procedure name and summary
petemchlk cfb0302
renumber objects
petemchlk b86173d
sending metafields test in progress
petemchlk 7ae9575
refactor export metafields test
petemchlk 6175567
add company export metafields test
petemchlk bdbdac2
renumber ids
petemchlk f316da3
updated return var documentation
petemchlk 92c49c3
fix object id
petemchlk 8484fd2
fix tooltips
petemchlk 0594f9a
make metafields only edaitable when not imported before export
petemchlk 36ca70d
object id fixes
petemchlk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
"idRanges": [ | ||
{ | ||
"from": 30100, | ||
"to": 30370 | ||
"to": 30380 | ||
} | ||
], | ||
"internalsVisibleTo": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -163,6 +163,24 @@ page 30157 "Shpfy Company Card" | |||||
RunPageLink = "Company SystemId" = field(SystemId); | ||||||
ToolTip = 'View a list of Shopify catalogs for the company.'; | ||||||
} | ||||||
action(Metafields) | ||||||
{ | ||||||
ApplicationArea = All; | ||||||
Caption = 'Metafields'; | ||||||
Image = PriceAdjustment; | ||||||
Promoted = true; | ||||||
PromotedCategory = Category4; | ||||||
PromotedIsBig = true; | ||||||
PromotedOnly = true; | ||||||
ToolTip = 'Add metafields to a product. This can be used for adding custom data fields to products in Shopify.'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
trigger OnAction() | ||||||
var | ||||||
Metafields: Page "Shpfy Metafields"; | ||||||
begin | ||||||
Metafields.RunForResource(Database::"Shpfy Company", Rec.Id, Rec."Shop Code"); | ||||||
end; | ||||||
} | ||||||
} | ||||||
|
||||||
} | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -186,6 +186,27 @@ page 30106 "Shpfy Customer Card" | |||||
RunPageLink = "Customer Id" = Field(Id); | ||||||
ToolTip = 'View a list of Shopify orders for the customer.'; | ||||||
} | ||||||
action(Metafields) | ||||||
{ | ||||||
ApplicationArea = All; | ||||||
Caption = 'Metafields'; | ||||||
Image = PriceAdjustment; | ||||||
Promoted = true; | ||||||
PromotedCategory = Category4; | ||||||
PromotedIsBig = true; | ||||||
PromotedOnly = true; | ||||||
ToolTip = 'Add metafields to a product. This can be used for adding custom data fields to products in Shopify.'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
trigger OnAction() | ||||||
var | ||||||
Shop: Record "Shpfy Shop"; | ||||||
Metafields: Page "Shpfy Metafields"; | ||||||
begin | ||||||
Shop.SetRange("Shop Id", Rec."Shop Id"); | ||||||
Shop.FindFirst(); | ||||||
Metafields.RunForResource(Database::"Shpfy Customer", Rec.Id, Shop.Code); | ||||||
end; | ||||||
} | ||||||
} | ||||||
|
||||||
} | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -187,7 +187,27 @@ page 30107 "Shpfy Customers" | |||||
BackgroundSyncs.CustomerSync(Shop.Code); | ||||||
end; | ||||||
end; | ||||||
} | ||||||
action(Metafields) | ||||||
{ | ||||||
ApplicationArea = All; | ||||||
Caption = 'Metafields'; | ||||||
Image = PriceAdjustment; | ||||||
Promoted = true; | ||||||
PromotedCategory = Process; | ||||||
PromotedIsBig = true; | ||||||
PromotedOnly = true; | ||||||
ToolTip = 'Add metafields to a product. This can be used for adding custom data fields to products in Shopify.'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
trigger OnAction() | ||||||
var | ||||||
Shop: Record "Shpfy Shop"; | ||||||
Metafields: Page "Shpfy Metafields"; | ||||||
begin | ||||||
Shop.SetRange("Shop Id", Rec."Shop Id"); | ||||||
Shop.FindFirst(); | ||||||
Metafields.RunForResource(Database::"Shpfy Customer", Rec.Id, Shop.Code); | ||||||
end; | ||||||
} | ||||||
} | ||||||
} | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLCompanyMetafieldIds.Codeunit.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace Microsoft.Integration.Shopify; | ||
|
||
/// <summary> | ||
/// Codeunit Shpfy GQL CompanyMetafieldIds (ID 30373) implements Interface Shpfy IGraphQL. | ||
/// </summary> | ||
codeunit 30373 "Shpfy GQL CompanyMetafieldIds" implements "Shpfy IGraphQL" | ||
{ | ||
Access = Internal; | ||
|
||
/// <summary> | ||
/// GetGraphQL. | ||
/// </summary> | ||
/// <returns>Return value of type Text.</returns> | ||
procedure GetGraphQL(): Text | ||
begin | ||
exit('{"query":"{company(id: \"gid://shopify/Company/{{CompanyId}}\") {metafields(first: 50) {edges {node {id namespace ownerType legacyResourceId }}}}}"}'); | ||
end; | ||
|
||
/// <summary> | ||
/// GetExpectedCost. | ||
/// </summary> | ||
/// <returns>Return value of type Integer.</returns> | ||
procedure GetExpectedCost(): Integer | ||
begin | ||
exit(50); | ||
end; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLCustomerMetafieldIds.Codeunit.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace Microsoft.Integration.Shopify; | ||
/// <summary> | ||
/// Codeunit Shpfy GQL Customer Metafield Ids (ID 30374) implements Interface Shpfy IGraphQL. | ||
/// </summary> | ||
codeunit 30374 "Shpfy GQL CustomerMetafieldIds" implements "Shpfy IGraphQL" | ||
{ | ||
Access = Internal; | ||
|
||
/// <summary> | ||
/// GetGraphQL. | ||
/// </summary> | ||
/// <returns>Return value of type Text.</returns> | ||
procedure GetGraphQL(): Text | ||
begin | ||
exit('{"query":"{customer(id: \"gid://shopify/Customer/{{CustomerId}}\") { metafields(first: 50) {edges {node {legacyResourceId updatedAt}}}}}"}'); | ||
end; | ||
|
||
/// <summary> | ||
/// GetExpectedCost. | ||
/// </summary> | ||
/// <returns>Return value of type Integer.</returns> | ||
procedure GetExpectedCost(): Integer | ||
begin | ||
exit(50); | ||
end; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.