{"title":"Codeunit 30286 Shpfy Company API, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/30286-shpfy-company-api/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":30286,"name":"Shpfy Company API","app":"Shopify Connector","url":"https://jonas-paprotka.de/ref/codeunit/30286-shpfy-company-api/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/30286-shpfy-company-api/source/","path":"src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:30103":{"name":"Shpfy Communication Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/30103-shpfy-communication-mgt/"},"codeunit:30157":{"name":"Shpfy Json Helper","url":"https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/"},"codeunit:30316":{"name":"Shpfy Metafield API","url":"https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/"},"table:30150":{"name":"Shpfy Company","url":"https://jonas-paprotka.de/ref/table/30150-shpfy-company/"},"table:30102":{"name":"Shpfy Shop","url":"https://jonas-paprotka.de/ref/table/30102-shpfy-shop/"},"codeunit:30313":{"name":"Shpfy Skipped Record","url":"https://jonas-paprotka.de/ref/codeunit/30313-shpfy-skipped-record/"},"codeunit:30284":{"name":"Shpfy Company Export","url":"https://jonas-paprotka.de/ref/codeunit/30284-shpfy-company-export/"},"codeunit:30290":{"name":"Shpfy Catalog API","url":"https://jonas-paprotka.de/ref/codeunit/30290-shpfy-catalog-api/"},"table:30151":{"name":"Shpfy Company Location","url":"https://jonas-paprotka.de/ref/table/30151-shpfy-company-location/"}},"procs":[{"name":"CreateCompany","line":25,"kind":"procedure","access":"internal","params":3,"steps":[[34,"call","CreateCompanyGraphQLQuery",2],[35,"ext","codeunit",30103,"ExecuteGraphQL",1],[38,"ext","codeunit",30103,"GetIdOfGId",1],[38,"ext","codeunit",30157,"GetValueAsText",2],[39,"ext","codeunit",30157,"GetJsonArray",3],[42,"ext","codeunit",30103,"GetIdOfGId",1],[42,"ext","codeunit",30157,"GetValueAsText",2],[44,"ext","codeunit",30157,"GetValueAsText",2],[46,"ext","codeunit",30157,"GetJsonArray",3],[48,"ext","codeunit",30157,"GetValueAsText",2],[48,"ext","codeunit",30103,"GetIdOfGId",1],[48,"ext","codeunit",30157,"GetValueAsText",2],[51,"call","AssignCompanyContact",5]]},{"name":"UpdateCompany","line":58,"kind":"procedure","access":"internal","params":1,"steps":[[65,"call","CreateGraphQueryUpdateCompany",1],[68,"ext","codeunit",30103,"ExecuteGraphQL",1],[71,"ext","codeunit",30103,"GetIdOfGId",1],[71,"ext","codeunit",30157,"GetValueAsText",2],[73,"ext","codeunit",30157,"GetValueAsDateTime",2]]},{"name":"UpdateCompanyLocation","line":78,"kind":"procedure","access":"internal","params":1,"steps":[[83,"call","CreateGraphQueryUpdateLocation",1],[85,"ext","codeunit",30103,"ExecuteGraphQL",1],[87,"call","UpdateCompanyLocationTaxId",1],[88,"call","UpdateCompanyLocationPaymentTerms",1]]},{"name":"SetShop","line":99,"kind":"procedure","access":"internal","params":1,"steps":[[102,"ext","codeunit",30103,"SetShop",1],[103,"ext","codeunit",30316,"SetShop",1]]},{"name":"AddFieldToGraphQuery","line":111,"kind":"procedure","access":"local","params":4,"steps":[[118,"ext","codeunit",30103,"EscapeGraphQLData",1]]},{"name":"CreateCompanyGraphQLQuery","line":126,"kind":"procedure","access":"internal","params":2,"steps":[[133,"call","AddFieldToGraphQuery",3],[135,"call","AddFieldToGraphQuery",3],[138,"call","AddFieldToGraphQuery",3],[140,"call","AddFieldToGraphQuery",3],[142,"call","AddFieldToGraphQuery",3],[144,"call","AddFieldToGraphQuery",3],[146,"call","AddFieldToGraphQuery",3],[148,"call","AddFieldToGraphQuery",3],[150,"call","AddFieldToGraphQuery",3],[152,"call","AddFieldToGraphQuery",3],[154,"call","AddFieldToGraphQuery",4],[156,"call","AddFieldToGraphQuery",3],[158,"call","AddFieldToGraphQuery",3],[161,"call","AddFieldToGraphQuery",3]]},{"name":"AssignCompanyContact","line":168,"kind":"procedure","access":"local","params":5,"steps":[[177,"ext","codeunit",30103,"ExecuteGraphQL",2],[178,"ext","codeunit",30103,"GetIdOfGId",1],[178,"ext","codeunit",30157,"GetValueAsText",2],[184,"ext","codeunit",30103,"ExecuteGraphQL",2],[186,"call","AssignCompanyContactRoles",3]]},{"name":"AssignCompanyContactRoles","line":191,"kind":"procedure","access":"local","params":3,"steps":[[203,"ext","codeunit",30103,"ExecuteGraphQL",2]]},{"name":"CreateGraphQueryUpdateCompany","line":207,"kind":"procedure","access":"internal","params":1,"steps":[[217,"call","AddFieldToGraphQuery",3],[219,"call","AddFieldToGraphQuery",3],[220,"ext","table",30150,"GetNote",0],[220,"ext","table",30150,"GetNote",0],[221,"call","AddFieldToGraphQuery",3],[221,"ext","codeunit",30103,"EscapeGraphQLData",1],[221,"ext","table",30150,"GetNote",0]]},{"name":"CreateGraphQueryUpdateLocation","line":230,"kind":"procedure","access":"internal","params":1,"steps":[[240,"call","AddFieldToGraphQuery",3],[242,"call","AddFieldToGraphQuery",3],[244,"call","AddFieldToGraphQuery",3],[246,"call","AddFieldToGraphQuery",3],[248,"call","AddFieldToGraphQuery",3],[250,"call","AddFieldToGraphQuery",4],[252,"call","AddFieldToGraphQuery",3],[254,"call","AddFieldToGraphQuery",3]]},{"name":"UpdateCompanyLocationTaxId","line":263,"kind":"procedure","access":"internal","params":1,"steps":[[275,"ext","codeunit",30103,"ExecuteGraphQL",2]]},{"name":"UpdateCompanyLocationPaymentTerms","line":278,"kind":"procedure","access":"internal","params":1,"steps":[[290,"ext","codeunit",30103,"ExecuteGraphQL",2]]},{"name":"RetrieveShopifyCompanyIds","line":293,"kind":"procedure","access":"internal","params":1,"steps":[[307,"ext","table",30102,"GetLastSyncTime",1],[310,"ext","codeunit",30103,"ExecuteGraphQL",2],[311,"ext","codeunit",30157,"GetJsonArray",3],[313,"ext","codeunit",30157,"GetValueAsText",2],[314,"ext","codeunit",30157,"GetJsonObject",3],[315,"ext","codeunit",30103,"GetIdOfGId",1],[315,"ext","codeunit",30157,"GetValueAsText",2],[316,"ext","codeunit",30157,"GetValueAsDateTime",2],[326,"ext","codeunit",30157,"GetValueAsBoolean",2]]},{"name":"RetrieveShopifyCompany","line":329,"kind":"procedure","access":"internal","params":2,"steps":[[341,"ext","codeunit",30103,"ExecuteGraphQL",2],[343,"ext","codeunit",30157,"GetJsonObject",3],[346,"call","UpdateShopifyCustomerFields",2],[348,"ext","codeunit",30157,"GetJsonObject",3],[349,"call","UpdateShopifyCompanyFields",2]]},{"name":"UpdateShopifyCustomerFields","line":352,"kind":"procedure","access":"internal","params":2,"steps":[[358,"ext","codeunit",30103,"GetIdOfGId",1],[358,"ext","codeunit",30157,"GetValueAsText",2],[359,"ext","codeunit",30157,"GetValueAsText",3],[360,"ext","codeunit",30157,"GetValueAsText",3],[361,"ext","codeunit",30157,"GetValueAsText",3],[362,"ext","codeunit",30157,"GetValueAsText",2]]},{"name":"UpdateShopifyCompanyFields","line":367,"kind":"procedure","access":"internal","params":2,"steps":[[373,"ext","codeunit",30157,"GetValueAsDateTime",2],[379,"ext","codeunit",30157,"GetValueAsDateTime",2],[380,"ext","codeunit",30103,"GetIdOfGId",1],[380,"ext","codeunit",30157,"GetValueAsText",2],[381,"ext","codeunit",30103,"GetIdOfGId",1],[381,"ext","codeunit",30157,"GetValueAsText",2],[382,"ext","codeunit",30157,"GetValueAsText",3],[383,"ext","codeunit",30157,"GetValueAsText",3],[384,"ext","codeunit",30157,"GetValueAsText",2],[387,"ext","codeunit",30157,"GetValueAsText",2],[390,"write",30150,"Modify"],[392,"ext","codeunit",30157,"GetJsonArray",3],[393,"ext","codeunit",30316,"UpdateMetafieldsFromShopify",3]]},{"name":"UpdateShopifyCompanyLocations","line":396,"kind":"procedure","access":"internal","params":1,"steps":[[408,"ext","codeunit",30103,"ExecuteGraphQL",2],[410,"call","ExtractShopifyCompanyLocations",4],[418,"ext","codeunit",30157,"GetValueAsBoolean",2]]},{"name":"UpdateShopifyCompanyLocation","line":421,"kind":"procedure","access":"internal","params":2,"steps":[[431,"ext","codeunit",30103,"ExecuteGraphQL",2],[433,"ext","codeunit",30157,"GetJsonObject",3],[436,"call","ExtractShopifyCompanyLocation",3]]},{"name":"CreateCompanyLocation","line":449,"kind":"procedure","access":"internal","params":1,"steps":[[462,"ext","codeunit",30313,"LogSkippedRecord",3],[467,"ext","codeunit",30313,"LogSkippedRecord",3],[470,"ext","codeunit",30284,"SetShop",1],[471,"ext","codeunit",30284,"CreateCompanyContact",2],[472,"call","CreateCustomerAsCompanyLocation",3]]},{"name":"CreateCustomerAsCompanyLocation","line":498,"kind":"procedure","access":"internal","params":3,"steps":[[513,"ext","codeunit",30284,"SetShop",1],[514,"ext","codeunit",30284,"FillInShopifyCompanyLocation",2],[519,"call","AddFieldToGraphQuery",3],[521,"call","AddFieldToGraphQuery",3],[523,"call","AddFieldToGraphQuery",3],[525,"call","AddFieldToGraphQuery",3],[527,"call","AddFieldToGraphQuery",3],[529,"call","AddFieldToGraphQuery",3],[531,"call","AddFieldToGraphQuery",4],[533,"call","AddFieldToGraphQuery",3],[535,"call","AddFieldToGraphQuery",3],[537,"call","AddFieldToGraphQuery",3],[539,"call","AddFieldToGraphQuery",3],[542,"call","AddFieldToGraphQuery",3],[549,"ext","codeunit",30103,"ExecuteGraphQL",1],[551,"ext","codeunit",30157,"IsTokenNull",1],[552,"call","CreateCustomerLocation",3],[553,"ext","codeunit",30157,"GetJsonArray",3],[555,"ext","codeunit",30157,"GetValueAsText",2],[555,"ext","codeunit",30103,"GetIdOfGId",1],[555,"ext","codeunit",30157,"GetValueAsText",2],[556,"call","AssignCompanyContact",5],[558,"ext","codeunit",30290,"CreateCatalog",4]]},{"name":"CreateCustomerLocation","line":581,"kind":"procedure","access":"local","params":3,"steps":[[587,"ext","codeunit",30103,"GetIdOfGId",1],[587,"ext","codeunit",30157,"GetValueAsText",2],[591,"ext","codeunit",30157,"GetValueAsText",2],[592,"write",30151,"Insert",1],[594,"ext","codeunit",30157,"GetValueAsText",3],[595,"ext","codeunit",30157,"GetValueAsText",3],[596,"ext","codeunit",30157,"GetValueAsCode",3],[597,"ext","codeunit",30157,"GetValueAsText",3],[598,"ext","codeunit",30157,"GetValueAsCode",3],[599,"ext","codeunit",30157,"GetValueAsText",3],[600,"ext","codeunit",30157,"GetValueAsText",3],[601,"ext","codeunit",30157,"GetValueAsText",2],[605,"ext","codeunit",30157,"GetValueAsText",3],[607,"ext","codeunit",30157,"GetValueAsText",3],[608,"ext","codeunit",30103,"GetIdOfGId",1],[608,"ext","codeunit",30157,"GetValueAsText",2],[613,"write",30151,"Modify",1]]},{"name":"ExtractShopifyCompanyLocations","line":617,"kind":"procedure","access":"local","params":4,"steps":[[622,"ext","codeunit",30157,"GetJsonArray",3],[624,"ext","codeunit",30157,"GetValueAsText",2],[625,"call","ExtractShopifyCompanyLocation",3]]},{"name":"ExtractShopifyCompanyLocation","line":631,"kind":"procedure","access":"local","params":3,"steps":[[637,"ext","codeunit",30103,"GetIdOfGId",1],[637,"ext","codeunit",30157,"GetValueAsText",2],[645,"ext","codeunit",30157,"GetValueAsText",2],[646,"write",30151,"Insert",1],[649,"ext","codeunit",30157,"GetValueAsText",3],[650,"ext","codeunit",30157,"GetValueAsText",3],[651,"ext","codeunit",30157,"GetValueAsCode",3],[652,"ext","codeunit",30157,"GetValueAsText",3],[653,"ext","codeunit",30157,"GetValueAsCode",3],[654,"ext","codeunit",30157,"GetValueAsText",3],[655,"ext","codeunit",30157,"GetValueAsText",3],[656,"ext","codeunit",30157,"GetValueAsText",2],[660,"ext","codeunit",30157,"GetValueAsText",3],[662,"ext","codeunit",30157,"GetValueAsText",3],[663,"ext","codeunit",30103,"GetIdOfGId",1],[663,"ext","codeunit",30157,"GetValueAsText",2],[668,"write",30151,"Modify",1]]}]}