Announcements
No record found.
.
*This post is locked for comments
Hi
Couple of comments and questions
- use 'public display' and not 'display public'
- is number3 a field on the table?
If so, you need a method or process that updates number3 with this.number3 = this.number1 - this.number2;
if number3 is not a table field, then your method is generally correct. Are you getting a compile error or a run time error? WHat is the error?
Thanks
Hi dude, number3 field is my customized field which I just added inside the table. I want it make some calculation but still couldnt get value
and also im using the method to do but still couldnt get the value.No error actually just Im still cant get the value.
Can you post some of the code you're trying to use? The method you've got here is a display method, which displays existing data; it isn't used to set data.
You need code somewhere that looks something like:
AAA myTable; ttsbegin; select firstonly forupdate myTable where myTable.Field1 == 'blah'; mytable.Numner3 = myTable.Muner1 - myTable.number2; myTable.update(); ttscommit;
OR
AAA myTable; myTable.initValue(); myTable.Numer1 = 1; myTable.Numner2 = 2; myTable.Number3 = myTable.Number1 - myTable.Number2; myTable.insert();
Or if you want to use a method, you could do it like this:
public void updateNumber3() { this.number3 = this.number1 - this.number2; } AAA myTable; select firstonly forupdate myTable; ttsbegin; myTable.updateNumber3(); myTable.update(); ttscommit;
Of course, depending on your requirements, you could move the ttsbegin/ttscommit and update() call into the method.
All depends on your requirement
actually it isnt a existing data. Just i use display is to show on the table. in the number3 field is empty. no existing data.
number3 is added by myself
number1 (is display with existing data) - number2 (is display with existing data) = number3 (non display without existing data customized by myself)
What did you find when debugging your code before giving up and asking here? Is your display method called at all? The code look fine to me, therefore I suspect you're not using the display method correctly.
Im doing wrong there. number3 field isnt a display method but I wrote display method. its actually
There is a display method in your very first post (methodName1()) and you said "in the method I did something but couldn't work at all". If you mean that the method work flawlessly, but you don't know how to assign the return value to a field, you should have said that.
The answer is simple: myTable.Number3 = myTable.methodName1().
By the way, what's the point of saving such an easily calculated value to a field? It sounds like a wrong design, unless you have a good reason for that.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CP04-islander 16
GiacomoRovai 4
Douglas Noel 2