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

Purchase Price List by Item Category

(4) ShareShare
ReportReport
Posted on by 377
Hi,
 
Our NAV2018 client is migrating to BC SaaS. We did a modification to the purchase prices in Nav to be able to set purchase prices based on a custom field on the Item.
For this example, let's say it was based on the Item Category.
How can I reproduce something similar using the Purchase Price List?
 
The one related to Adding a Fixed Assets as a Product Type.
The issue is that in Codeunit 7021 "Purchase Line - Price", the system automatically assigned the purchase line "no." field to the "asset no." for the price calculation.
In my case, it's not the item no. that I want but another field from that Item.
There is no GetAssetNo() function like there is one for GetAssetType()
 
I also thought about adding a custom field on the purchase price list that I could filter on, but then, I can't leave Asset No. field blank to consider all items with that custom field set to the same value
I tried setting the Product Type (Asset Type) to All but the system doesn't let me. It removes the value and put Item instead
 
Any idea on what I should try next?
 
Thanks
-Julie
I have the same question (0)
  • Verified answer
    Ramesh Kumar Profile Picture
    7,527 Super User 2025 Season 2 on at

    Customizing the Price Calculation Logic (Codeunit 7021 Modification):

    You can extend or modify Codeunit 7021 ("Purchase Line - Price") to use your custom field (e.g., Item Category or another field) instead of the Asset No. for price calculations.

    Steps to achieve this:

    • Extend Codeunit 7021: Instead of using GetAssetNo() to get the Asset No., you can write custom logic to check the Item Category (or another custom field). In the price calculation logic, after you retrieve the Item for the Purchase Line, you can check the Item Category or other relevant field on the Item. Use this field in your calculations for applying the purchase price

    • you can also create a custom field on the Purchase Price List and modify the lookup or filtering logic so that it doesn’t require an Asset No. if you're targeting a custom field for price assignment.

    https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/codeunit/microsoft.purchases.pricing.purchase-line---price

    Thanks, Ramesh

    If this was helpful, please check the "Does this answer your question?" box and mark it as verified.

  • Juliem Profile Picture
    377 on at
    Thank you @Ramesh Kumar for your reply but I have to admit I am new to Interfaces and it's still not clear.
     
    Does that mean that I need to create a copy of codeunit 7002 "Price Calculation - V16" and a copy of codeunit 7021 "Purchase Line - Price" and change all the reference to "Purchase Line - Price" in my custom version of "Price Calculation - V16" to point to my custom version of "Purchase Line - Price"
    If this is not the case, how do I tell the system to use my implementation of Pricing instead of the base implementation.
  • Verified answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at
    Hi, for Interface, hope the following can give you some hints.
    Business Central 2024 wave 2 (BC25): Extend AL interfaces
     
    And, the new price module will replace the original one from NAV, so if you want to customize it now, it is recommended to customize it based on the new module.
     
    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.

    Extending Price Calculations - Business Central | Microsoft Learn

    Best Regards
    Gerardo

  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,631 Super User 2025 Season 2 on at

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