I have added a subform to the itemcard on a new Tab.
This subform contains a tablebox and a TextField where the user can enter a new integer value together with button
Enabled Field No. Field Name Data Type Length Description
Yes 1 ID Integer
Yes 2 ReceptID Integer
Yes 3 Regelnr Integer
Yes 4 ReceptItem Text 50
Yes 5 Hoeveelheid Decimal
Yes 6 Percentage Decimal
Yes 7 ExtraOmschrijving Text 150
Yes 8 ToonAlsVolumeJN Boolean
Yes 9 ToonTussentotaalJN Boolean
The fields in bold are shown in the tablebox.
Now when the user pressess the button, the table data should be changed
so that the Field Hoeveelheid, gets filled up with
[Percentage / (integer value entered by user)] * 100
This is no problem.
The problem is that this new Data for the Hoeveelheid field is temporary
More specific, if the user would go to another tab on the item form and then go back to the tab with this subform.
The tablebox should show the original value of the field 'Hoeveelheid'
How can i achieve this :?:
0
Comments
define a function in your form that will calculate the value then
in your form you can put a textbox control and assign that function as its SourceExpr.
when you enter yout tab you simply need to set to zero the integer value user probably has entered before
The field 'Hoeveelheid' already contains data,
But when you press the button it should show the new calculated data.
But this new calculated data should not be stored
anyway you could write the function i mentioned in my previous post as follows:
function GetTheValue:Decimal
BEGIN
IF (integer value entered by user) = 0 THEN
EXIT(OldOriginalValue)
ELSE
EXIT([Percentage / (integer value entered by user)] * 100)
END;
With this trigger you can interject with what you want shown rather than all/some/etc of the original data. (Without actually modifying the data)
I think you don't understand what Eugene is suggesting, which is exactly what I would suggest as well. Create a function with a Decimal return value, and set that function as the SourceExpr of a textbox. If you want it to only load when a user hits a button then you need to set the textbox's SourceExpr as a global variable, and fill that variable when the button is clicked.
There is not going to be any way that you can have the field in the table as the source of the textbox, and NOT storing any modified data back to the database.
RIS Plus, LLC
Just see the below object
I hope you got the solution ...... :P
Technical Consultant, MS Dynamics NAV
What tompynation I believe wants is the entire list of records with the temporary application of this format rather than just applying this to 1 textbox that contains only 1 value (the selected record's value).