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.

Featured Replies

I've created the script down below to input record in a table called InvoiceOrder using a return-separated list of code.

The script is looping through the entire list and is creating required records in the InvoiceOrder table. However, there is always a none required empty record which gets added at the end of the table.

I do not know why, could someone tell what I've done wrong with this script?

Best regards!

Daniel

Go to Related Record [From table: “CustomerOrder”;Using layout <Current Layout>]

Set Variable  [ListArray1; Value:Substitute ( TrimAll ( Order1 & " "; 0 ; 0 ) ; " " ; ¶ )] 

Set variable [$InvoiceNo;Value:CustomerOrder::NoInvoice]

Loop

   Loop

       Exit Loop If [ValueCount ($ListArray1) = 0]

       Set Field [invoiceOrder::OrderNo;GetValue ($ListArray1 ;1)]

       Set Field [invoiceOrder::IndexNo;1]

       Set Field [invoiceOrder::OrderStatus;”C”]

       Go to Layout [“InvoiceOrder” (InvoiceOrder) ]

       New Record/Request

       set Variable [$ListArray1;Value:Let(count=ValueCount($ListArray1);RightValues($ListArray1; count-1))]

     End Loop

  Go to Record/Request/Page[Next; Exit after Last]

End Loop

You need to create a record first, then set its fields.

BTW, I don't see why you need two loops here. If you are creating child records, you should first handle a situation where child records already exist - otherwise you will have duplicates. After that, you can:

Set Variable  [ $list; Value: ... ] 

Set Variable [ $invoiceNo; Value:CustomerOrder::NoInvoice ]

#

Go to Layout [ “InvoiceOrder” (InvoiceOrder) ]

Loop

Set Variable  [ $i; Value: $i + 1 ] 

Exit Loop If [ $i > ValueCount ( $list) ]

New Record/Request

Set Field [ InvoiceOrder::InvoiceNo; $invoiceNo ]

Set Field [ InvoiceOrder::OrderNo; GetValue ( $list ; $i ) ]

# SET MORE FIELDS HERE

End Loop

#

Go to Layout [ original layout ]

Create an account or sign in to comment

Important Information

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

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.