Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

Populate temp tables within a switch statement

$
0
0

AX 2009. I need to populate a grid on a form. I have a regular table where I am using TableGroupAll functionality, which we will call "VendRelation" for the purposes of this post. I'm using it in conjuction with the VendTable to set which inventory items can be purchased from a specific Vendor. At the moment, I'm just working on displaying the correct items on the vendor screen.

On my grid, I need to display all the "VendRelation" records which would be relevant to the specific vendor. If, for instance, the "TableGroupAll" relation was "All", the record should show on the grid regardless of the vendor. If "TableGroupAll" was "Group", I'd want to display it if the Vendor was in the appropriate vendor group, and, obviously, if it was "Table", I'd want the record to only display if the vendor matched the vendor in VendRelation.

Please note I'm a little rusty here, and I expect people to pick apart the way I'm doing this. Go for it :)

I have a case statement that should populate a temp table (a temp table I created in the AOT, not an on-the-fly temp table) based on whether "TableGroupAll" is 0, 1 or 2 in VendRelation. The problem seems to be that when doing a temp table within a case statement, it "drops" the insert as you move from case-to-case. So, I only end up with the table being populated if it matches the very last case. I did put info logs in each case statement, and it is pulling the right records, just not putting them all into the temp table - only the ones that match the last case. I do not have break statements between the case statements.

Thoughts?


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>