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

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

Recommended Posts

Posted

top of the year to everyone!

i have formatted my checkboxes as a button so that the cursor does not visibly enter the field. each time i click on the box, the status is supposed to toggle just as it normally does (with its ugly framed look i want to avoid).

i pass the field name or object name as a script parameter to enter the correct field. with the debugger i can see that the correct field is entered, but when the script gets to the "Set Field" part (the actual field name is not specified, only the value), nothing happens. why is that and how can i get around it? btw, the same field formatted as an edit box works.

Posted

You can turn off the Frames.

Layout Mode>> Layout >> Layout Setup >> (deselect) Show field frames when record is active.

Posted

hmmm... that does not work, because while the frame is not visible when you're on another field, it is still visible when you enter the field with the check box or radio button.

Posted

yes, it works, but only because i used the field name as a literal. i want to parse the field name as a script parm so i can reuse the script for similar uses.

Posted

ooh, i never found set field by name. i think that may be the ticket. let me try. i'll come back.

Posted

But how can we see why it doesn't work, when it does?

that's a good point. i uploaded a 'fixed' i.e. broken version.

BTW, I would do it this way:

how nice! how come the webdings always display a check, no matter what value is displayed. is that a safe x-platform option? don't know if windows have them too.

Checkbox_03.zip

Posted

how come the webdings always display a check, no matter what value is displayed.

Format > Number… > Format as Boolean.

is that a safe x-platform option?

I believe so.

i uploaded a 'fixed' i.e. broken version.

Here's a 'broken' i.e. fixed one:

Checkbox.fp7.zip

Posted

ah yes, i forgot about that. great!

thanks for 'breaking' it. god, i hate it when i don't fully understand such a deceptively simple one-liner. but i've been through phases like this many times. eventually i'll get it!

thanks so much for your help!

Posted

Would it be easier to understand if I wrote:

If [ Get ( ActiveFieldContents ) > 0 ]

Set Field [""]

Else

Set Field [1]

End If

ah yes, that's more like my level of programming! this approach is actually what i've been poking around with all the time. i was able to shorten the if/then with this:

SetField (not datafield)

thanks again! i hope to step up to the more elegant way in 2010 :)-)

Posted

Well, since you're going to set the field anyway, then obviously the If comes too soon and makes the script unnecessarily verbose. There's enough time to make the decision when setting the field - by calculation.

The difference between:

not Field

and:

Choose ( Field ; 1 )

is that the former toggles between 0 and 1, while the latter toggles between 1 and empty.

Posted

the former toggles between 0 and 1, while the latter toggles between 1 and empty.

which is even better because it's more in line of what a check box does, i.e. putting nothing in the field rather something else.

Posted

Sometimes it's better, and sometimes I'll have the field auto-enter 0 when the checkbox is deselected - because you cannot base a relationship on an empty field.

Posted

one more thing, then i believe i'm done with this. when clicking on the check box, can i trap the actual field name and pass that as a script parameter? or do i need to give object names to all the check box fields?

Posted

in my case, this does not matter, but good to keep in mind anyway. avoids a new topic down the line!

Posted

when clicking on the check box, can i trap the actual field name and pass that as a script parameter? or do i need to give object names to all the check box fields?

I am not sure which of the two methods you are referring to. In any case, if the field is a button it does not become active by clicking on it - so you cannot "trap" it. But you can place the actual field name in the parameter without going through object.

Posted

stefangs Said: when clicking on the check box, can i trap the actual field name and pass that as a script parameter? or do i need to give object names to all the check box fields?

I am not sure which of the two methods you are referring to. In any case, if the field is a button it does not become active by clicking on it - so you cannot "trap" it. But you can place the actual field name in the parameter without going through object.

sorry - i can't read our last few posts anymore. the list always cuts off. i did get them via email though.

anyway, i tried using the field name (which brings us back to the original title of the topic), but i can't say Go To Field using a script paramater and saying

Set Field By Name (Get (ScriptParameter)), 1)

doesn't work for some reason.

Posted

i can't say Go To Field using a script paramater

Yes, that's true - that's why I suggested using Set Field by Name[], which doesn't require activating the field at all.

Set Field By Name (Get (ScriptParameter)), 1)

doesn't work for some reason.

It works in my (first) file, does it not? Make sure the script parameter is the field's name, not the object name.

Posted

Quote: i can't say Go To Field using a script paramater

Yes, that's true - that's why I suggested using Set Field by Name[], which doesn't require activating the field at all.

Quote: Set Field By Name (Get (ScriptParameter)), 1)

doesn't work for some reason.

It works in my (first) file, does it not? Make sure the script parameter is the field's name, not the object name.

sorry to keep replying to the wrong entry, but i still can't see the last few replies.

so yes, it does work now. i went back to your file and saw that you put "GetFieldName ( Tablename::Fieldname )". i just put the fieldname and i guess that's not good enough.

so looks like i'm all set now. i also get the 'one-liner' now from your first post. thanks for all the input!

Posted

just put the fieldname and i guess that's not good enough.

It would have been good enough if you had included the table name. But it would break if the field were renamed.

Posted

It would have been good enough if you had included the table name. But it would break if the field were renamed.

actually, this didn't work. when i revoved the GetFieldName from the script parameter, but left the table name, it didn't work. but no problem, i'll just include GetFieldName. renaming would break it of course, but no more than renaming the object. i think with the field name it's a little more intuitive and saves me from assinging object names on top.

Posted

I am not sure I follow your description, so let me clarify: the script parameter can be either =

"Table::Atribute"

or =

GetFieldName ( Table::Atribute )

Both return the same result - but the GetFieldName() variant will keep working if the field is renamed.

Posted

I am not sure I follow your description, so let me clarify: the script parameter can be either =

"Table::Atribute"

or =

GetFieldName ( Table::Atribute )

Both return the same result - but the GetFieldName() variant will keep working if the field is renamed.

you're right - i didn't have quotes around the first option and so it didn't work. now it does. thanks!

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