Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Script to mark all as checked


Document Geek
 Share

Recommended Posts

Hello,

 

I am a new filemaker user. I am trying to write a script to Mark all items checked. Ny table name is "writer_HISTORY" and the field name is "Sent."

 

writer_HISTORY::Sent

 

Can any of you assist me on how to create the script to mark with a check all the "Sent" field checkboxes?

 

Many thanks!

Link to comment
Share on other sites

something like this

 

set field [ writer_HISTORY::sent ; ValuelistItems ( get ( filename ) ; "thevaluelist" ) ]
# refresh if related data need to be updated after this
refresh window [ flush joined results ]

Link to comment
Share on other sites

Hi Maarten,

 

Thanks, but that didn't work for me. Am I supposed to swap out the text in quotes with something else?

 

Can you recommend a good resource for an intro to FM scripting? I am a brand new user.

Link to comment
Share on other sites

So I am still struggling with this. I have tried a couple of different variations (based on digging in a couple of forums). Neither one of them has any result. Can you tell me what I am doing wrong? Thank you!

 

Variation #1

 

Set Field [ writer_HISTORY::Sent ;

If ( IsEmpty ( writer_HISTORY::Sent ) ; ValueListItems ( Get ( FileName ) ; "Sent" ) ; "" )

refresh if related data need to be updated after this

refresh window [ flush joined results ]

 

Variation #2

 

Set Field [ writer_HISTORY::Sent ;

ValueListItems ( Get ( FileName ) ; "Sent" )

refresh if related data need to be updated after this

refresh window [ flush joined results ]

 

 

I also want to make sure that this script will only affect the current record.

Link to comment
Share on other sites

Pick this demo apart and see if it helps

 

Set Field [ writer_HISTORY::Sent ;

If ( IsEmpty ( writer_HISTORY::Sent ) ; ValueListItems ( Get ( FileName ) ; "Sent" ) ; "" )

 

That will clear the field if it's not empty. I doubt that is what you want to do.

checkall.fmp12.zip

Link to comment
Share on other sites

  • 2 weeks later...

That is great and very informative. But I just want it to check the ones that aren't already checked. I don't want it to uncheck the ones that are already checked.

Link to comment
Share on other sites

Hi Maarte,

 

I got it to work in the sample file you gave me, but when I use that same code in my main database file, the boxes don't check. Any idea why this could be so?

Link to comment
Share on other sites

Not without seeing what you changed or how you applied it to your own application. So you need to post the script for instance, not mine but how you changed it.

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use