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 AX (Archived)

Project Id and Contract Id for CustInvoice Report!!!

(0) ShareShare
ReportReport
Posted on by 1,883

Dear Experts - I'm working on CustInvoice Report, I wants to display this two fields ProjId and Contract ID in this report. The path for this report A.R->Reports->Transactions->Invoice->customer invoice transactions. I execute below code in CustInvoiceDP(insertCustInvoiceTmp()), but there is an error called "Argument '_recId' is incompatible with the required type".

    custInvoiceTmp.ProjectId     = CustInvoiceLine::find(custInvoiceJour.InvoiceId).ProjId;
    custInvoiceTmp.ContractId=   = ProjFundingSource::find(custInvoiceJour.InvoiceId).ContractId;

Please help me to resolve above issue...

Thanks,

Faqru Shaik

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    You're using a wrong method. The parameter of find() is RecId of CustInvoiceLine; you can't put there a completely different value of a completely different type.

    What logic are you trying to implement? How will you decide from which line you'll take the data?

  • Faqruddin Profile Picture
    1,883 on at

    Is that possible to get those values in CustInvoiceReport. Could you please suggest me exact method to get this values.

  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    Forget implementation details for a moment and let's design the logic to implement. You can't write code until you know what it should do.

    What are you trying to achieve?

    It seems that you want to take value from an invoice line, but then you have to decide which line you would use.

  • Faqruddin Profile Picture
    1,883 on at

    Yes, I agree with your point. The logic that I know put in the code and its fail. Exactly as you said I'm trying to execute two fields from CustInvoiceLine table. But the error occurred and I'm confused. Could you please suggest me exact logic to achieve this values..

    Thanks

  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    Again, how will you pick the line? Let's say you have one line with ProjectA and one with ProjectB - how will you decide which project will go into custInvoiceTmp.ProjectId?

  • Faqruddin Profile Picture
    1,883 on at

    I implement above logic based on A.R->Free text invoices->all free text invoices, each and every invoice have project id and contract id under line details grid select project tab and there you will see this two values. So my logic is every invoice id in the report must have unique project id and contract id. I hope you get my point..

    Thanks

  • Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    I know what you want. The problem is that one invoice can be related to many projects, because project is set on each line and one invoice can have many lines.

    Therefore your report either must support several project IDs for invoice, or you have to somehow pick a single project ID if there is more than one.

    Is it clear to you now?

  • Faqruddin Profile Picture
    1,883 on at

    See my screenshot below, One invoice have only one projectId and I agree your point one invoice can have many lines. Please clear one thing, Can I execute this projectid in my report or not...

    projectid.png

  • Verified answer
    Martin Dráb Profile Picture
    237,904 Most Valuable Professional on at

    No, you're wrong. Your picture shows five lines and each can have a different project ID. You're looking at details of the first line only; change the selected line in the grid to see details of another line.

  • Faqruddin Profile Picture
    1,883 on at

    Yes it was my mistake to not select each line. So finally I understand a single invoice can have multiple projects with different project id and contract id and also not possible to display this two values in such conditions. I will explain your valuable points to my client....

    Thanks

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans