cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry - Calculate Button

Former Member
0 Kudos

I have a transaction screen that needs a calculate button.  The calculate button will multiply two fields that are displayed on the screen and put the result in another field that is also displayed on the screen.  This needs to be done as the user is filling out the form, not before or after form entry.  What is the best way to do this in Agentry?

Tags edited by: Michael Appleby

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You do this by an Update rule on the screen field you want updated. 

In your update rule:

- PROD

- - Screenfield1

- - Screenfield2

Former Member
0 Kudos

Thanks Stephen!  I'm still fairly new to Agentry so I didn't understand the usage scenarios for update rules.

Answers (1)

Answers (1)

jason_latko
Active Contributor
0 Kudos

Christopher,

Like Steve mentioned, update rule is the way to go.  It will recalculate every time data entry is done on the screen.  You cannot put buttons on transaction screens.

Jason Latko - Senior Product Developer at SAP

Former Member
0 Kudos

An update rule is definitely the way to go. I'm having some issues getting it to work though.  I tried using the properties of the transaction to do the calculation but I quickly determined that the transaction object did not update on the fly based on the data I'm entering in the form.  I then tried to use the displayed value of the field in the current screen.  It let me select the property but it did not apply the property to the rule.

Here is the scenario I'm facing.  I want Field3 to always display the product of the Field1 displayed value and the Field2 displayed value.  If I select the transaction properties that are bound to Field1 and Field2 then it never works because it's always using the initial value of the properties.  If I try and select the displayed values for Field1 and Field2 then it doesn't let me select them.  Any ideas on how I can fix this?

Former Member
0 Kudos

The values are not saved into the transaction fields until the screen is done. 

You will need to point to the fields on the screen, I have a working version of what you are asking here is a screenshot of it:

Former Member
0 Kudos

I was able to get it to work.  There's some weird issue with the Agentry editor where I had to select a transaction property first then use "replace with" to actually select the field on the screen.

jason_latko
Active Contributor
0 Kudos

Christopher,

An alternative way to grab the current screen's field values is to use the SCREENFIELDVALUE property function and type the screen field name as a constant parameter to the function:

SCREENFIELDVALUE

     Quantity (This is a typed constant)

This allows you to write more generic rules that can be re-used on multiple screens that both have a Quantity field without having to hard-code the screen names.

Jason Latko - Senior Product Developer at SAP