Skip to main content

Notifications

Announcements

No record found.

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

Matrix report values are disturbed when I run report with a blank parameter. How to fix?

(0) ShareShare
ReportReport
Posted on by 206
Hi everyone,
I have been working on a report recently with a two parameters /Quotation id/ from quotation table and /Warehouse/ from warehouse from Invent sum with range of (0 or 1) either with a value or null value.
 
So getting o the point reports works fine when i run it on //quotation id / parameter. when i run it with the /Warehouse/ parameter with a value (w6001)in it it works fine the /available physical quantity in warehouse (w6001) from invent sum is calculated accurate / but when i pass null value to /warehouse/ the available physical amount is disturbed.
in simple when I run report for a specific warehouse it is working fine.
I am using this code logic through which available physical quantity is being filled up.
​//This is used to store available physical from inventsum on basis of warehouse.   while   select   * from inventSum     where   inventSum.ItemId            == stockQuotationTmp.ItemId     && inventSum.InventLocationId       == stockQuotationTmp.WareHouse          {           stockQuotationTmp.NetAmount      += inventSum.AvailPhysical;       }​
 
for you reference i have attached visuals.
this is working fine with quantity:
//////
this is not working fine when i pass null (which means available physical from all the warehouses should be displayed) you can have refrence from warehouse /w6001/
//////
any guidence?
 
 
 
  • JJDunaid Profile Picture
    JJDunaid 206 on at
    Matrix report values are disturbed when I run report with a blank parameter. How to fix?
    Hi Mohamed,
    you didn't got my point , i think you have suggested me query range  for  the parameters ! i have tried it also , it doesn't work .
    I have debugged my code in debugging it is calculating correct physical quantity for all warehouses  but when data on report is displayed the results are different.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 11,290 Super User 2024 Season 2 on at
    Matrix report values are disturbed when I run report with a blank parameter. How to fix?
    Hi
     
    you can use a query
    e.g.
            Query                               query = new Query();
            QueryBuildDataSource                qbds;
            QueryBuildRange                     qbrItem, qbrWareHouse;
    
            qbds                                = query.addDataSource(tableNum(inventSum));
            if(stockQuotationTmp.ItemId  )
            {
                qbrItem                             = qbds.addRange(fieldNum(inventSum, ItemId));
                qbrItem.value(SysQuery::value(stockQuotationTmp.ItemId));
            }
            if(stockQuotationTmp.WareHouse)
            {
                qbrWareHouse                        = qbds.addRange(fieldNum(inventSum, InventLocationId));
                qbrWareHouse.value(SysQuery::value(stockQuotationTmp.WareHouse));
            }
    
            queryRun = new QueryRun(query);
            queryRun.saveUserSetup(true);
    Best regards,
    Mohamed Amine Mahmoudi

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,861 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,540 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans