web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

No. Series is not working through API using the Item Template

(0) ShareShare
ReportReport
Posted on by 40

Hi, 

We are using Power Automate to synchronise the item from CRM to BC. We setup the item template in BC API Setup. Items were created successfully with all the preset in item template except the No. Series.

The item created through Power Automate takes the No. Series of ITEM instead of ITEM-CRM. I also tried to create item in BC using the template ITEM_1 and the no. series of ITEM-CRM was used perfectly. So only through the API got that issue. Any idea if I missed any configuration? Thank you.

  • Environment
    • Business Central Cloud Version
  • Item Template
    • Name: ITEM_1
    • No. Series: ITEM-CRM
    • Type: Non-Inventory
    • UoM: EACH
    • Item Category Code: SAL00001
    • GST Posting Group: GST15
    • Gen. Prod Posting Group: SAL00001
  • Inventory Setup
    • Item No: ITEM
  • API Setup
    • Order: 0
    • Table ID: 27
    • Page ID: 5470 (I tried other two item pages #20008 and #30008 as well. same...)
    • Template Code: ITEM_1
    • Condition: when item category code is SAL000001
I have the same question (0)
  • steveendow Profile Picture
    2,281 on at

    Hi Lillian,

    I have setup a few new item number series and configured the API Setup with a few Item Template Codes based on Type and Item Category Code.

    pastedimage1614043124411v1.png

    I am seeing the same behavior that you describe.  Items imported via the BC web API are using the default item number series from Inventory Setup.  The API appears to be ignoring the No. Series assigned to the templates and always relying on the Inventory Setup series.

    I'm going to review the AL code for the Item API page to see if I can confirm it lacks the code to use the No. Series from the template.

  • Verified answer
    Lillian Du Profile Picture
    40 on at

    Much appreciate. :)

  • Verified answer
    steveendow Profile Picture
    2,281 on at

    I reviewed the code for the Items API page and I'm not seeing any code to lookup or use the Item Template from the API Setup page. So it seems that is being done through some other code.

    I'm going to check with a friend to see if he knows where the API Setup & Template is being invoked.

  • Verified answer
    steveendow Profile Picture
    2,281 on at

    Hi Lillian,

    I got some help from AJ Kauffman, who showed me where to look for the API code that applies the Templates.

    From what I can tell, the BC API page inserts the record first, and then the API Setup code is run to apply the template to update the inserted record.  Because the Item is inserted before the Template is applied, it defaults to using the No. Series from the Inventory Setup page.

    pastedimage1614119933791v1.png

    I am not yet able to decipher the actual template field update code, but my guess is that API Setup does not attempt to use the No. Series from the Template because that would require that it modify (renumber) the existing Item No. value for the new item record.  

    If my understanding is correct, I can guess why this limitation exists.  Presumably re-numbering an existing record is a more involved process.

    But on the other hand, that is unfortunate, as I can imagine lots of scenarios where one might want to use different number series for imported records, whether those are items, customers, vendors, sales orders, etc.

    I'm now wondering if it is possible to create a custom API that will lookup the Template, retrieve the next number from the No. Series, and assign it to the Item during the API call.  Likely possible, but it would be custom.

  • Lillian Du Profile Picture
    40 on at

    Hi Steve,

    Thanks so much. It clearly shows why the No. Series is not working through API as expected.

    We will live with that for now and use item Category to identify the different category of the items. Thank you.

    Cheers,

    Lillian

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,577

#2
YUN ZHU Profile Picture

YUN ZHU 888 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 778 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans