Jump to content

This topic is 8578 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Is it possible in any way to modify the value of a calculation field?

I'm trying to make the default value of my Labor Cost field the following:

Labor Cost(calculation, number) = Sum (Labor Line Items). This works fine, but I want Labor Cost field then be modifiable so it can be changed on my Invoice (which is another layout). I can't use an auto-enter field with a calculated value for Labor Cost because the Labor Line Item fields are based on some radio buttons and rate fields that aren't known when the record is created. Are there any known workarounds for doing this kind of thing? Thanks

Posted

You could use a scripted button using the Set Field function. When the user clicks the button, the Labor Cost field would be set to = Sum (Labor Line Items) i.e. the value at the time of the click. I have used this technique for an invoice total where the actual total on the invoice may not agree with the total that my database claculates due to some suppliers rounding up and others rounding down.

Posted

You can't modify a calculation, per se, but you can generate that effect. Create the following fields:

Labor Cost Entry (number)

Labor Cost (calculation, number) =

If(notIsEmpty(Labor Cost Entry), Labor Cost Entry, Sum(Labor Line Items))

For the effect on the layout, make the two fields the same size. Make sure Labor Cost is opaque. Stack Labor Cost directly on top of Labor Cost Entry. Uncheck the "Allow entry" box in the Format Menu --> Field Format dialog. This make the Labor Cost field "unselectable" (it already can't be modified). When you click on the Labor Cost field, the Labor Cost Entry field underneath it is selected. When you click out of Labor Cost Entry, the calculated result Labor Cost reflects the value you entered.

-bd

This topic is 8578 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.