Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

"Allow Creation" vs. record creation via a script?


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

Recommended Posts

Posted

Hi there!

This may seem like a totally obvious question, but I've read the internet, and it says that "Allow Creation..." is for use, basically, only with portals.

But what if the related table, where you want to make a new record, is not one with any fields on the layout? Can you use the relationship to create new records via a script, or is that just another one of those "don't try that, it's stupid" kinda things? I'm thinking it <is>.

Is there no way to use the "Allow Creation..." trick to create records via a script? I mean, other than having the script "Set Field" (or "Set Field By Name") in a portal?

( I know you can do it without a portal, and that it's, basically, pointless. If you're going to have those fields on the layout, go ahead and put 'em in a portal. No problem. Works. )

So let's say I want to be able to create a new, related record via a script. The two choices are:

a) make the portal you need and use it to create records by using "Set Field", or

use "New Record/Request" to create the record, and then use variables to paste in the match field data.

Is that correct?

Thanks so much!

Posted

You have it worked out. Ue a script if you need to create a related record where there are fields not showing in the portal.

"Allow creation" permits record creation in a portal without using a script.

Posted

Ue a script if you need to create a related record where there are fields not showing in the portal.

Not having fields showing in the portal is not an obstacle to creating related records through a relationship; for example, you can do:

Go to Portal Row [ Last ]

Set Field [ Child::HiddenField ; <anything> ]

...

Whether it's a good idea is another matter.

So let's say I want to be able to create a new, related record via a script. The two choices are:

a) make the portal you need and use it to create records by using "Set Field", or

use "New Record/Request" to create the record, and then use variables to paste in the match field data.

Is that correct?

Not entirely. There are several methods to script the creation of related records through a relationship (not necessarily through a portal). However, since script variables were introduced in version 8, you will find it hard to justify using any of these methods - as opposed to going to a layout of the child table and creating a new record there.

Posted

Thanks so much, both of you. This is very helpful.

Whether it's a good idea is another matter.

I don't know whether that statement is meant to be ironic, but if I could ask, without sounding like a total idiot, is it always a not(good) idea, or only sometimes?

I guess I really don't care though - by which I mean: my goal is not to learn every intricacy at this point, but to learn the basic best practices at my level. It appears that I've found the best practices for a newbie here, but part of being a newbie is that you may not recognise the good stuff when you see it (or write it). So, thank you both, again, for your help. :)

Sincerely,

tzf

Posted

is it always a not(good) idea, or only sometimes?

It might be a good idea if - for example - the purpose of the script is to assist the user during data entry. But when your purpose is to create/modify data, it's best to work entirely at the data level and not to rely on the existence of any layout element. Ideally, your script should still work even if all the layouts in the file are completely empty.

  • Like 1

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