I have added new fields to "InventTable" table and need to add these new fields to the form "InventOnHand" and make them available for filtering and sorting using the standard filter function in the form grid ("CTRL-G")
I have tried several approaches without luck.
1. Adding "InventTable" to the forms datasource and creating innerjoin with InventSum.
This resulted in new fields showing random data from the new tields in InventTable.
2. Adding the extra fields to the "InventSum" table and synchronizing them with the same fields from "InventTable"
Now I can see data in the table using tablebrowser, but the new fields then just appear as "Unretrieved" in the form.
funny enough I am also able to filter and sort data in the form using the new columns.
As far as I have discovered until now, the form datasource Query is rewritten every time by the "InventDimCtrl_Frm_OnHand" class in the "ModifyQuery" method (amongst others), so I have tried to modify this by using the "AddSortField" from the QueryBuildDataSource object for "InventSum"
This just results in some of the default fields showing up as "unretrieved" until I reset the "modifyQuery" method back to default
As I need to be able to filter and sort using the new data it is not an option to simply use display methods for the new data.
If anyone have done this with succes I would appreciate the help.
(please disregard the missing label-text in the last column :-) )
*This post is locked for comments
Below is a step-by-step guide to add a new table/field to the On-Hand Inventory form.
FYI:
As other users mentioned above, forms with this "dimensions" button have special grouping.
The on-hand form uses query InventOnhandDim.
STEPS:
Step 01:
Step 02:
Step 03:
Step 04:
Step 05:
Step 06:
Step 07:
Sanity check…make sure a "relation" is defined to join dummy table inside the query.
Done, value now shows OK.
Couple extra notes:
I'm also facing the issue similar to this,but my problem is i want to add invent sum field in on hand inventory form , but it showed as unretreived,it is a string field .i tried with solution explained her .
i have wrote qbsSum.addGroupByField((Inventsum,fieldname)) in inventDimCtrl_Frm_OnHand class, modified query method.
its working now,my question is .will it create any problem in grouping and all because of my piece of code?
Awaiting for ur reply
I did just now, and it worked. Thanks!
The above suggestions about adding the InventTable ds to the query and grouping on the necessary fields are sound. Have you tried that approach, Zach?
Has there been a confirmed way to do this? I'm having the same issue.
Thanks,
Zachary
If you add inventTable as a Datasource, you need to group by the fields you want to display, since the main datasource uses SUM functions (and group by functions).
If you take a close look on INVENTDIM datasource, you will see that depending on your "InventDimParm" (Dimension Criteria) selection, the group by changes.
Which means, add the Search Name fields and the other field to group by clauses and it should work.
Hi Jenson,
in "InventDimCtrl_Frm_OnHand" class in the "ModifyQuery" method , please pass the inventtable data source and then wrote the following code
QueryBuildDataSource qbsSum = _inventTable_DS.query().datasourceTable(tablenum(InventTable);
qbsSum .addGroupByField(FieldId);
so you need the use addGroupByField , to show them.
Regards,
Bilal
Hi Bilal
As I wrote in my initial post, it is the InventOnhand form and not the InventSum form that is bugging me.
I have allready tried adding the fields using "AddSumField" in the ModifyQuery method on the "InventdimCtrl_Frm_Onhand" class with no luck..
Hi Bo,
InventSum form uses InventSum::queryAddSumFields(inventSum_DS.query().dataSourceTable(tableNum(InventSum))) methode to init query , please t add your fields in that method.
Regards,
Bilal
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156