Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Relation between CustTrans and MainAccountId

(0) ShareShare
ReportReport
Posted on by 65

Hello everyone, 

I am working on a SSRS report, data is from a copy of the query  CustAccountStatement_FR  and I have a colum named MainAccount which must display the main account of the transaction based on the SummaryLedgerDimension of the corresponding PostingProfile setup and I have a parameter named Main Account to filter the data.

In other terms, based on the posting profile of the transaction, I must get the SummaryLedgerDimension of CustLedgerAccounts. 

if the parameter is not null, query must be updated with adding dataSources + links to reach this but I cannot seem be able to do it. 

My report is not displaying any data... 

Below is a screenshot for the original query (I just added a new range in my query) 
pastedimage1673300292058v1.png

this is the code I wrote :

qbds = queryRun.query().dataSourceTable(tablenum(CustTrans)).addDataSource(tablenum(CustLedgerAccounts));
qbds.addLink(fieldNum(CustTrans, PostingProfile), fieldNum(CustLedgerAccounts, PostingProfile));

qbds1 = queryRun.query().dataSourceTable(tablenum(CustLedgerAccounts)).addDataSource(tablenum(CustTable));
qbds1.addLink(fieldNum(CustTable, CustGroup), fieldNum(CustLedgerAccounts, Num));

qbds2 = queryRun.query().dataSourceTable(tablenum(CustLedgerAccounts)).addDataSource(tablenum(DimensionAttributeValueCombination));
qbds2.addLink(fieldNum(DimensionAttributeValueCombination, RecId), fieldNum(CustLedgerAccounts, SummaryLedgerDimension));

queryRun.query().dataSourceTable(tablenum(DimensionAttributeValueCombination)).addRange(fieldNum(DimensionAttributeValueCombination,DisplayValue)).value(mainAccountIdparam);

Thanks in advance! 

  • Suggested answer
    BillurSamdancioglu Profile Picture
    BillurSamdancioglu 16,615 Most Valuable Professional on at
    RE: Relation between CustTrans and MainAccountId

    Just an opinion to have the customer as dimension on the customer. This will make easier in reporting purposes.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Relation between CustTrans and MainAccountId

    Hi NissenB,

    Instead of adding the DataSource to query via code - You can create your custom query and add your required DataSource. Also, if you add that query to view it will be very useful for you to troubleshoot the issue.

    Also, on the table CustLedgerAccount - Refer to the relation node - CustTable is related with CustLedgerAccount table through Num field and AccountCode field value in CustLedgerAccount table must be "Table".

    Thanks,

    Girish S.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,996 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,853 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans