Jump to content

Overriding calculated values


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

Recommended Posts

I have 3 fields:

 

START DATE — user selects date from calendar

RUN — user enters number of days over which activity will occur

END DATE — Calculation based on first two fields.

 

This works fine BUT we want the user to have the option of entering the END DATE directly and have the RUN calculated.

 

I changed both RUN and END DATE to Calculated Values but with no luck: changing RUN still changes END DATE (which is good) but when END DATE is changed, RUN doesn't change and END DATE consequently reverts to original value.

 

 

 

 

Link to comment
Share on other sites

This is not making sense to me. A calculation field is not modifiable by user input. Perhaps you're speaking of the fields being auto enter by calculation with allow user override enabled.

Link to comment
Share on other sites

Make EndDate auto-enter a calculated value, replacing existing value =

Case ( Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) = GetFieldName ( Self ) ; Self ; StartDate + Duration )

Make Duration auto-enter a calculated value, replacing existing value =

Case ( Get ( ActiveFieldTableName ) & "::" & Get ( ActiveFieldName ) = GetFieldName ( Self ) ; Self ; EndDate - StartDate )

Alternatively, this could be solved by script triggers.

  • Like 3
Link to comment
Share on other sites

Where do you come up with this stuff?   :laugh2:

 

I've had it all along and it was published before, and not just by me. IIUC, you should find something very similar if you search for Celsius and Fahrenheit. I modernized this when GetFieldName() became available; before that you had to hard-code the field's name in the calculation and it would break if the field was renamed.

Link to comment
Share on other sites

This topic is 3340 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.