Report 30112 Shpfy Add Customer to Shopify
src/Apps/W1/Shopify/App/src/Customers/Reports/ShpfyAddCustomerToShopify.Report.al111 lines, Copyright (c) Microsoft Corporation. MIT
// ------------------------------------------------------------------------------------------------// Copyright (c) Microsoft Corporation. All rights reserved.// Licensed under the MIT License. See License.txt in the project root for license information.// ------------------------------------------------------------------------------------------------namespace Microsoft.Integration.Shopify;using Microsoft.Sales.Customer;/// <summary>/// Report Shpfy Add Customer to Shopify (ID 30112)./// </summary>report 30112 "Shpfy Add Customer to Shopify"{ ApplicationArea = All; Caption = 'Add Customer to Shopify'; ProcessingOnly = true; UsageCategory = Administration; dataset { dataitem(Customer; Customer) { RequestFilterFields = "No."; trigger OnPreDataItem() begin if ShopCode = '' then Error(NoShopSellectedErr); Clear(CustomerExport); CustomerExport.SetShop(ShopCode); CustomerExport.SetCreateCustomers(true); if GuiAllowed then begin CurrCustomerNo := Customer."No."; ProcessDialog.Open(ProcessMsg, CurrCustomerNo); ProcessDialog.Update(); end; end; trigger OnAfterGetRecord() var SyncCustomer: Record Customer; begin if GuiAllowed then begin CurrCustomerNo := Customer."No."; ProcessDialog.Update(); end; SyncCustomer.SetRange("No.", Customer."No."); CustomerExport.Run(SyncCustomer); end; trigger OnPostDataItem() begin if GuiAllowed then ProcessDialog.Close(); end; } } requestpage { SaveValues = true; layout { area(Content) { group(ShopFilter) { Caption = 'Options'; field(Shop; ShopCode) { ApplicationArea = All; Caption = 'Shop Code'; Lookup = true; LookupPageId = "Shpfy Shops"; TableRelation = "Shpfy Shop"; ToolTip = 'Specifies the Shopify Shop.'; ShowMandatory = true; } } } } } var CustomerExport: Codeunit "Shpfy Customer Export"; ShopCode: Code[20]; CurrCustomerNo: Code[20]; ProcessMsg: Label 'Adding customer #1####################', Comment = '#1 = Customer no.'; NoShopSellectedErr: Label 'You must select a shop to add the customers to.'; ProcessDialog: Dialog; /// <summary> /// Set Shop. /// </summary> /// <param name="ShopifyShop">Parameter of type Code[20].</param> internal procedure SetShop(ShopifyShop: Code[20]) begin ShopCode := ShopifyShop; end; /// <summary> /// Returns the Shop value selected on request page. /// </summary> procedure GetShop(): Code[20] begin exit(ShopCode); end;}