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...
Suggested Answer

API issue- pivot (P2p) Software to BC integration

(9) ShareShare
ReportReport
Posted on by 212

Hi Team,

We are currently working on integrating the Pivot application with the Business Central ERP. However, we’re encountering a challenge while posting purchase invoices through the standard Business Central API. Below is a summary of the scenario and the issue:

Scenario:


  1. In the Pivot application, invoices (either expense or procurement-related) are created and pushed to Business Central via API for direct posting

  2. The item involved in the invoice (e.g., Item B) is entered in Pivot based on the actual transaction.

  3. However, during posting in Business Central, we’re facing dimension-related issues


  4.  

Business Central Setup:

 

Item Card (Business Central):

  • Global Dimension 1: Department = Item A, with Value Posting = Same Code

  • Global Dimension 2: Business Segment = GAS, with Value Posting = Same Code

  • Shortcut Dimension 3: Cost Type = Travel

  • Default Dimension Priority Order:

    1. Item

    2. G/L Account

    3. Vendo


     

Issue:

When Pivot sends an invoice related to Item B, it includes Department = Item B as Global Dimension 1 in the API payload. Despite this:

Shortcut Dimensions 3 and 4 are updated correctly as per the Pivot input.

But Global Dimensions 1 and 2 are not updated in Business Central; the system retains the default values from the Item Card instead.

Request:

Could you please review and advise:

Is there any configuration missing on the Business Central side?

  •  

    Or is there a need to modify the API payload to allow overriding dimensions that have "Same Code" set?

 
I have the same question (0)
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,631 Super User 2025 Season 2 on at
    Hello,
     
    To resolve this, you can either change the Value Posting setting from "Same Code" to "Blank" or "Code Mandatory" on the Item Card to allow overrides, or adjust the API payload to ensure it aligns with the default dimension values, though this limits flexibility.
     
    Reviewing the dimension setup and considering a configuration change is recommended to support dynamic dimension updates via API.
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,136 Super User 2025 Season 2 on at
    When "Value Posting = Same Code" is set on the item’s default dimensions in Business Central, the system enforces that only the specified dimension value (from the item card) can be used. This means values passed via API will be ignored if they differ from the enforced dimension.
     
    ✅ Solution:
    To allow Pivot to override these values via API, you must change the Value Posting setting on the item’s dimensions from "Same Code" to "Blank" or "Code Mandatory" (if flexibility is required).
     
    If strict control is needed, you can:
     
    Keep "Same Code" and update the item’s default dimension values.
     
    Or pre-validate and align Pivot data before sending it to BC.
     
     
    ✅ Mark this answer as verified if it helps you.
     
     
  • Vinayak Vishnu Sagvekar Profile Picture
    212 on at
    I tried to update as code mandatory but still result is same.
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at
    Hi, If you use the following standard API, this does not include the dimension field, which will be obtained from the master data when assigning a value.
    Get purchaseInvoiceLines
     
    Thanks.
    ZHU
  • Gerardo Rentería García Profile Picture
    25,157 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Troubleshoot and correct dimensions - Business Central | Microsoft Learn

    Temporarily change the "Value Posting" value to "Blank" or "Code Mandatory" and try again.

    Best Regards
    Gerardo

  • Suggested answer
    Jeffrey Bulanadi Profile Picture
    8,760 on at

    Hi Vinayak,

    The issue stems from how BC enforces dimension values when Value Posting = Same Code is set on the item card. This setting tells BC to always use the dimension value defined on the item, and it will ignore any incoming override — including those passed via API.

    Here’s how to approach it:

    Why Your API Payload Is Ignored

    • When Value Posting = Same Code is set, BC locks the dimension to the value on the master record (Item, G/L, Vendor).
    • Even if your API payload includes a different value (e.g., Department = Item B), BC will override it with the default from Item A.
    • This applies to both UI and API transactions — it’s a system-level enforcement.

    Options to Resolve

    Option 1: Change Value Posting to “Blank” or “Optional”

    • On the Item Card, set Value Posting to Blank or Optional for Global Dimensions 1 and 2.
    • This allows the API to pass custom values and have them respected during posting.
    • You can still use dimension priorities to fall back to item defaults if no value is passed.

    Option 2: Use a Custom API Page

    • If you can’t change the item setup, create a custom API page that:
    • Accepts dimension values
    • Applies them via AL logic before posting
    • Bypasses the default enforcement by using ValidateShortcutDimCode or SetGlobalDimCode in code

    Option 3: Post via Journal Instead of Purchase Invoice API

    • Use the General Journal API to post the invoice indirectly.
    • This gives you full control over dimensions and avoids the rigid enforcement tied to purchase documents.

    Option 4: Use Power Automate or Middleware

    • Intercept the payload before posting and adjust dimension values based on business rules.
    • This is useful if you want to retain “Same Code” enforcement for manual entries but allow flexibility for integrations.


    Helpful References:
    Working with Dimensions – Microsoft Learn
    Value Posting Behavior – Dynamics 365 Lab
    Custom API Page for Dimensions – GitHub Sample



    If you find this helpful, feel free to mark this as the suggested or verified answer.

    Cheers
    Jeffrey

  • Vinayak Vishnu Sagvekar Profile Picture
    212 on at
    Thank you all for your inputs and perspectives. Based on your feedback, I revisited the requirement and found it to be slightly different. Please find below the revised analysis I’ve done.
     
    Requesting you see my below observation and feedback and based on that will you give your view and inputs to proceed further to conclude as correct solution.
     
     the PIVOT application updates the Department dimension to "Overhead" for Item A on a purchase invoice. However, in Business Central, Item A has a default dimension set to "Accounting" with Value Posting = Same Code.
    When the purchase invoice is sent from PIVOT to Business Central, the system ignores the "Overhead" dimension from PIVOT and posts the invoice using the default "Accounting" dimension, without triggering any validation error.
    In this integration phase The behavior of business central ERP is correct because when Value Posting= Same code updated on item card that time system will never consider the new dimension where as business user requesting an enhancement as below.
    Requested Enhancement:
    • If the dimension value sent from PIVOT does not match the default dimension in BC (where "Same Code" is enforced), the system should not post the invoice automatically.
    • Instead, the invoice should be created in draft/unposted status, and Business Central should retain the dimension sent by PIVOT, even if it's incorrect.
    • This would allow business users to review the dimension conflict, correct it manually, and post the invoice with the appropriate values.
    Observation/Feedback:
    As we mentioned BC system will never update or override the dimension in case of value posting= Same code. So in draft invoice wrong dimension value which is sending by pivot can not be updated in business central purchase invoice line level so we cant maintain such value on line level but pivot team required to take action on api side where they can maintain log before pushing the invoice to BC to avoid such errors.
     

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 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans