Hello,
Task very straight fordward:
I need to show the Started Quantity (ProdTable.QtyStUp) in the JobGrid at the Job Registration form and be added/Removed from the Setup of Grids form (JmgRegistrationGridSetup)
Reason: due to our small stock(inventory) space we are not allow to store to much inventory. All that is produced is to be delivered. We set a production for 1 pc but we produce 2 pcs just in case 1 pc goes wrong. if the need 100 pcs, then we produce 120 (start qty/QtyStUp) and we end up RAF the planned/estimated qty 100. That make sure that the 20 raw materials get used in the Total Production Cost. But the inventory would be 100 pcs. 20 pcs addicition will be only physical scrap. So the worker needs to know how many should be produced and this is not in the standard AX from where I can see.
What is the correct/best way to add new custom column.??
I have already created a Display method in the JmgJobTable to get the QtyStUp from the ProdTable. I thought I could maybe force a StringEdit to the JobGrid in the JobRegistrationForm but no success. This grid is generated by X
////// Gets the started Quantity (ProdTable.QtyStUp) name of the production related to the current job. /// /// /// The QtyStUp quantity of the job. /// // BP Deviation Documented public display ProdQtyStUp QtyStUp() { return ProdTable::find(this.ModuleRefId).QtyStUp; }
I've been looking the \Classes\JmgRegistrationForm.registerAllGridFields(FormGridControl _fgc) that maybe can give me some clue but I dont know excaly how it works
Hi Nikolaos,
Well that was actually pretty straight forward.
1. add new element to JmgFieldName enum: NC_QtyStUp
2. edit Method Classes\JmgRegistrationForm\registerAllGridFields with new case for NC_QtyStUp
for (i = 1; i <= _fgc.controlCount(); i ) { currentControl = _fgc.controlNum(i); switch(currentControl.name()) { /* ->NestorC 01/04/2020 */ case formControlStr(JmgRegistration,NC_QtyStUp) : this.registerGridField(JmgFieldName::NC_QtyStUp,currentControl); break; /* <-NestorC 01/04/2020 */ case formControlStr(JmgRegistration,jobMarked) : this.registerGridField(JmgFieldName::Select,currentControl); break;
3. add the NC_QtyStUp as a Column in the Configure Registration form Terminal configuration (compile jobregistration and save and PLAY [: )
Thanks a lot for your kindly help!
Hi Nikolaos,
I am grateful for your fast response.
looks interesting I'll try to do that.
The FieldName lookup is not dynamic, it comes from JmgFieldName enum.
So you need to add new value to that enum, and add handling to the new value.
You can use cross references (right click - Add-ins - Cross-references - Used by) in the enum values to see how they are handled in code.
At least following places need to be adjusted by you:
Classes\JmgRegistrationForm\registerAllGridFields
Tables\JmgRegistrationSetup\createDefaultSetup
Hi CBNest,
See the DOC:
This link creates a form based on a query,is this what you need?
Hope this helps.
André Arnaud de Cal...
292,162
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156