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

Hi Gurus!

I spent today figuring how to get a picker window locked down. It is our product picker window, and now the user must select a button on it to do something or they can't close the window. Fine and dandy with selecting a product because we have already specified the find request for the customer products.

Now, I'm trying to implement the same thing in the quote contact picker. Before, the user could only select one contact at a time to add to the project contacts table. I wanted to give them the ability to add multiple contacts at a time. The rub with this is we rely on the user to do a find for the contact or customer name first to narrow down the results. Of course now I can't do a find when I pause the script indefinitely, locking it down so that they make a decision.

Not sure of an elegant way to script this. Don't really want to have 2 separate popup windows; one to do the find, and then the other to display the results of the find and that lets the user select the individual contacts to add to the quote.

How have you folks handled this scenario?

Here are my scripts in relation to the contact picker:

Button Script Parameter for script directly below is "Add Contact".

Go Customer Search from Quotes

Allow User Abort [ Off ]

Set Error Capture [ On ]

# Set Variable [ $$ProjectID; Value:Quote::_kf_ProjectID ]

#

Freeze Window

#

New Window [ Name: Get (ScriptParameter);Height: 600; Width: 700; Top: 100; Left: 100 ]

Go to Layout [ “Contact Picker” (CONTACT) ]

Show/Hide Status Area [ Hide ]

Clear [ CONTACT::_kg_ContactKeyHolder ]

#

[ Select ] Commit Records/Requests

# Enter Find Mode [ ]

Set Error Capture [ On ]

Go to Field [ CONTACT::NameFullFirstLast ]

[ Select/perform ]

#

Pause/Resume Script [ Indefinitely ]

#

# If [ Get (ScriptParameter) = "Add Contact" ]

Perform Script [ “Add Contacts to Project Quote” ]

End If

#

Exit Script [ ]

Once the user is on the Contact Picker Layout they have various buttons that call this script below with different parameters:

Select Contact

Allow User Abort [ Off ]

Set Error Capture [ On ]

#

# show selected only

If [ Get (ScriptParameter) = "show selected only" ]

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

[ Show only related records ]

End If

#

# deselect all

If [ Get (ScriptParameter) = "deselect all" ]

Set Field [ CONTACT::_kg_ContactKeyHolder; "" ]

End If

#

# cancel

If [ Get (ScriptParameter) = "cancel" ]

Close Window [ Current Window ]

Exit Script [ ]

End If

#

# select or deselect

If [ Get (ScriptParameter) = "select" ]

Set Field [ CONTACT::_kg_ContactKeyHolder;

Case ( IsEmpty ( FilterValues ( CONTACT::__kp_ContactID ;

CONTACT::_kg_ContactKeyHolder ) ) ;

List ( CONTACT::_kg_ContactKeyHolder ; CONTACT::__kp_ContactID ) ;

Let ( excl = Substitute ( ¶ & CONTACT::_kg_ContactKeyHolder & ¶ ; ¶ & CONTACT::__kp_ContactID & ¶ ; ¶ ) ;

Middle ( excl ; 2 ; Length ( excl ) - 2 ) )

)]

Commit Records/Requests Exit Script [ ]

End If

#

When the user is on the Contact Picker Layout and they click on the "Add" button it is simply a "resume script" step,

which then resumes the original script "Go Customer Search from Quotes".

The script called "Add Contacts to Project Quote" reads like this:

# capture selected contact IDs

Set Variable [ $ContactIDs; Value:CONTACT::_kg_ContactKeyHolder ]

Go to Layout [ “project_PROJECTCONTACTS” (project_PROJECTCONTACTS) ]

# loop through values and create project contacts records Loop

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

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

New Record/Request

Set Field [ project_PROJECTCONTACTS::_kf_ProjectID; $$ProjectID ]

Set Field [ project_PROJECTCONTACTS::_kf_ContactID; GetValue ( $ContactIDs ; $i ) ]

End Loop

Close Window [ Current Window ]

Commit Records/Requests

Refresh Window

This popup select demo that I've posted here many times includes a script trigger find and a new button. I don't think it allows for multiple selections while in the popup, but that's easy to modify (as you did, by populating a global multikey). If I have time today, I'll do a revision that allows for multiple selections.

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.