how to input a new record from the portal?
good morning, what is the method to write new record from a portal??
Perhaps you mean add a new record TO the portal?
A portal requires a relationship linking your layout's table occurrence to the portal's table occurrence. Table occurrences are the "boxes" found in Manage | Database | Relationship. The table occurrence for your layout is selected in "show records from" in layout setup. The occurrence for your portal is found in "Show Related Records From" in Portal Setup...
You most likely will have a relationship like this, but with different names:
LayoutTableOccurrence::PrimaryKey = PortalTableOccurrence::ForeignKey
If you double click the line connecting the two occurrences, you open a dialog where you can select "Allow creation of records via this relationship" for the Portal table occurrence. With this option selected, you should be able to type data directly into a blank row of the portal and FileMaker will create the related record for you.
You can also add a button to your layout that adds a new record to the portal's table when clicked. This is often a useful way to set things up if you will have a lot of records in your portal as it avoids having to scroll the portal to the end in order to find the blank row for entering data for a new record.
Freeze WindowSet Variable [$PrimaryKey ; value: LayoutTableOccurrence::PrimaryKey ]Go to Layout [Layout based on portal table]New Record/RequestSet Field [PortalTableOccurrence::ForeignKey ; $PrimaryKey ]Go to Layout [Original Layout ]
I have placed the New Record Button TO the Portal in my solution. The Portal will have many records. I have these questions/problems:
1. I would like to have the new record requested row come up to the top of the portal for ease of entry and see to the row.
2. When I select the button I see two empty rows and would prefer seeing only one.
3. Also should the cursor be seen in the first empty cell?
I am using your suggested script below to make the button work.
Set Variable [$PrimaryKey ; value: LayoutTableOccurrence::PrimaryKey ]
Go to Layout [Layout based on portal table]
Set Field [PortalTableOccurrence::ForeignKey ; $PrimaryKey ]
Go to Layout [Original Layout ]
I have included a jpg of my script.
what should I add to this to accomplish the items above?
Retrieving data ...