Page 1 of 1

New Company Association Search List

PostPosted: Sun May 17, 2015 10:36 am
by kbjackson
What is the best way to show a complete list of companies from the primary company association panel when in Contact edit mode without having to enter search criteria?

There is a "select company from selector" script on the portal for companies. Can this be modified to show all companies?

Here's the screen I'm working with:

search_company.png
search_company.png (24.85 KiB) Viewed 14161 times

Re: New Company Association Search List

PostPosted: Mon May 18, 2015 5:39 am
by jeffalmquist
I can't tell from your screen shot, where is this layout? Can you send another screen shot that shows the entire layout?

Re: New Company Association Search List

PostPosted: Fri May 22, 2015 5:14 am
by kbjackson
Sorry, here's better pic. When editing a contact's info and selecting either the primary company or additional company I would like to have a list of companies auto-display on the selection layout instead of having to search initially.

I am trying to backtrack the code but can't quite figure out the best way to approach this without messing up the search filter.

I hope this makes sense.

Thanks - Ken


add_company.png
add_company.png (114.73 KiB) Viewed 14128 times

Re: New Company Association Search List

PostPosted: Fri May 22, 2015 10:01 am
by JasonYoung
Hi Ken,

The easiest thing to do would be to pass a "*" (asterisk) as the current value parameter. This will do a wildcard search and return find everybody. The find that's done in the control file is set to only return a 100 results, so if you want more returned by default, you'll need to change the limit variable in the control file.

Screen Shot 2015-05-22 at 11.53.17 AM.png
Screen Shot 2015-05-22 at 11.53.17 AM.png (141.93 KiB) Viewed 14123 times


Screen Shot 2015-05-22 at 11.56.45 AM.png
Screen Shot 2015-05-22 at 11.56.45 AM.png (117.14 KiB) Viewed 14123 times


Screen Shot 2015-05-22 at 11.57.25 AM.png
Screen Shot 2015-05-22 at 11.57.25 AM.png (140.97 KiB) Viewed 14123 times


Let us know if that helps!
-Jason

Re: New Company Association Search List

PostPosted: Fri May 22, 2015 7:40 pm
by kbjackson
Not sure why but using the wildcard in the "Add Company Associate" did not work. Using debug I found that the script used was "Add Secondary Associate" but adding the wildcard there didn't work either.

Using debug I found that script "Go to company" was called and following your example I added the wildcard as shown below and it worked.

This helps a lot as my beta test user always complains of not knowing what to do and kept asking for a way to just show the list of companies (clinics in this case).

Thanks so much for your help with this Jeff.

Ken

go_to_company_selector.png
go_to_company_selector.png (122.32 KiB) Viewed 14115 times

Re: New Company Association Search List

PostPosted: Mon May 25, 2015 8:15 am
by JasonYoung
Hi Ken,

Thanks so much! I'm not sure why passing the "*" as a parameter didn't work as opposed to setting it as a literal, but I'll add this as a bug to run through.

We should probably make this a setting somewhere, as it's probably behavior that others would want, and does make the action more explicit. The downside, of course, being that if you've got a million contacts, you could potentially have a big slowdown when doing the initial search, and I wanted to error on the side of performance :wink:

Cheers!!

Re: New Company Association Search List

PostPosted: Mon May 25, 2015 11:38 am
by kbjackson
Thanks Jeff.

I can fully appreciate putting performance first. In our case "companies" has been changed to clinics. There will only be a handful of clinics so performance is not an issue.

Thanks for your prompt reply. This solution is so well tuned and complex I find myself a bit lost and have to rely on you guys for tweaks.

Fortunately I have just about tweaked all of the big stuff. The small stuff I can figure out on my own. I will hit you up for one more item that I have been wrestling with for quite a while but can't figure out. It has to do with the "Toggle associations..." and "Toggle recent..." scripts. I will write it up in another post to get your feedback on a possible solution.

As always. Thanks a bunch!

Ken