Hi, I want to create some computed fields in a form grid (checkbox, price fields, discountgroup)
How can I realize this to show entered values only on the gridline I wnat (and not on all lines) and how can I get the single values to work with
Please use the debugger to debug your code and tell us where it doesn't behave as expected.
By the way, using allowEdit() there makes no sense. Do it in active() method of the data source.
edit NoYes AvnOverwritePrice(boolean _set, VendInvoiceJour _vendInvoiceJour, NoYes _overwrite) { NoYes overwrite; ; element.findTmpFrmVirtual(tmpFrmVirtualHeader2, _vendInvoiceJour.TableId, _vendInvoiceJour.RecId); if (tmpFrmVirtualHeader2) { overwrite = NoYes::Yes; } if (_set) { if(_overwrite == NoYes::Yes) { avnNewDiscountPercent.allowEdit(true); avnNewLineDiscountCode.allowEdit(true); element.writeTmpFrmVirtual(tmpFrmVirtualHeader2, _vendInvoiceJour.TableId, _vendInvoiceJour.RecId, _vendInvoiceJour.InvoiceId, utcDateTimeNull()); overwrite = NoYes::Yes; } else { GOENewDiscountPercent.allowEdit(false); GOENewLineDiscountCode.allowEdit(false); tmpFrmVirtualHeader2.delete(); overwrite = NoYes::No; } } return overwrite; }
Hi CRSW,
there must be something wrong with your code. Please check it. And if you need help, please share it. Thanks!
because, as I mentioned, my values are shown an all gridlines and not only the one I entered it
Then why do you ask how to do it if you're already aware of code doing it?
Therefore:
"How can I get the single values to work with?" - You get the current record in _header variable and you try to find it in the temporary table (element.findTmpFrmVirtual()).
yes. Markall saves in tmpVirtualHeader and I create a myTmpVirtualHeader instance for my code
Where do you store information about which lines have been selected? Either explain your design to us or show your code.
MarkAll saves that in a temporary table, as you can see in editMarkAll() method.
ok. more precised:
I try to add new columns in the purchcopying form (creating a credit note)
1 checkbox to mark if price should be overwritten
1 field to enter new discount percentage
1 field to select a lineDiscgroup
The fields "discount percentage" and "lineDiscGroup" can only be filled if the checkbox is marked
This part works for now, but after adding values to the fields and change selection of the grid line the entered data appears on each line in the grid.
I tried to it similar to the "Mark all" field in this form
I' don't really understand the second line of the text, but I guess Using the display Method Modifier will help you.
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156