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 :
Finance | Project Operations, Human Resources, ...
Answered

SalesPackingSlip report design not updated

(0) ShareShare
ReportReport
Posted on by 678

Hi All,

I would like to change the SalesPackingSlip report design a bit and thus in order to expand application suite report data set, I duplicated the existing report and changed the design and created the extension of a menu item and assign the extension of controller to it. 

my code is as follows. 

 

class SalesPackingSlipController_my extends SalesPackingSlipController
{

    public static SalesPackingSlipController_my construct()
    {
        #ISOCountryRegionCodes
        GlobalizationInstrumentationHelper::featureRunByCountryRegionCodes(
                    [ [#isoIT, GlobalizationConstants::FeatureReferenceIT00020] ],
                    funcName()
                );

        return new SalesPackingSlipController_my();
    }

    /// 
    /// Initailzes the controller, sets the print management, assigns parameter values and runs the SRS report.
    /// 
    /// 
    /// The Args object.
    /// 
    public static void main(Args _args)
    {
        SrsReportRunController      formLetterController = SalesPackingSlipController_my::construct();

        // 
        // print document set
        if (TaxThaiGovCertificationFeatureChecker::isUnrealizedVATEnabled()
            && _args.parmEnum() != PrintCopyOriginal::OriginalPrint)
        {
            SalesPackingSlipController::printDocumentSet(_args);
        }
        else
        {
            // 
            SalesPackingSlipController_my controller = formLetterController;
            controller.initArgs(_args, PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderPackingSlip).getDefaultReportFormat());
            
            // redirect to my own report, SalePackingSlip_my 
            if (controller.reportName == ssrsReportStr(SalesPackingSlip, Report))
            {
                controller.parmReportName((ssrsReportStr(SalesPackingSlip_my, Report)));
            }

            if (classIdGet(_args.caller()) == classNum(SalesPackingSlipJournalPrint))
            {
                SalesPackingSlipController::subscribeToRenderingCompleted(formLetterController);
            }

            formLetterController.startOperation();
            // 
        }
        // 
    }

}

However, the report design is not updated at all.  I guess the report design is overwritten after calling formLetterController.startOperation();

Where should I modify to redirect it to my own report?

Thank you. 

I have the same question (0)
  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shawn,

    If you only have a change in design, I don't think you need to create a child class of the controller to achieve this. You can create a CoC on

    getDefaultReportFormat method in PrintMgmtDelegatesHandler class and return this report for sales packing slip

    [ExtensionOf(classstr(PrintMgmtDelegatesHandler))]
    final class PrintMgmtDelegatesHandler_myExtension
    {   
        
        protected static PrintMgmtReportFormatName getDefaultReportFormat(PrintMgmtDocumentType _docType)
        {
            PrintMgmtReportFormatName reportFormatName;
        
            reportFormatName = next getDefaultReportFormat(_docType);
            
            if (reportFormatName == ssrsReportStr(SalesPackingSlip, Report))
            {
                return ssrsReportStr(SalesPackingSlip_my, Report);
            }
        }
    }

  • ShawnDEV Profile Picture
    678 on at

    Hi,

    I did that but still the updated report design is not shown but the original one only although the report has been deployed without any error.

    and also when I click preview/print - copy preview menu item it shows the progress bar with the correct report name like 'Processing operation - SalesPackingSlip_my.Report'. I am not sure what went wrong..

    Is there somewhere I need to check additionally?

    Thank you.

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Shawn,

    If it is showing the right report name, it should print the correct report. Could you please try re-deploying the report and see if works? Please check if there are any errors while deploying as well that might be preventing the changes being deployed.

  • ShawnDEV Profile Picture
    678 on at

    Hi,

    I did full build of my my model, data sync. and re-deployed the report. but there were no errors but still the original report design is shown.

    Should I change this report format ? Is this the only option?

    pastedimage1616538801484v1.png

    Thank you. 

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Rather than change the format, you can delete the print management settings and check if it works? I am not sure if you have included code to add the design to print management.

  • ShawnDEV Profile Picture
    678 on at

    Hi,

    I just did the full build of all models (not only my model), then it shows correctly :)

    Thank you.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 672 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 534 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 289 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans