Jump 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.

Featured Replies

Hello,

When we share a filemaker project, it’s hard for non FileMaker developers to setup or import custom functions.

Because, they don’t need to know how to do this and they don’t care to learn.

So, I’m facing a problem, I have some custom function, for example Combinevalues (special thanks Jonathan Stark, author – source: http://www.briandunning.com/cf/244)

If ( ( ValueCount ( list1 ) = 0 ) or ( ValueCount ( list2 ) = 0 ) ;

"";

GetValue( list1 ; 1 ) & "=" & GetValue( list2 ; 1 ) & ¶ &

CombineValues (

RightValues ( list1 ; ValueCount ( list1 ) - 1 );

RightValues ( list2 ; ValueCount ( list2 ) - 1 )

) )

Problem: I need to transform this custom function in a script, because I can overpass the first problem (import and learning).

First try: Pick up all values in first list, and past all into a field2

• Set Variable [ $list1; Value:List(table::field) ]

• Set Variable [ $list1c; Value:ValueCount ( List ( table::field ) ) ]

• Set Field [ table::field2; GetValue ( $list1 ; 1 )&"¶" ]

• Loop

• Set Variable [ $total; Value:table::field2 ]

• Set Variable [ $counter; Value:PatternCount ( $total ; "¶" ) +1 ]

• Set Variable [ $total2; Value:$total& GetValue ( $list1 ; $counter ) ]

• Set Variable [ $list1; Value:RightValues ( $list1 ; ValueCount ( $list1 ) ) ]

• Exit Loop If [ $counter = $listc ]

• End Loop

This doesn’t work, I don’t understand why, because all seems work in theory.

After this, in need to join list2. But most be an easy way.

Now the question:

1. There is a way to transform automatically custom functions in scripts?

2. There is any plugin to import automatically custom functions, without intervention?

3. What’s the problem with my script?

Thanks,

FMA11 allows you to import CFs.

CFs, once imported, are resident in the file. Giving someone the file, gives them the CFs. They cannot edit the CFs or add new unless they have FM Advanced.

1. There is a way to transform automatically custom functions in scripts?

No.

2. There is any plugin to import automatically custom functions, without intervention?

If you have the Advanced version, you can import custom functions from the Manage Custom Functions window. Not sure what you mean by "automatically" - the import cannot be scripted.

What is the advantage in transforming the custom function into a script? If you can add a script to a file, can't you also add a custom function?

  • Author

FMA11 allows you to import CFs.

CFs, once imported, are resident in the file. Giving someone the file, gives them the CFs. They cannot edit the CFs or add new unless they have FM Advanced.

I don't know if I understand well, you are telling that main file, for example: file.fp7 have already all custom functions inside, the user don’t need to import those to run the file.fp7.

Custom functions doesn’t work as plugins, isn’t necessary to install, import or do nothing, if you download my file, you will be able to run the file and the custom functions?

Correct?

Thanks for your answer

  • Author

No.

If you have the Advanced version, you can import custom functions from the Manage Custom Functions window. Not sure what you mean by "automatically" - the import cannot be scripted.

What is the advantage in transforming the custom function into a script? If you can add a script to a file, can't you also add a custom function?

In my mind, scripts belong to the main file (deeply inside), because they use FileMaker internal resources (A different user in a different FileMaker can run it without set new parameters, all users have: IF, CASE, etc.). But

Custom functions are external, they use internal resources but we need to import them first to run the main file in a different Filemaker (without that custom functions).

Make sense to me ….

Custom functions are external, they use internal resources but we need to import them first to run the main file in a different Filemaker (without that custom functions).

I am afraid I don't understand the terms you are using. What is "the main file" and what is "a different Filemaker"? A custom function lives in the .fp7 file where it was defined - same as the scripts in that file. No external resources are required to USE the custom function on any system running the Filemaker application.

All FileMaker clients can use custom functions.

However, only FileMaker Advanced can create and edit custom functions.

If you still want to script that function, here is how I'd write it:

Set Variable [ $list1; List( table::field1 ) ]

Set Variable [ $list1c; ValueCount ( $list1 ) ]

Set Variable [ $list2; List( table::field2 ) ]

Loop

 Set Variable [ $counter  ; $counter + 1 ]

 Exit Loop If [ $counter > $listc ]

 Set Variable [ $combined ; GetValue( $list1 ; $counter ) & "=" & GetValue( $list2 ; $counter ) ]

 Set Variable [ $result; List( $result ; $combined ) ]

End Loop



Set Field [ table::result; $result ]

  • Author

Thanks, Fitch

Create an account or sign in to comment

Important Information

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

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.