{"title":"Codeunit 30171 Shpfy Create Item, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/30171-shpfy-create-item/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":30171,"name":"Shpfy Create Item","app":"Shopify Connector","url":"https://jonas-paprotka.de/ref/codeunit/30171-shpfy-create-item/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/30171-shpfy-create-item/source/","path":"src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.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":{"table:30127":{"name":"Shpfy Product","url":"https://jonas-paprotka.de/ref/table/30127-shpfy-product/"},"codeunit:30177":{"name":"Shpfy Product Events","url":"https://jonas-paprotka.de/ref/codeunit/30177-shpfy-product-events/"},"table:30129":{"name":"Shpfy Variant","url":"https://jonas-paprotka.de/ref/table/30129-shpfy-variant/"},"table:5401":{"name":"Item Variant","url":"https://jonas-paprotka.de/ref/table/5401-item-variant/"},"codeunit:30171":{"name":"Shpfy Create Item","url":"https://jonas-paprotka.de/ref/codeunit/30171-shpfy-create-item/"},"codeunit:30175":{"name":"Shpfy Item Reference Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/30175-shpfy-item-reference-mgt/"},"table:27":{"name":"Item","url":"https://jonas-paprotka.de/ref/table/27-item/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"codeunit:30166":{"name":"Shpfy Process Order","url":"https://jonas-paprotka.de/ref/codeunit/30166-shpfy-process-order/"},"codeunit:30104":{"name":"Shpfy Filter Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/30104-shpfy-filter-mgt/"},"table:2000000132":{"name":"Entity Text","url":"https://jonas-paprotka.de/ref/table/2000000132-entity-text/"},"codeunit:2010":{"name":"Entity Text","url":"https://jonas-paprotka.de/ref/codeunit/2010-entity-text/"},"table:5404":{"name":"Item Unit of Measure","url":"https://jonas-paprotka.de/ref/table/5404-item-unit-of-measure/"},"codeunit:1336":{"name":"Item Templ. Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/1336-item-templ-mgt/"},"table:204":{"name":"Unit of Measure","url":"https://jonas-paprotka.de/ref/table/204-unit-of-measure/"},"codeunit:30180":{"name":"Shpfy Product Import","url":"https://jonas-paprotka.de/ref/codeunit/30180-shpfy-product-import/"}},"procs":[{"name":"OnRun","line":40,"kind":"trigger","steps":[[47,"call","SetShop",1],[49,"call","ExistItem",3],[51,"write",30127,"Modify"],[53,"ext","codeunit",30177,"OnBeforeCreateItem",5],[55,"call","DoCreateItem",4],[57,"write",30127,"Modify"],[58,"ext","codeunit",30177,"OnAfterCreateItem",4],[64,"call","CreateItemVariant",3],[65,"call","CreateItemUnitOfMeasure",2],[69,"call","ExistItem",3],[73,"ext","codeunit",30177,"OnBeforeCreateItem",5],[75,"call","DoCreateItem",4],[76,"ext","codeunit",30177,"OnAfterCreateItem",4],[80,"call","ExistItem",3],[84,"ext","codeunit",30177,"OnBeforeCreateItem",5],[86,"call","DoCreateItem",4],[87,"ext","codeunit",30177,"OnAfterCreateItem",4],[91,"call","ExistItem",3],[95,"ext","codeunit",30177,"OnBeforeCreateItem",5],[97,"call","DoCreateItem",4],[98,"ext","codeunit",30177,"OnAfterCreateItem",4]]},{"name":"CreateItemVariant","line":110,"kind":"procedure","access":"local","params":3,"steps":[[121,"call","CreateReferences",4],[124,"write",30129,"Modify"],[127,"ext","codeunit",30177,"OnBeforeCreateItemVariant",6],[143,"call","ExistItem",3],[145,"write",30129,"Modify"],[147,"ext","codeunit",30177,"OnBeforeCreateItem",5],[149,"call","DoCreateItem",4],[150,"ext","codeunit",30177,"OnAfterCreateItem",4],[155,"call","CreateNewVariantCode",3],[161,"write",5401,"Insert"],[165,"write",30129,"Modify"],[166,"ext","codeunit",30171,"CreateReferences",4],[168,"ext","codeunit",30177,"OnAfterCreateItemVariant",5]]},{"name":"CreateNewVariantCode","line":179,"kind":"procedure","access":"local","params":3,"steps":[[184,"ext","codeunit",30177,"OnBeforeCreateItemVariantCode",6]]},{"name":"CreateReferences","line":204,"kind":"procedure","access":"internal","params":4,"steps":[[209,"ext","codeunit",30175,"CreateItemBarCode",4],[209,"call","FindUoMCode",1],[213,"ext","codeunit",30175,"CreateItemBarCode",4],[213,"call","FindUoMCode",1],[218,"write",27,"Modify"],[220,"ext","codeunit",30175,"CreateItemReference",6],[220,"call","FindUoMCode",1]]},{"name":"DoCreateItem","line":232,"kind":"procedure","access":"local","params":4,"steps":[[244,"call","FindItemTemplate",2],[261,"call","CreateItemFromTemplate",3],[264,"call","CreateItemUnitOfMeasure",2],[268,"validate",27,"Unit Cost"],[270,"validate",27,"Unit Cost"],[270,"ext","table",330,"ExchangeAmtFCYToLCY",4],[270,"ext","table",330,"ExchangeRate",2],[274,"validate",27,"Unit Price"],[276,"validate",27,"Unit Price"],[276,"ext","table",330,"ExchangeAmtFCYToLCY",4],[276,"ext","table",330,"ExchangeRate",2],[279,"validate",27,"Tariff No."],[279,"call","GetTariffNo",1],[280,"validate",27,"Country/Region of Origin Code"],[280,"ext","codeunit",30166,"GetCountryCode",1],[284,"ext","codeunit",30104,"CleanFilterValue",2],[290,"ext","codeunit",30104,"CleanFilterValue",2],[296,"call","CreateEntityText",2],[298,"write",27,"Modify"],[301,"write",30129,"Modify"],[304,"write",30127,"Modify"],[308,"call","CreateReferences",4]]},{"name":"CreateEntityText","line":311,"kind":"procedure","access":"local","params":2,"steps":[[323,"write",2000000132,"Insert"],[325,"ext","codeunit",2010,"UpdateText",2],[325,"ext","table",30127,"GetDescriptionHtml",0],[326,"write",2000000132,"Modify"]]},{"name":"CreateItemUnitOfMeasure","line":329,"kind":"procedure","access":"local","params":2,"steps":[[343,"call","FindUoMCode",1],[352,"write",5404,"Insert"]]},{"name":"CreateItemFromTemplate","line":358,"kind":"procedure","access":"local","params":3,"steps":[[369,"ext","codeunit",1336,"InitItemNo",2],[371,"write",27,"Insert",1],[372,"ext","codeunit",1336,"ApplyItemTemplate",3]]},{"name":"FindItemTemplate","line":432,"kind":"procedure","access":"local","params":2,"steps":[[436,"ext","codeunit",30177,"OnBeforeFindItemTemplate",5],[441,"ext","codeunit",30177,"OnAfterFindItemTemplate",4]]},{"name":"FindUoMCode","line":450,"kind":"procedure","access":"local","params":1,"steps":[[474,"write",204,"Insert"]]},{"name":"GetTariffNo","line":494,"kind":"procedure","access":"internal","params":1,"steps":[[504,"ext","codeunit",30104,"KeepDigits",1],[510,"ext","codeunit",30104,"KeepDigits",1]]},{"name":"CreateItemsFromShopifyProducts","line":520,"kind":"procedure","access":"internal","params":1,"steps":[[524,"call","CreateItemFromShopifyProduct",1]]},{"name":"CreateItemFromShopifyProduct","line":532,"kind":"procedure","access":"internal","params":1,"steps":[[536,"ext","codeunit",30180,"SetShop",1],[537,"ext","codeunit",30180,"SetProduct",1],[538,"ext","codeunit",30180,"SetCreateNewItem",1],[540,"run","codeunit",30180]]}]}