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 :
Microsoft Dynamics NAV (Archived)

Printing Active BOM

(0) ShareShare
ReportReport
Posted on by

I Have a report which when printed should show the"Active version" of a BOM. However it is instead showing the latest version which is still under development. 

Here is the code on the report which should get the BOM Version for the Label.


grecProductionBOMHeader.GET(Item."Production BOM No.");

IF gstrVersionCode = '' THEN // TIO000002
strVersionCode :=
cuVersionManagement.GetBOMVersion(
grecProductionBOMHeader."No.",
WORKDATE,
TRUE)
ELSE // TIO000002
strVersionCode := gstrVersionCode; // TIO000002
ERROR('ll');
IF NOT grecProductionBOMVersion.GET(
grecProductionBOMHeader."No.",
strVersionCode
) THEN
ERROR(Text002,
Item."Production BOM No.",
strVersionCode);

This is the "GetBOMVersion" Function in the codeunit called..


ProdBOMVersion.SETCURRENTKEY("Production BOM No.","Starting Date");
ProdBOMVersion.SETRANGE("Production BOM No.",BOMHeaderNo);
ProdBOMVersion.SETFILTER("Starting Date",'%1|..%2',0D,Date);
IF OnlyCertified THEN
ProdBOMVersion.SETRANGE(Status,ProdBOMVersion.Status::Certified);
IF NOT ProdBOMVersion.FINDLAST THEN
CLEAR(ProdBOMVersion);

EXIT(ProdBOMVersion."Version Code");

2311.80.PNG81.PNG

Any feedback would be appreciated

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Rajasekhar@MS Profile Picture
    5,569 on at

    Hi

    Can you check the dataset and how you are using the strversion in the report.(you can check by message in the code).

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 > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans