Notifications
Announcements
No record found.
Hi, I'm trying to filter the Customer Statement based on the Financial Dimension. One simple way is to create a view like tihs:
https://www.axazure.com/en/show-dimensions-in-a-form-without-adding-table-fields
Well, I have this view and I want to use it to filter the records returned on the customer statement.
I'm trying to modify the query in the report classes.
One simple way would be if I could add the view to the query and then filter on it, but this does seem possible as the query.addDataSource() method wants a tableID.
Can anyone help?
Thanks
Hi Brian,
You can add the view as a data source using tableNum(<viewName>).
Here's my code:
query = next createBaseCustTransQuery(_party,_statementStartDate,_statementEndDate,_includeReversed); qbdsCustTrans = query.dataSourceTable(tableNum(CustTrans)); qbdsDimensionAttributeValueSet = qbdsCustTrans.addDataSource(tableNum(DimensionSetView)); qbdsDimensionAttributeValueSet.addlink(fieldNum(custtrans, DefaultDimension), fieldNum(DimensionSetView, DIMENSIONATTRIBUTEVALUESETRECID));
The second line wipes out the SQL in the query.
What am I missing?
Also, I can't seem to find the preRunModifyContract. The only place to do it is in the controller class.
This seems to be a good place to place your code. You could also try doing a CoC on createCustTransQueryForStatementCust method as all the ranges are being set here.
Could you please explain your statement - "The second line wipes out the SQL in the query."?
When this line runs:
query = next createBaseCustTransQuery(_party,_statementStartDate,_statementEndDate,_includeReversed);
and I check the SQL statement on the query object, it shows the select statement of the CustTable and the CustTrans with the range values for both tables.
But when this line runs:
qbdsDimensionAttributeValueSet = qbdsCustTrans.addDataSource(tableNum(DimensionSetView));
and I then check the SQL of the query object, there is no CustTable and the CustTrans SQL range values in the query object disappear and is replaced by just the CustTrans Table and the view but without any range values. It is as though my code overwrote the SQL of the returned query object and just replaced it with a new query.
Here's the first SQL value:
Here's the Second:
I tried similar code using DefaultDimensionView and looks like I am getting correct value for variable q.
not for me...
not sure why
Could you please try a full build of your development model, just to make sure there are no build issues?
I did a full build with 50 warnings but no errors. I still got the same result:
That's odd.
Could you try the same code in CoC of createCustTransQueryForStatementCust method and see if you see similar behavior?
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 565 Most Valuable Professional
André Arnaud de Cal... 450 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader