I keep getting requests to add a column to grids and I was looking for a better way to recreate the original in order to replace with a BAQView I create (or copy and modify).
Is there some way to backtrack if an epiUltraGrid that come in Epicor was created from a system BAQ?
An example one that they keep pushing on me is: Method Tracker->Material->List grid.
I have looked into trying to recreate the grid manually but there are multiple columns that I am unsure of the mapping.
Any answers are welcome and appreciated. Also, any links to answers or tutorials on recreating system grids…
That was the start of my journey down the rabbit hole of recreating the grid with a BAQ and then replacing the grid’s contents with my BAQ. It worked great with a little help from @josecgomez.
My problem is that there are grids that I am not sure what all the mappings were. If they are based on system BAQs created by Epicor, then how would I backtrack from the grid to see what BAQ they were using.
If I can find that, I can copy and modify it, then substitute my new BAQ for their BAQ.
Thanks for linking that topic though, it can help other people in my boat.
Open the form in Customization - click the grid and look at the EpiBinding field.
In the case of the material list it points to ECOMtl which is a DataView on the form.
You can view the DataView’s by clicking
Tools > Object Explorer then
Custom Object Explorer > Data Objects > then open the desired item on the tree
In this case that grid isn’t driven by a baq but foreign key views against a DataView. Essentially, you can keep what’s there and add your own FKV against the dataView to link it to a specific table\field.
When somebody just wants one extra column in a system grid, rather the rebuild the wheel, we programmatically add a column to the EpiUltraGrid and populate the cells manually through a loop.
This keeps it simple especially if the data exists in a view in the form already.
I’ve got some snippets of code I saved so I had a good starting place for next time.
To manipulate the EpiUltraGrid you need to pull in the right namespace:
using Infragistics.Win.UltraWinGrid;
Then you need to reference the datagrid, check if the column exists already and add it if not. In this instance I did it in an EpiViewNotification event.
Once the column is in I then looped throw the rows and updated the value for each:
foreach (UltraGridRow row in invoices.Rows)
{
// get the key from the datagrid
int rmaNum = (int?)row.Cells["RMANum"].Value ?? 0;
// do some lookup using RMANum and set the new column value
row.Cells["DebitMemoRef"].Value = "some value";
}
It can be depending on what you are doing. If you are doing DB lookups (Business Object, BAQ, or anything like that) yes it is very inefficient.
But if its simple calculations that may be ok
Just for context, the example I posted above was in the Customer Credit Manager screen. On a change of customer I would execute a BAQ and pull in a list of RMA numbers/debit note references (or some field like that, I forget) and store the results.
When the InvoiceHead view was updated I would then add a column to the Invoice datagrid and lookup the debit note reference from the stored BAQ results to populate the row using the RMA number as a key.
Many ways to skin a cat, in this case here is what I recommend, sorry I’ve mostly ignored this thread been busy, but I had a few minutes to look this morning.
You want to get some UD fields from Part into ECOMtl view ( and potentially PartMtl) that’s pretty easy and it is actually built in to the system
Step 1: Create UD Fields in Part_UD which you’ve already done
Step 2: Create the same UD fields in ECOMtl_UD and PartMtl_UD (same name is recommended but not necesary)
Step 3: Use Extended UD Table Field Map to map over the data from Part_UD to ECOMtl_UD
And just like that it will automatically copy those fields to ECOMtl from Part
Step 3: Can then be repeated from EcoMTl to PartMtl if you want to store them in that table. The _UD fields added to the ECOMtl table automatically show up in the Method Tracker Material List View.
I followed your steps:
I had the Part_UD fields already created.
I created the same name fields in ECOMtl.
I did a regen and recycle app pool to enable new UD fields.
I then opened ‘Extended Field Map Maintenance’
Selected Map ID 6 (Source: Part, Target: ECOMtl)
Filled in Description and clicked the ‘Enabled’ checkbox.
Mapped the 2 fields to the corresponding tables same named columns.
Saved and exited Epicor.
Went back in and looked at the Method Tracker: Materials -> List tab and the UD fields were not listed.
I even opened Tools->Optimization and made sure the fields were not hidden in there.