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

Community site session details

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

Purchase Price "Lists" - Bulk Update

(0) ShareShare
ReportReport
Posted on by 60

i enabled the new "Pricing" feature (i thought i was on sandbox!!) now i am stuck with purchase lists, which i dont think is very user-friendly.

is the idea to have a price list per vendor? or per change of price?

also there is no quick way to update prices in bulk! you cannot edit in excel, and if you export the configuration package it will not import back in! 

what is everyone doing with this?

I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,045 Moderator on at
    RE: Purchase Price "Lists" - Bulk Update

    I like the concept of the new price list feature because there is a defined pattern on how it can be extended. But i think Microsoft should have launched some more functionality around it. I have added some ideas on http://aka.ms/bcideas and i hope more people will do that so Microsoft get an inventive to do something about it.

    Until then i have added some customization code around it to make it more userfriendly.

  • Iamtommoore Profile Picture
    60 on at
    RE: Purchase Price "Lists" - Bulk Update

    What code have you added, anything willing to share?

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,045 Moderator on at
    RE: Purchase Price "Lists" - Bulk Update

    I have added code for:

    • Batch job that can update open orders when prices list have been updated
    • Import updated prices from Excel
    • Fact boxes for the Item page / Item Page list that displays active prices from the price lists

    I will see of i can publish something on Github in a day or two.

  • Suggested answer
    MahGah Profile Picture
    15,529 on at
    RE: Purchase Price "Lists" - Bulk Update

    Hi Mr Bruvik

    I wonder if you have seen a good document about this new pricing method? I could not find a good document yet. Thanks

  • Iamtommoore Profile Picture
    60 on at
    RE: Purchase Price "Lists" - Bulk Update

    No nothing! To say it's such a big change there is no videos or anything

  • Iamtommoore Profile Picture
    60 on at
    RE: Purchase Price "Lists" - Bulk Update

    Any chance you managed to do the Batch Job? im currently updating 200 lines of prices :(

  • Iamtommoore Profile Picture
    60 on at
    RE: Purchase Price "Lists" - Bulk Update

    NorthW

  • Suggested answer
    Alfredo_Iorio Profile Picture
    1,262 on at
    RE: Purchase Price "Lists" - Bulk Update

    There is a new Price Worksheet functionality with the new price experience. It's still in preview though and it might not have all you need. Worth a try.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,045 Moderator on at
    RE: Purchase Price "Lists" - Bulk Update

     Hi Iamtommoore 

    Here is a codeunit that has a function that takes a SalespricelistCode as a parameter.

    The function will then update all salesorders with new prices.

    codeunit 55008 "Priceupdate for Orders"
    {
        trigger OnRun()
    
        begin
    
        end;
    
        /// 
        /// UpdatePricesOnOrders.
        /// 
        /// Code[20].
        procedure UpdatePricesOnOrders(SalesPriceListCode: Code[20])
    
        var
            PriceListHeader: Record "Price List Header";
            PriceListLine: Record "Price List Line";
            Salesline: Record "Sales Line";
        begin
    
            if Confirm('Updating all salesorder with new prices from pricelist %1', false, SalesPriceListCode) then begin
                PriceListHeader.SetRange(Code, SalesPriceListCode);
                if PriceListHeader.FindFirst() then begin
                    PriceListLine.SetRange(PriceListLine."Price List Code", PriceListHeader.Code);
                    PriceListLine.SetRange("Asset Type", PriceListLine."Asset Type"::Item);
                    if PriceListLine.FindSet(false, false) then
                        repeat
                            Salesline.Reset();
                            Salesline.SetRange(Type, Salesline.type::Item);
                            Salesline.SetRange("No.", PriceListLine."Asset No.");
                            if Salesline.FindSet(true, false) then
                                repeat
                                    if Salesline."Currency Code" = PriceListLine."Currency Code" then begin
                                        Salesline.Validate("Unit Price", PriceListLine."Unit Price");
                                        Salesline.Modify(true);
                                    end;
    
                                until Salesline.Next() = 0;
    
                        until PriceListLine.Next() = 0;
    
                end;
                Message('Update completed');
            end;
    
        end;
    
    
    }

    I will make another post with the code for the action on the sales price list that triggers it.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,045 Moderator on at
    RE: Purchase Price "Lists" - Bulk Update

    Iamtommoore 

    Here is code to add an action to the price list page.

    pageextension 55008 SalesPriceList extends "Sales Price List"
    {
    
        actions
        {
            addlast(Processing)
            {
                action(OppdaterOrdrepriser)
                {
                    Caption = 'Set new price on salesorders';
                    ApplicationArea = all;
                    Image = PriceAdjustment;
                    Tooltip = 'Adjust salesorders with the current prices in the pricelist';
                    trigger OnAction()
                    var
                        PriceUpdateSalesOrders: Codeunit "Priceupdate for Orders";
                    begin
                        PriceUpdateSalesOrders.UpdatePricesOnOrders(rec.Code);
    
    
                    end;
    
                }
                }
                }
                
                

    Hope this helps you further.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,255

#2
Sumit Singh Profile Picture

Sumit Singh 2,665

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,401

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans