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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to get createdBy id, name from CustInvoiceJour table and saving in CustInvoiceTmp for CustInvoice report?

(0) ShareShare
ReportReport
Posted on by 1,813

Hii,

I have a requirement to show customer invoice createdBy id and name on CustInvoice report.

I added two new fields in CustInvoiceTmp table of string type.

I wrote following code in CustInvoiceDP -> insertCustInvoiceTmp() method and before insert.

custInvoiceTmp.Invoice_CreatedBy_Id = custInvoiceJour.createdBy;
select name from userInfo where userInfo.id == custInvoiceJour.createdBy;
custInvoiceTmp.Invoice_CreatedBy_Name = userInfo.name;

Nothing is saving in Invoice_CreatedBy_Id and Invoice_CreatedBy_Name new fields in custInvoiceTmp table.
If saving some static values then is saves.
Restarted AOS, full compile but nothing work.

Please guide is this correct way to get createdBy id and name.
Thanks,

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Have you tried generating incremental CIL and redeploying your report after your changes. If not please do it and to get name you can use method userName of class userInfoHelp.

    Refer below link:

    (UserInfoHelp::userName Method [AX 2012])

    msdn.microsoft.com/.../userinfohelp.username.aspx

  • Rana Anees Profile Picture
    1,813 on at

    Hii Crispin,

    When I browse CustInvoiceTmp table from AOT,  the createdBy by  field is there and showing values. From where should to add createdBy field to CustInvoiceSRS query. Cant see in  CustInvoiceJour . thanks

  • Suggested answer
    Mahmoud Hakim Profile Picture
    17,887 on at

    Just create display method in custinvoicejour to retentive name of user from user info where created by =Id and fetch call this method in RDP class

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Please add the field CreatedBy to the datasource CustInvoiceJour in query CustInvoiceSRS such that value will not be blank during assignment to field Invoice_CreatedBy_Id of CustInvoiceTmp table(as suggested by Crispin).

    custInvoiceTmp.Invoice_CreatedBy_Id = custInvoiceJour.createdBy;

    Redeploy the report, run incremental CIL after your change.

  • Verified answer
    Rana Anees Profile Picture
    1,813 on at

    Thanks all,

    As you all suggested, did following customization to show invoice createdBy Id and name on CustInvoice report.

    1. Added two new fields of type string in CustInvoiceTmp table for createdBy Id and Name

    2. Added new field createdBy to CustInvoiceSRS query from CustInvoiceJour datasource in the AOT

    3. Added following code in class CustInvoiceDP -> insertCustInvoiceTmp() method before insert

    custInvoiceTmp.Invoice_CreatedBy_Id = custInvoiceJour.createdBy;
    custInvoiceTmp.Invoice_CreatedBy_Name = UserInfoHelp::userName(custInvoiceJour.createdBy);


    4. Refreshed CustInvoice report data-source in VS and added new columns to the report

    5. Re-deployed report and and restarted reporting service and the requirement achieved

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans