[Shopify] Auto Create Catalog: always visible, validate plan on enable#8213
Open
onbuyuka wants to merge 3 commits into
Open
[Shopify] Auto Create Catalog: always visible, validate plan on enable#8213onbuyuka wants to merge 3 commits into
onbuyuka wants to merge 3 commits into
Conversation
PR #7605 made B2B unconditional but the "Auto Create Catalog" toggle on Shop Card stayed hidden for non-Advanced shops because its `Visible = Rec."Advanced Shopify Plan"` binding is not re-evaluated after GetShopSettings() runs. Drop the dynamic visibility and gate the field at the table layer instead: an OnValidate trigger raises a field error if the user tries to enable Auto Create Catalog on a shop whose plan does not support B2B catalogs. Adds a test in ShpfyStaffTest (already the home for plan-gated tests) covering both the rejection path and the success path after the plan flag is set. Fixes AB#630316 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Simplify the Auto Create Catalog OnValidate to use Error() with a
StrSubstNo-style label instead of the heavier ErrorInfo pattern.
- Close the plan-downgrade gap flagged in PR review: GetShopSettings()
now calls Rec.Validate("Advanced Shopify Plan", ...) instead of
direct assignment, and field 207 has an OnValidate that auto-disables
Auto Create Catalog (with a user message) when the plan is
downgraded. Without the Validate switch the bot's suggested
OnValidate would never fire from the actual API-sync path.
- Add TestAdvancedPlanDowngradeDisablesAutoCreateCatalog covering the
downgrade path and a small MessageHandler.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Silently disable Auto Create Catalog when Advanced Shopify Plan is turned off; remove the now-unused label and test MessageHandler. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
GetShopSettings missing Modify after Validate
Recommendation:
Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Re-fix for bug 630316 after PM verification of PR #7605.
PR #7605 made B2B features unconditional on all Shopify plans, but the
Auto Create Catalogtoggle on the Customers and Companies group of the Shop Card stayed hidden for non-Advanced shops because itsVisible = Rec."Advanced Shopify Plan"binding is not re-evaluated afterGetShopSettings()flips the flag at runtime.Per PM Andrei Pankos guidance:
Auto Create Catalogfield so its always visible in the Companies group.OnValidatetrigger raises a field error if the user tries to enableAuto Create Catalogon a shop whose plan does not support B2B catalogs (Plus, Plus Trial, Development, or Advanced).The error uses the existing
ErrorInfo/FieldNopattern already used elsewhere inShpfyShop.Table.al(e.g. field 21Auto Create Orders).What is NOT changed
action(Catalogs)(B2B Catalogs action) andaction(StaffMembers)visibility on the Shop Card PM only flagged the field control.Shop."Auto Create Catalog"checks inShpfyCompanyAPI.Codeunit.al/ShpfyCompanyExport.Codeunit.althe table guard prevents the boolean from being set totrueon an unsupported plan, so no runtime check is needed.B2B Enabledobsoletion and upgrade code from PR [Shopify] Remove B2B Plus-only plan restriction #7605 already accepted by PM.app.jsonversions intentionally untouched.Test
Adds
TestAutoCreateCatalogRequiresAdvancedPlantoShpfyStaffTest(codeunit 139551, which is already the home forAdvanced Shopify Plan-gated tests). Verified both passes locally:Fixes AB#630316