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)

Insert Sales Taker/ sales Responsible name to Customer Invoice Transaction

(0) ShareShare
ReportReport
Posted on by

I want to Custom at Customer Invoice Transaction Report and Insert Sales Taker or Sales Responsible Name

i using this code

  recId = HcmWorker::find(SalesTable.WorkerSalesTaker).Person;
        select * from hcmWorker
        where hcmWorker.Person == wrIdRec;
        tmp.SalesResponsible = hcmWorker.name();

or

  recId = HcmWorker::find(custInvoiceJour.WorkerSalesTaker).Person;
        select * from hcmWorker
        where hcmWorker.Person == wrIdRec;
        tmp.SalesResponsible = hcmWorker.name();

but it doesn't work to display sales worker/sales responsible

i think because query dataSourceTable using custInvoiceJour Table not SalesTable/SalesLine

but at Customer Invoice Transaction Report must using custInvoiceJour, any body help me to insert sales taker in this report?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at

    Hi rihanarika,

    Try this

    HcmWorker hcmWorker = HcmWorker::find(custInvoiceJour.WorkerSalesTaker);
    if (hcmWorker)
    {
        salesTakerName = hcmWorker.name();
    }
    
  • Verified answer
    Faqruddin Profile Picture
    1,883 on at

    Hello Rihanarika,

    //First create following static method on CustInvoiceJour Table;

    public static CustInvoiceJour findFromInvoiceId(InvoiceId _invoiceId)
    {
    CustInvoiceJour custInvoiceJour;

    if (_invoiceId)
    {
    select firstonly custInvoiceJour
    where custInvoiceJour.InvoiceId == _invoiceId;
    }

    return custInvoiceJour;
    }

    //Second create display method on CustInvoiceJour table and find the worker with each invoice id...

    public display Name workerSaleTaker()
    {

    return HcmWorker::find(CustInvoiceJour::findFromInvoiceId(this.InvoiceId).WorkerSalesTaker).name();
    }

    Now you can use above method form or report as per your requirement..

    Regards,

    Faqru 

  • Community Member Profile Picture
    on at

    Hi ievgen Miroshnikov,

    still doesn't work :(

  • Mea_ Profile Picture
    60,284 on at

    Could you please tell us what you have done and what "does not work" ? We can't help you if we don't know what code do you have.

  • Community Member Profile Picture
    on at

    Thank You So Much!!!

    It Work For me

    :D

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans