Basic Math

How can I set a expression to take a currency value that is currently in the Entity and then add in the intrest rate of 25%. I currently have it set it up like this:
GetPawn().Pawn.PawnAmount + (GetPawn().Pawn.PawnAmount * .25)

I am having an issue of getting this to work right. Thanks for any help that you can provide.

Just a note, I am getting an issue at the end where I have * .25). It shows the error Expeting an expression instead of '.'. .
Again thanks for any help

I think you forgot to put the ID of the Paw you are triyng to get.
Like this:  GetPawn( PawnId ).Pawn.PawnAmount + (GetPawn( PawnId ).Pawn.PawnAmount * .25)

Also, i dont think this is a problem but instead of .25 try with 0.25

I have changed it to this:
GetPawn(Ticket).Pawn.PawnAmount + (GetPawn(Ticket).Pawn.PawnAmount * 0.25)

On my second Ticket I still get an error of unkonwn object in expression. Ticket is my ID for this entity.
Thanks for any help.
I think the problem is that you are trying to access a Ticket that does not exists, do a debug session and check if the PawnId is set and if it realy exists on the database.

Also, i would advice you to do a function and do this calculations there, istead of doing it "inline"
Hi Michael,

That last expression looks ok. Could you attach the oml or a sample with the problem?

On a side note, using 2 Get's will make two queries to the database. It's more efficient if you could do the get only once and then reuse the value.

João Rosado
Have you tried

GetPawn(Ticket).Pawn.PawnAmount * 1.25

which will return the vaule you are seeking.
GetPawn(Ticket).Pawn.PawnAmount * 1.25 wouldnt give me the needed value. I have attached the .oml I am working in.
Hi Michael

This is what you want:
.List.Current.Pawn.PawnAmount * 1.25

Your query already had the values for the pawn no need to get it again.

Anyway the problem of your expression, if you really needed to do something like that was that the Ticket should have been written as PawnTable.List.Current.Pawn.Ticket
But doing an expression like you had (and even worse when it had 2 gets) for each line of the table would kill completly the performance of your application.

João Rosado
Sorry Mark, you were right. I must made an error when I first tried that calculation but it did in fact work and give me the value I was looking for.

By the way, just so you known, in the first expression:
GetPawn().Pawn.PawnAmount + (GetPawn().Pawn.PawnAmount * .25) 
the error Expeting an expression instead of '.'.  is really because of the .25 since writing decimals without the integral part isn't supported.
However, doing it like João Rosado sugested is really the best approach.

Best Regards,