Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How to get field contents when using the field as button?


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

Recommended Posts

Posted

Hi!

 

This is a stupid problem but I just cannot figure out how it works.

 

I've created a small calendar where each day is shown in it own field. Each month the contents of the fields are calculated and placed to correct field so that if the first day of the month is Monday, it is placed to the first field. If the first day of month is wednesday, it is placed to third field etc. (please see the picture). Each of these boxes are named objects.

 

Then I defined each "box" as a button which starts a script and copy the date in the field to a variable $date (Set Variable [$date; Value:Get (ActiveFieldContents]).

But for some reason I get nothing out of it. 

 

 

What I do wrong?

 

Kind regards,

R2D2

post-60806-0-79141700-1407139389_thumb.p

Posted

What I do wrong?

 

If you define the field as a button, this automatically preclude field access – so there is no active field from which to read the contents. A workaround is to allow field entry and fire the script with an OnObjectEnter trigger; read the contents, then commit the record.

 

I've created a small calendar where each day is shown in it own field.

 

I suggest you use a repeating field for this, thus eliminating an overhead of 41 fields with one fell swoop; also, if you'd define the field as a calculation and use Get ( CalculationRepetitionNumber ), each repetition could calculate its own date.

Posted

Hi !

 

Thank you for a quick reply! I actually worked around this problem by using an individual ScriptParameter with each of those buttons. As far as I know the Script Triggers don't work when you access the database via web browser and that's why I try to avoid them.

Posted

Oh, yes I know there is a built-in calendar, but it is so small and I need a bigger calendar. I try to make a solution which manages working shifts and builds duty roster. Every employee has days when they want to be on duty and when definitely not. It is always a huge task to make next months duty roster when you have abt 100 employees and 5 positions which have to be manned 24/7. And at the same time respect employee's wishes.

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