# FileMaker Custom Function versioning

**URL:** <https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145>\
**Category:** Lounge (Discussions)\
**Created:** [May 18, 2021, 4:14pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145 "2021-05-18T16:14:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonywhitelive](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/tonywhitelive/32/208_2.png) [@tonywhitelive](https://the.fmsoup.org/u/tonywhitelive)\
**Post date:** [May 18, 2021, 4:14pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/1 "2021-05-18T16:14:25Z")

</div>

Let say that you build a FileMaker Custom Function (deploying to different files at different times) and later want to either:

- Fix a bug
- Extend its functionality

Either would create a different version of the Custom Function (CF) and you would want to make the version string as visible as possible to your eyes and tools.

What is the best way to implement Custom Functions versions?

[-] Renaming a Custom Function has the downside of making your code less portable. If you copy and paste a script (that uses a CF) into a file where the custom function has a different name it will break

[+] A better way might be to use an extra Custom Functions parameter to store the version and any other text that might be useful when deploy a custom function into your code.

For example a Custom Function signature like...

`convertFromFileMakerPath.pre19 ( a_path ; a_format ; v1~PosixPath~WinPath~URLPath )`

…becomes

`convertFromFileMakerPath.pre19 ( "file:/" & $filePath ; "PosixPath" ; "v1” )`

Tested as working and useful when programming in English.

Thoughts?

---

<div class="post-metadata">

**Author:** ![Bobino](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bobino/32/194_2.png) [@Bobino](https://the.fmsoup.org/u/Bobino)\
**Post date:** [May 18, 2021, 4:41pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/2 "2021-05-18T16:41:38Z")

</div>

Can you share some other examples but about the changes introduced?

If a developer introduces a "breaking change" to a custom function, I think the original function should not be altered, rather creating a new function could be a better choice.

If the changes introduced are not "breaking" by nature, then I'm not sure why the versioning needs to be visible outside the custom function code itself.

Can you elaborate on that?

---

<div class="post-metadata">

**Author:** ![Bobino](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bobino/32/194_2.png) [@Bobino](https://the.fmsoup.org/u/Bobino)\
**Post date:** [May 18, 2021, 4:42pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/3 "2021-05-18T16:42:55Z")

</div>

I guess a follow-up question is if someone would embed versioning into a script name?

---

<div class="post-metadata">

**Author:** ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)\
**Post date:** [May 18, 2021, 6:52pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/4 "2021-05-18T18:52:49Z")

</div>

I see no need to embed versioning in custom function (CF) names or parameters. I can't see how it serves users of the CFs. As @Bobino says, a new CF makes more sense where a change is implemented that either changes a parameter or the result. This has the merit of maintaining backwards compatibility.

As for CF maintenance… comments in the CF code seem more appropriate. You could improve tool visibility by creating a search ID, the concatenation of CF name and version (removing problematic characters along the way). That's as far as I would go.

---

<div class="post-metadata">

**Author:** ![mipiano](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/mipiano/32/1074_2.png) [@mipiano](https://the.fmsoup.org/u/mipiano)\
**Post date:** [May 18, 2021, 7:23pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/5 "2021-05-18T19:23:40Z")

</div>

Normally I do not show version numbers in a CF name. But recently I recreated an older CF that was used in conjunction with the cf CustomList by Anges Barough. In the new version I used the while function instead of CustomList.

In this case I added a "\_v2" to the name of the new function. The new function cannot be used with FMP clients pre 17. So both CFs have their place to be.

---

<div class="post-metadata">

**Author:** ![tonywhitelive](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/tonywhitelive/32/208_2.png) [@tonywhitelive](https://the.fmsoup.org/u/tonywhitelive)\
**Post date:** [May 18, 2021, 7:26pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/6 "2021-05-18T19:26:05Z")

</div>

> [@Bobino](#):
>
> Can you share some other examples but about the changes introduced?

For the Custom Function...

`convertFromFileMakerPath.pre19 ( a_path ; a_format ; v1~PosixPath~WinPath~URLPath )`

...imagine that you implemented "PosixPath" and "WinPath" but not "URLPath" in v1, and then later added "URLPath".

That would be a non-breaking change to extend functionality.

---

<div class="post-metadata">

**Author:** ![mipiano](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/mipiano/32/1074_2.png) [@mipiano](https://the.fmsoup.org/u/mipiano)\
**Post date:** [May 18, 2021, 7:32pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/7 "2021-05-18T19:32:03Z")

</div>

Do I understand this correctly? You write the third parameter only for information? It has no other function? I would do it like this - if I have understood your example correctly:

> convertFromFileMakerPath.pre19 ( a\_path ; a\_format\_Posix~Win~URL )

Would that not be sufficient? Or did I misunderstand something? It is not important to know that the function was extended. But it is important to know what type of information it accepts.

[Edit:] I find a functionless parameter only for info purposes rather confusing for other developers that get the cf from e. g. [briandunning.com](http://briandunning.com) or other sources.

---

<div class="post-metadata">

**Author:** ![Keywords](https://avatars.discourse-cdn.com/v4/letter/k/7bcc69/32.png) [@Keywords](https://the.fmsoup.org/u/Keywords)\
**Post date:** [May 19, 2021, 8:13am UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/8 "2021-05-19T08:13:29Z")

</div>

Personally, I keep versions information, along with descriptive information, as Comment lines at the head of the function itself. This way the function name stays the same, thus not breaking if redeployed as a newer version, but you can also see in the function content which version is actually in use.

---

<div class="post-metadata">

**Author:** ![Torsten](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/torsten/32/1574_2.png) [@Torsten](https://the.fmsoup.org/u/Torsten)\
**Post date:** [May 19, 2021, 9:56am UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/9 "2021-05-19T09:56:10Z")

</div>

In order to avoid any interference with functional elements of the CF, I would only put version information in a comment line within the CF.

---

<div class="post-metadata">

**Author:** ![FileKraft](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/filekraft/32/1183_2.png) [@FileKraft](https://the.fmsoup.org/u/FileKraft)\
**Post date:** [May 20, 2021, 5:15pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/10 "2021-05-20T17:15:59Z")

</div>

> [@mipiano](#):
>
> In the new version I used the while function instead of CustomList.
> 
> In this case I added a "\_v2" to the name of the new function. The new function cannot be used with FMP clients pre 17

you mean pre-18 or \<18 or ≤17 //while was introduced in fm18

---

<div class="post-metadata">

**Author:** ![mipiano](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/mipiano/32/1074_2.png) [@mipiano](https://the.fmsoup.org/u/mipiano)\
**Post date:** [May 20, 2021, 5:19pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-versioning/2145/11 "2021-05-20T17:19:07Z")

</div>

@FileKraft Thank you for your advice. I would have been better off not relying on my memory.
