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.

Auto-Enter Portal Data

Featured Replies

Hi there,

I'm using a portal in my database which I wish to automatically populate with some data (roughly the same data is looked at for each record for which the portal exists). This data may be wanted to be deleted or changed by whoever is entering it however.

I do have a value list containing everything I need to be in this portal.

Would the proper way to go about doing this be make a script which, on creation of each record, populates the fields which the portal is drawing from with the auto-enter data?

If so, how would this script work?

Thanks a lot!

Michael

ps

If you need to see my file to understand this better, let me know.

ok. Here's an example, suppose you have a layout with a portal on it. Let's say the layout contains a field for a parent and the portal contains records from a child table, which contains the children of the parent.

for example, in the parent_table, you might have the following fields: PkId - primary id, serial

parent_Name - name of the parent

in the child_table you would have

the following fields:

UID - unique id serial

fkId - foreign key, which is what is related to the pkId.

child_Name - name of the child

i know not very creative, but i'm trying to keep it simple here.

Assuming you have these 2 tables and a layout which contains a field for parent name and a portal which contains , at least, the child_Name from the child_table, you should be able to use this script as an example

let's say you have a button on the layout which will create a new record and pre-fill the portal with some records

# script to add new parent record

# and insert a few pre-fab child records in the portal

#

# insert new record for parent

New Record/Request

# put some data in the parent_name field

Set Field [parent_table:parent_name; "Fred Flintlock"]

# move to the first row in the portal (this works

# even if you do not have a row in the portal yet

Go to Portal Row [select; First]

set Field [child_table:child_name; "Bam-Bam"]

# go to next row in portal

Go to Portal Row [select; Next]

set Field [child_table:child_name; "Pebbles"]

# now go back to parent field

Go to field [parent_table:parent_name]

####

hope that helps,

sincerely

J__

  • Author

Thanks for your response!

My solution turned out to be similar.

Here it is, for reference sake.

Set Variable [$ItemNum; entry layout::Item Number]

Go To Layout [input layout (input layout1)]

Loop

Set Variable [$InputLooper; 1+$InputLooper]

New Record/Request

Set Field [input layout::Item Number; $ItemNum]

Set Field [input layout::Measured Amount; Case ($InputLooper = 1; "First Amount"; $InputLooper = 2; "Second Amount"...)

Exit Loop If [$InputLooper = 10]

End Loop

Go To Layout [entry layout (entry layout1)]

Thank you,

Michael

ah, i see, thanks for sharing.

glad you got it working.

sincerely,

J__

  • 2 months later...

Could you post a sample of this file with example? I am having a similar issue and would really like to see how someone else did this.

James

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.