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.

Display existing, or create new

Featured Replies

I need to know how to write a script that will copy a part number and a QC ID number from the current table, go to another related table and perform a find in both fields, and then either:

a - Display the existing found record as a QC Form, or

b - If "No records match this set of find requests", create a new record with that part number and QC ID number and display the QC form.

So basically, I'd like to click the button and see the QC form whether it's a NEW QC form or an already EXISTING form.

How do I script that?

Thanks!

If you want to do a scripted find you can take a look at this thread, but in your case I would suggest just creating a relationship keyed on part number and QC ID. Then using a Go to Related Record go to the QC Form layout that you want.

The script that runs it should be much shorter.

If [is Empty [PartNumQCIDRelationhipName::QCID] ]

Set Field [ globalTempPartNumber; PartNum ]

Set Field [ globalTempQCID; QCID ]

Go to Layout [ QC Form ]

Set Field [ QCForm_PartNum; globalTempPartNumber ]

Set Field [ QCForm_QCID; globalTempQCID ]

Commit Record []

Else

Go to Related Record [using Layout QC Form ]

End If

  • 2 weeks later...
  • Author

Thanks for your help Mr Vodka.

I don't understand what globalTempPartNumber means though.




// If there are no related records

If [ Is Empty [PartNumQCIDRelationhipName::QCID] ]

  // Temp storage of PartNum and QCID

  Set Field [ globalTempPartNumber; PartNum ]

  Set Field [ globalTempQCID; QCID ]

  // Adds the new record

  Go to Layout [ QC Form ]

  New Record/Request

  Set Field [ QCForm_PartNum; globalTempPartNumber ]

  Set Field [ QCForm_QCID; globalTempQCID ]

Commit Record []

// If there are related records

Else

Go to Related Record [using Layout QC Form ]

End If



I made some comments so its easier for you to follow. While checking my last post, I noticed that I missed the new record step. Sorry happens sometimes when typing off top of the head.

  • Author

Thanks!

That really helped!

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.