Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Can we able to create a new records without navigate to particular table [layout].

Means.. Im in employee table(layout), I want to create a new record in department table(layout) "without" navigate to department screen. (without using the goto layout script)

thanks in advance for your time.

Posted

If the two tables are related as: Employees::DepartmentID = Departments::DepartmentID and there is only one department that an employee can belong in, then you can go to your relational graph and open this relationship. At the bottom you would check 'allow creation of related' on the Departments side.

Then back on Employees layout, place the Departments 'department name' field on your layout. When you type the department name into it, and if that employee record has not yet been assigned a DepartmentID, FileMaker will insert the DepartmentID from the newly created department record into your Employees::DepartmentID field.

Two catches ...

1) This is only a descent idea if there is only one field in Departments which requires entry, such as Department Name. Otherwise you will need to be sure that all required fields are available for the User to fill in Department information you would normally require if creating a Department record the normal way. If you have any department fields with validations, be sure they are on the employee layout as well. In the case of multiple Department fields, it is simpler to go to Departments, create record then let the User fill in the fields.

2) You must protect from Users wanting to change the name of the Department for records where a DepartmentID has already been selected. You can attach script trigger to the Department Name field OnObjectEnter to deny them entry if Employees::DepartmentID has a value. There is also potential problem if User does not open the pop-up to check first and instead just types their 'selection' into the Department Name field. You can use hidden tabs or hide the DepartmentName field in invisible portal but it will require some work to plug all potential holes.

I have always required that a User goes to the layout and creates a record properly so validation can fire and be handled, so all required fields are displayed for entry, so that privileges can handle which Users can add new records or change data and also because I only want to 'design' ONE interface layout for new records. If you create the 'departments' fields in tab in employees and you add a field to Departments or change something, you will have to remember to also change them in your 'tab' display.

I have tried using 'allow creation' of a parent twice but removed it out of multiple concerns (and not all listed here).

  • Like 1
Posted

Thank you so much for your detailed description LaRetta.

But i already know this solution, which you have mentioned above.. My question is whether its (without using the Go to layout, also I dont want portal or relationships.) possible or not ?

Hope you can able to understand my friend

Posted

also I dont want portal or relationships.

You cannot create a record in a different table unless you 1) use allow creation and the tables are related or 2) write your selections to variables/globals and use script to go to a table based upon the other layout and create the new record.

Why are you against portals and relationships? They are the absolute power which drives database management!

  • Like 1
Posted

can you create a new window (offscreen) -5000 px from the top goto layout create record set values close window. (not sure if it flashes on windows)

OR

export data to temp file in the temp directory and run a script to IMPORT that file into the target table.

OR

use a SQL plugin and then you can INSERT one or many records directly into any table.

  • Like 1
  • 11 months later...
  • Newbies
Posted

Was this issue resolved? My question is similar to it.

 

I have two tables (Materials and Restrictions) that are "joined" in a many to many relationship through a third table (MatRest_JOIN). The primary table tracks information on organic materials, the second table is a listing of all the possible restrictions a material might have. That middle, joined table which allows the many to many relationship can be understood as...
1. A material can have one or many restrictions
2. A restriction could apply to one or many materials at one time

3. MatRest_JOIN has an ID for it's own records and then for each record has the MaterialID and the RestrictionID

At present, I can select one restriction at a time to be added to the joined MatRest_JOIN table via a portal. However what I'd like to give user's the ability to do is see a list of ALL the restrictions possible, choose via a checkbox beside each of the ones they want and then add all those restrictions in one step to the joined table.

I do have a couple ideas how to accomplish this, such as a loop in the script that looks at each record in the Restrictions table to see if the user checked it....then as it comes across those, it creates a new record in the joined table tying the ID's of the Materials and Restrictions table records, then it continues through the Restrictions list performing the same task until it hits the last record. 

That seems like the way to do it, however it also seems like a might be a big clunky...going step by step through one table (which at most would only ever have like 30 records/restrictions in there) and checking a flag, and creating a new record in the joined table, on and on.

Any thoughts are greatly appreciated...thanks so much!

Joshua

  • 2 years later...
Posted

can you create a new window (offscreen) -5000 px from the top goto layout create record set values close window. (not sure if it flashes on windows)

 

 

OR

 

export data to temp file in the temp directory and run a script to IMPORT that file into the target table.

 

 

OR

 

use a SQL plugin and then you can INSERT one or many records directly into any table.

Thanks for this...  the -5000px worked great. 

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