Skip 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.

Creating multiple records in a portal

Featured Replies

I need script advice. I am creating an expense report database. Part of my layout includes the following information –

Start date

End date

Number of Days (calculating end date - start date)

Per Diem Rate

City

Each days per diem needs to be itemized so I need to create a record in a portal for each day that includes the date, rate & city.

Any ideas?

Thanks in advance!

Each days per diem needs to be itemized

Are you sure you need this? All it does is duplicate existing data and create room for possible discrepancy.

BTW, shouldn't it be end date - start date + 1?

  • Author

Yes, each day needs it's own per diem entry (bookkeepers orders), only the date is different.

I forgot to mention the +1 but it's in the calculation. :)

Any thoughts on how to accomplish this? I'm stuck.

  • Author

Problem solved. I couldn't figure out how to loop the script so I just created a maximum # of days possible & created a really long script full of Set Field steps.

Sorry, I missed your earlier reply. So how about:

Set Variable [ $parentID ; Parent::ParentID ]

Set Variable [ $start ; Parent::Start Date ]

Set Variable [ $n ; Parent::Number of Days ]

Set Variable [ $rate ; Parent::Per Diem Rate ]

# DELETE RELATED RECORDS, IF PREVIOUSLY CREATED

If [ not IsEmpty ( Child::ParentID ) ]

Go to Related Record [ Child ; Show related only ]

Delete All Records

Else

Go to Layout [ Child ]

End If

Loop

Exit Loop If [ not $n ]

New Record

Set Field [ Child::ParentID ; $parentID ]

Set Field [ Child::Date ; $start ]

Set Field [ Child::Rate ; $rate ]

Set Variable [ $start ; $start + 1 ]

Set Variable [ $n ; $n - 1 ]

End Loop

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.