---
title: "Codeunit 30316 Shpfy Metafield API, extension points 29"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/points/
object: https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/
app: "Shopify Connector"
major: 29
source: https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
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/"
---

# Codeunit 30316 Shpfy Metafield API, extension points 29

JOP-AL, https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/points/

14 procedures and triggers with a step in src/Apps/W1/Shopify/App/src/Metafields/Codeunits/ShpfyMetafieldAPI.Codeunit.al, in source order, read from the text, not from a run.

## SetShop

[Line 18](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L18), internal.

- [21](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L21) calls [Codeunit 30103 Shpfy Communication Mgt.](https://jonas-paprotka.de/ref/codeunit/30103-shpfy-communication-mgt/) `SetShop`

## SyncMetafieldToShopify

[Line 31](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L31), internal.

- [40](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L40) calls `SetShop`
- [41](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L41) calls `CreateMetafieldQuery`
- [42](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L42) calls `UpdateMetafields`
- [44](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L44) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetJsonArray`
- [47](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L47) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetJsonArray`
- [49](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L49) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsBigInteger`

## SyncMetafieldsToShopify

[Line 54](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L54), internal.

- [56](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L56) calls `SetShop`
- [57](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L57) calls `CreateOrUpdateMetafieldsInShopify`

## CreateOrUpdateMetafieldsInShopify

[Line 69](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L69), internal.

- [77](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L77) calls `RetrieveMetafieldsFromShopify`
- [78](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L78) calls `CollectMetafieldsInBC`
- [89](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L89) calls `GetMaxMetafieldsToUpdate`
- [95](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L95) calls `CreateMetafieldQuery`
- [99](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L99) calls `UpdateMetafields`

## RetrieveMetafieldsFromShopify

[Line 108](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L108), local.

- [113](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L113) calls [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) `GetOwnerType`

## CollectMetafieldsInBC

[Line 117](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L117), local.

- [131](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L131) writes [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) Insert
- [135](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L135) writes [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) Insert

## UpdateMetafields

[Line 144](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L144), internal.

- [149](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L149) calls [Codeunit 30103 Shpfy Communication Mgt.](https://jonas-paprotka.de/ref/codeunit/30103-shpfy-communication-mgt/) `ExecuteGraphQL`

## CreateMetafieldQuery

[Line 157](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L157), internal.

- [167](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L167) calls [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) `GetOwnerTypeName`
- [172](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L172) calls [Codeunit 30103 Shpfy Communication Mgt.](https://jonas-paprotka.de/ref/codeunit/30103-shpfy-communication-mgt/) `EscapeGraphQLData`
- [175](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L175) calls `GetTypeName`

## UpdateMetafieldsFromShopify

[Line 197](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L197), internal.

- [204](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L204) calls `CollectMetafieldIds`
- [207](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L207) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetJsonObject`
- [208](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L208) calls `UpdateMetadataField`
- [212](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L212) calls `DeleteUnusedMetafields`

## GetMetafieldDefinitions

[Line 215](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L215), internal.

- [217](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L217) calls `SetShop`

## GetMetafieldDefinitions

[Line 230](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L230), local.

- [240](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L240) calls [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) `GetOwnerType`
- [242](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L242) calls [Codeunit 30103 Shpfy Communication Mgt.](https://jonas-paprotka.de/ref/codeunit/30103-shpfy-communication-mgt/) `ExecuteGraphQL`
- [244](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L244) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetJsonArray`
- [246](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L246) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetJsonObject`
- [247](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L247) calls `CreateMetafieldDefinition`

## CreateMetafieldDefinition

[Line 251](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L251), local.

- [259](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L259) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsText`
- [260](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L260) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsText`
- [261](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L261) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsText`
- [264](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L264) calls `ConvertToMetafieldType`
- [275](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L275) validates [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) `Parent Table No.`
- [277](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L277) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsBigInteger`
- [283](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L283) writes [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) Insert(true)

## UpdateMetadataField

[Line 286](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L286), local.

- [294](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L294) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsText`
- [299](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L299) calls `ConvertToMetafieldType`
- [299](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L299) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsText`
- [302](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L302) validates [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) `Parent Table No.`
- [304](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L304) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsBigInteger`
- [307](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L307) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsText`
- [308](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L308) calls [Codeunit 30157 Shpfy Json Helper](https://jonas-paprotka.de/ref/codeunit/30157-shpfy-json-helper/) `GetValueAsText`
- [311](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L311) writes [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) Modify
- [312](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L312) writes [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) Insert

## DeleteUnusedMetafields

[Line 341](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L341), local.

- [348](https://jonas-paprotka.de/ref/codeunit/30316-shpfy-metafield-api/source/#L348) writes [Table 30101 Shpfy Metafield](https://jonas-paprotka.de/ref/table/30101-shpfy-metafield/) Delete

## Source

AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
