Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

field name as script parm

Featured Replies

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.

Could you post a simple file showing this?

You can turn off the Frames.

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

  • Author

hi, please find attached a demo.

- sorry don't know how to remove a demo file. the lower one is the correct one.

Checkbox.zip

Checkbox.zip

Edited by Guest

  • Author

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.

The scripts seem to be working in the attached file.

---

BTW, I am puzzled why don't you use Set Field By Name[], seeing that you are using v.10.

  • Author

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.

  • Author

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

yes, it works, but only because i used the field name as a literal.

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

BTW, I would do it this way:

Toggle10.fp7.zip

  • Author

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

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

  • Author

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!

Would it be easier to understand if I wrote:

If [ Get ( ActiveFieldContents ) > 0 ]

Set Field [""]

Else

Set Field [1]

End If

  • Author

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 :)-)

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.

  • Author

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.

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.

  • Author

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?

  • Author

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

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.

  • Author

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.

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.

  • Author

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!

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.

  • Author

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.

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.

  • Author

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!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.