Dynamics Business Central / NAV Development Developer Digest - Vol. 423

Dynamics Business Central / NAV Development Developer Digest - Vol. 423

ArcherPoint’s Developer Digest focuses on Microsoft Dynamics 365 Business Central and Dynamics NAV development. In this week’s Developer Digest vol. 423: BC wave 1 release plan, web service APIs, inserting new prices into the Item Sales Price List, and more.

The Dynamics NAV and Business Central community, including the ArcherPoint technical staff, comprises developers, project managers, and consultants who are constantly communicating with the common goal of sharing helpful information to help customers be more successful.

As they run into issues and questions, find the answers, and make new discoveries, they post them on blogs, forums, and social media…for everyone’s benefit. We in Marketing watch these interactions and never cease to be amazed by the creativity, dedication, and brainpower we’re so fortunate to have in this community—so we thought, wouldn’t it be great to share the wealth of information with everyone who might not have the time to check out the multitude of resources out there?

Thus, the ArcherPoint Microsoft Dynamics NAV/BC Developer Digest was born. We present a collection of thoughts and findings from Dynamics NAV/BC experts and devotees worldwide each week. We hope these insights will benefit you, too.

The D365 BC 2023 Wave 1 Release Plan is Here!

It’s time to plan and prepare for Dynamics 365 Business Central, 2023 Wave 1. Microsoft has published the release plan for this next major release, which includes:

  • Improvements to Power Platform integration
  • Application feature enhancements
  • Country and regional additions
  • Development advancements
  • Governance and admin improvements
  • Legislation capabilities
  • Onboarding elements
  • Microsoft 365 productivity
  • Better user experiences

Don’t miss out on Microsoft Virtual Training Days

Learn about Azure, Dynamics 365, Microsoft 365, Power Platform, and Microsoft Security virtually with Microsoft’s Virtual Training Days. Select the products that are relevant to your work to see what training is coming up.

Understanding Web Service APIs

Heinrich shares a new book for those that wish to gain a deeper understanding of Web Service APIs for Microsoft Dynamics 365 Business Central from Spare Brained Ideas.

Inserting new prices into the Item Sales Price List

Yann reaches out to the development team: “I’m inserting new prices into the Item Sales Price List and Purchase Price List. When I insert a new item, I ensure that existing items where the ending date is greater than or equal to my start date are updated with a date that does not conflict. This creates a few issues… it can create duplicates, but it also sets the items to draft if I Modify(true). This is not an acceptable behavior. The Price List Management codeunit seems to have a procedure to help with that, but I cannot get it to behave the way I want because of the ResolveDuplicatePrices(PriceListLine); which opens UI.

procedure ActivateDraftLines(var PriceListLine: Record “Price List Line”)
begin
PriceListLine.SetRange(Status, “Price Status”::Draft);
if PriceListLine.IsEmpty() then
exit;
VerifyLines(PriceListLine);
ResolveDuplicatePrices(PriceListLine);
OnAfterActivateDraftLines(PriceListLine);
end;

Has anyone worked with this and found an acceptable solution?”

Kyle suggests: “Maybe there is an event you can subscribe to so that you can check for duplicates before it does the rest of the processing?”

Chris explains: “The UI is more than likely because you have a duplicate (Customer/Item/Starting Date in the simplest sense).  As long as the Starting Dates differ, that popup should be avoided. If it’s the UI I’m thinking of, it chooses one line and deletes the rest of the matching lines. You can do this in code, and you will never hit duplicates. One odd thing you say is that you need to use modify.  The Price List Line table is keyed by Price List and a Line No.  You should never hit a duplicate if you are just inserting lines. The status is just a field and can be manually set if you know your data is valid, but I would go down the route of making sure there are no duplicates.”

Yann responds: “Thanks, Chris. The date certainly could be modified to prevent duplicates. During my testing, I did uncover cases that probably won’t happen during normal use, but that should be kept in mind and baffled accordingly. I always find it interesting to fully understand how Microsoft codes something and how they expect us to work with it programmatically. Cheers!”

Interested in Dynamics NAV and Business Central development? Be sure to see our collection of NAV/BC Development Blogs.

Read “How To” blogs from ArcherPoint for practical advice on using Microsoft Dynamics NAV and Dynamics 365 Business Central.

Trending Posts

Stay Informed

Choose Your Preferences
First Name
*required
Last Name
*required
Email
*required
Subscription Options
Your Privacy is Guaranteed