Resource Description on Inventory Value Report
-
Resource Description on Inventory Value Report
Posted by DSC Communities on February 9, 2017 at 6:07 pm-
Retha Lambrechts
MemberFebruary 9, 2017 at 6:07 PM
Hi, I’m new to AX. I went for a technical bootcamp on Dynamics AX 2012 R3.
My first project is to add the resource description to the Inventory Value Report. I had to add a parameter under the ResourceIDView in Setup/Inventory /Inventory Value Reports to allow the user to choose to see the ResourceID description yes/no.
I have added the parameter and have changed the code. I get the description, but it doesn’t look at the flag which means it shows regardless if I state I don’t want to see the description.
The following link helped me a lot to change all the classes. I also ran into the same issue as this person with the itemName not being populated and found that the reason is that inventTable at that point doesn’t look like the real inventTable buffer, thus no recid and no product fields are populated. The inventTable.intemName() needs the product table populated to be able to retrieve the description. I had to create a different buffer and use a select statement to find the first inventTable record for the available itemId and that retrieved the product name just find. I added it to method FindReportLine in InventValueReportPopulateItem but am pretty sure it should be in method BuildTransTransactionWithDynamicQuery and not a direct SQL statement like I used. So have anybody accomplished this before? Also any idea what I need to changes on the SSRS report in Visual Studio for it to look at the flag and not display it when the description checkbox is not checked? .adding new field in invent Value Report. – Microsoft Dynamics AX Community ForumDynamics remove preview adding new field in invent Value Report. – Microsoft Dynamics AX Community Forum Read the forum post on the Microsoft Dynamics Community. View this on Dynamics > ——————————
Retha Lambrechts
The Master’s Craft Flooring Company
West Plains MO
—————————— -
George Zhao
MemberFebruary 10, 2017 at 9:38 AM
It’s not possible to solve your problem without actually looking into your coding. Here is what I’m guessing:How do you hide the value from showing up on the report when user selects no? Don’t use “Hidden” property of the control at run time; my experience shows it does produce consistent result.
If the report is using a data provider class, don’t fill in the field when you prepare the temp table; if the report is using a query, us expression to return blank when the flag is set to no.
——————————
George Zhao
PAR Technology
New Hartford NY
——————————
——————————————- -
Retha Lambrechts
MemberFebruary 10, 2017 at 10:16 AM
Thanks George. I was able to change my code not to fill the field when the flag is set to false. However it still shows the column. The out-of-the-box report has already a View ResourceID and Total and view Resource Group and Total which one can turn on and off in the setup. When I choose to not see the ResourceGroup, it removes the column from the report, that’s what I want to do. It looks like this part is controlled in Visual Studio . This specific report uses precision design. So now I have to figure out where in the report designer does it switch the column between visible and not visible. Any ideas?——————————
Retha Lambrechts
The Master’s Craft Flooring Company
West Plains MO
——————————
——————————————- -
George Zhao
MemberFebruary 10, 2017 at 11:11 AM
So you want to hide the column completely, including the header?Then you have to use the “Hidden” property and make the property based on a expression. (Boolean negative of the flag)
You may have to try a few different ways to build the expression. (Like I said my own experience was inconsistent)
——————————
George Zhao
PAR Technology
New Hartford NY
——————————
——————————————- -
Retha Lambrechts
MemberFebruary 10, 2017 at 11:14 AM
I found it. I just needed to high-lighted the column, right-click and chose Column visibility. I added the expression similar to what the other columns had and it worked.I changed my select statement to be a query build on the fly in a method so that I do net have an explicit Select statement. It looks like when one step through the code that the select statement created by query build on the fly, only retrieve the fields that is in the group-by. It does say SELECT * FROM InventTable but not all fields are populated e.g. Recid and Product is 0. Stepping through the code of the method InventTable.ItemName() shows that if there is no dimensions it wants the product code with “this.product”. Seeing that product isn’t retrieved, it is zero which results in no product name returned. I’m not good enough with X++ yet so I have decided the safer way for me to go is to add a method called from FindReportLine to create a query on the fly to retrieve the one record for the ItemID that is known and then run the method InventTable.ItemName() .
——————————
Retha Lambrechts
The Master’s Craft Flooring Company
West Plains MO
——————————
——————————————-
DSC Communities replied 8 years, 6 months ago 1 Member · 0 Replies -
-
0 Replies
Sorry, there were no replies found.
The discussion ‘Resource Description on Inventory Value Report’ is closed to new replies.