Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 25, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Need to default the selection of a multi-select field
Erik DeBoer
Posts: 6
 
Need to default the selection of a multi-select fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Aug 08 5:21 PM
I have a picklist field in a Contact tab that isn't keeping the checked values when the selection button is pressed. Example - Value 1, Value 2 is in the field selected by what is in the list but if the user wants to add another value he hits the button and the first 2 are not already checked. The picklist is scripted to change depending on a row in a data grid located on the Contact Detail view. Also the values are stored in a custom table depending on the previous listed data grid. My question is...when I open the picklist drop down how do I (script) populate the check marks, so my user doesn't have to make all the selections each time.

Thanks!
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Need to default the selection of a multi-select fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Aug 08 3:47 PM
Store the values in the picklist text field for the control, place commas between each value. When the user pops the picklist selector, the correct items are check boxed.

pklMyMultiplePickList.TEXT = "Choice one, Choice Three, Choice Seventeen"
[Reply][Quote]
Ian Fitzpatrick
Posts: 146
 
Re: Need to default the selection of a multi-select fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Aug 08 9:59 AM
RJ,
Thanks for the response, I work with Erik and he showed this to me. It seems that the comma delimited values display in the UI but then they aren't getting picked up when the picklist is initialized. One more detail, there is some custom code on this picklist that is selecting the list to use, so maybe that is part of the problem? That's all I can think of.

So the question becomes: how do we switch picklists and then get the lists to initialize properly?
[Reply][Quote]
Erik DeBoer
Posts: 6
 
Re: Need to default the selection of a multi-select fieldYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Aug 08 12:06 PM
This is the code I'm using to populate the field and it works fine, it's in a FillFields function.

If Not sChannel = "''" Then
ActivateControl pklSalesClass
'pklSalesClass.Enabled = True

strSQL = "SELECT CI.FIRSTCONTACT , YEAR ( CI.YEARCONTRACTED) AS YEARCONTRACTED , CI.CHANNEL , " _
& "CASE WHEN ( SELECT COUNT ( DISTINCT ( CI.CHANNEL ) ) " _
& " FROM CC_CONTRACTINFO CI " _
& " WHERE CI.CONTACTID = '" & sContactID & "' " _
& " AND CONTRACTENDDATE > '" & LDTOSISO ( dateserial ( Year(Now)-2 , Month(Now) , Day(Now) ) ) & "' " _
& " OR CONTRACTENDDATE IS NULL ) > 0 THEN " _
& " 'Active' " _
& "ELSE " _
& " 'Inactive' " _
& "END AS CHANNELSTATUS, " _
& "CI.SALESCLASS " _
& "FROM CC_CHANNELINFO CI " _
& "WHERE CI.CONTACTID = '" & sContactID & "' " _
& "AND CI.CHANNEL IN (" & sChannel & ")"
OpenRecordSet objRS , objSLXDB , strSQL

If objRS.RecordCount > 0 Then
txtChannelStatus.Text = ValidateData (objRS.Fields("CHANNELSTATUS").Value)
dteFirstContact.Text = ValidateData (objRS.Fields("FIRSTCONTACT").Value)
txtYearContracted.Text = ValidateData (objRS.Fields("YEARCONTRACTED").Value)
pklSalesClass.Text = ValidateData (objRS.Fields("SALESCLASS").Value) 'Erik D. 7-7-08
Else
txtChannelStatus.Text = ""
dteFirstContact.Text = ""
txtYearContracted.Text = ""
pklSalesClass.Text = "" 'Erik D. 7-7-08
End If
Else
DeactivateControls
End If

The problem is when you first open the record, the field has the value(s) but if you click the picklist to select another value the first one is not highlighted or checked in the list but the second time you click the button it is selected. It's just not checked in the list the first time.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/25/2025 1:09:45 AM