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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Extend project invoice

(0) ShareShare
ReportReport
Posted on by 1,205

Hi all,

I'm struggling to extend the project invoice.  I'm familiar with the process having extended some of the other documents however this seems to be a bit of a pain.  I created PrintMgtDocTypeHandlersExt

class PrintMgtDocTypeHandlersExt
{
    [SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]
    public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)
    {
        switch (_docType)
        {
            case PrintMgmtDocumentType::ProjectInvoice:
                _result.result(ssrsReportStr(PSAProjInvoiceExt, Report));
                break;
        }
    }

}

which references my new report design.  I extended the menu items to point to my new controller PSAProjAndContractInvoiceControllerExt I took the standard main method and referenced my new class. I've tried many different things.  

class PsaProjAndContractInvoiceControllerExt extends PSAProjAndContractInvoiceController
{
    public static PsaProjAndContractInvoiceControllerExt construct()
    {
        return new PsaProjAndContractInvoiceControllerExt();
    }

    public static void main(Args _args)
    {
        PSAProjAndContractInvoiceControllerExt controller;

        //
        if (EInvoiceParameters_MX::isElectronicInvoiceEnabled()
            && EInvoiceProjController_MX::hasEInvoice(_args))
        {
            EInvoiceProjController_MX::main(_args);
            return;
        }
        //

        // 
        if (!ProjInvoiceJour_TH::canInvoiceBePrinted(_args))
        {
            return;
        }
        // 
        
        controller = new PSAProjAndContractInvoiceControllerExt();
        controller.initArgs(_args);
        controller.startOperation();
    }

    protected void outputReport()
    {
        SRSCatalogItemName  reportDesign;
        reportDesign = ssrsReportStr(PSAProjInvoiceExt,Report);
        this.parmReportName(reportDesign);
        this.parmReportContract().parmReportName(reportDesign);
        formletterReport.parmReportRun().settingDetail().parmReportFormatName(reportDesign);
        super();
    }

}

If you could tell me best way to extend PSAProjAndContractInvoiceController to redirect to custom ssrs design it would be hugely appreciated.  Can't follow the standard documentation either https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/analytics/custom-designs-business-docs as this calls methods that don't exist in the proj class. Also, for some reason it refuses to display my custom design in print management, even though i've deployed the report multiple times.  

I have the same question (0)
  • Suggested answer
    Sukrut Parab Profile Picture
    71,741 Moderator on at

    Create your own controller class and call your own report design in it .  Then create extension for output menu item where it is used and change object property to your controller class and see if it helps.

  • jhowe Profile Picture
    1,205 on at

    Hi Sukrut, basic example of either COC extension on PSAProjAndContractInvoiceController or posthandler method would be great. I'm still learning x++. I have done the other pieces.

  • Verified answer
    jhowe Profile Picture
    1,205 on at

    Found the issue, controller class is not necessary.  Document type was incorrect should be PrintMgmtDocumentType::SIProjInvoice not PrintMgmtDocumentType::ProjectInvoice.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 612

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 592 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 586 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans