Instead of direct assignment of the values to the query build range value, we can use SysQuery class methods to avoid the errors of datatype conversion. So here in this post I gave some useful methods.
D365 FinOps & Power Platform Unlocked is your go-to source for expert insights on Microsoft Dynamics 365 Finance & Operations and the Power Platform. Discover tutorials, tips, and best practices to leverage D365 F&O alongside Power BI, Power Apps, Power Automate, and more. Stay up-to-date with the latest innovations and solutions to optimize your enterprise systems and drive business success with ease
Tuesday, November 9, 2021
SysQuery functions/ query functions in D365 FO
QueryBuildRange qbr;
---To set the value we usually follow as below mentioned code
qbr.value(“Our Value”);
qbr.value(queryValue(“Our Value”));
--We can set the value using SysQuery methods like mentioned below
qbr.value(SysQuery::value(“Our Value”));
qbr.value(SysQuery::valueLike(“Our Value”));
qbr.value(SysQuery::valueNot(“Our Value”));
---For logical NOT
qbr.value(SysQuery::valueNot(“Our Value”));
---To retrive all records
in usual way we can give like empty (” “) but using sysquery class
qbr.value(SysQuery::valueUnlimited());
---To retrive Null records
qbr.value(SysQuery::valueEmptyString());
---To retrive Not Null records
qbr.value(SysQuery::valueNotEmptyString());
---To give range
usually we add qbr.value(fromDate,toDate) but using sysQuery
qbr.value(SysQuery::range(fromDate,toDate);
The method will add the dots (‘..’) like this
---To find total number of records available in the resulting query
info(strFmt(“%1”,SysQuery::countTotal(queryRun)));
---To find total number of Datasource available in the resulting query
info(strFmt(“%1”,SysQuery::countLoops(queryRun)));
--- For Datasource and Range creation
SysQuery::findOrCreateRange(parameter);
SysQuery::findOrCreateDataSource(parameter);
SysQuery::findOrCreateDataSourceByName(parameter);
Subscribe to:
Post Comments (Atom)
Why do users often get confused about Dynamics 365 Customer Engagement (D365 CE), Dataverse, and the Power Platform?
The Microsoft ecosystem for business applications can sometimes be difficult to navigate, especially when discussing Dynamics 365 Customer...
-
I have two solutions to post a packing slip through X++. Please change the cod accordingly. Solution - 1 - The best way to post packing ...
-
Below is the example I created for demonstrating how to call a menu item from X++. In this example I'm calling sales packing slip menu ...
-
Below is the job I created for posting sales invoices. Solution 1 ------------------ Public static void salesOrderInvoiceByLine(...
No comments:
Post a Comment