Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009
Accepted Solution

Picklist is allowing nulls

Hi all.

 

We have a pick list whose attributes are the following:

 

1. Text must match a list item

2. Users cannot edit items

 

The other attributes are blank.

 

The problem we are having is that the first value in the picklist is <None> and some users are selecting that, and that is entering <NULL> in the table. We do not want to check the "Required Entry" checkbox because that forces the end user to select something, but there may be times when they accidentally enter the picklist. How can we avoid entering <NULL> without requiring entry?

 

SLX LAN v7.2.1

 

Thank you in advance!

Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Picklist is allowing nulls

A simple piece of code on the popupreturn event will do the job. Otherwide you will have to use the required entry approach.
--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009

Re: Picklist is allowing nulls

Does the code have to delete the NULL record just entered into the table?
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Picklist is allowing nulls

Normally a field IS NULL is SalesLogix - until you actually put something in it.

 

The code should just prevent the user from continuing.. and have to choose something - or set a default.

 

You can do all that w/out code by just using the Picklist options. - What do you really want to save? 

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009

Re: Picklist is allowing nulls

If the user selects the <NONE> entry in the picklist (which appears as the first one in the list) then allow them to close the picklist without saving the record.
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Picklist is allowing nulls

Here's the basic method:

  A - OnPopup - Save the value in a (script) global

  B - OnPopupreturn - see if none.. if so copy back the saved value 

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009

Re: Picklist is allowing nulls

and if it is blank then what, will SalesLogix allow me NOT to save anything?
Bronze Super Contributor
Posts: 153
Registered: ‎04-08-2009

Re: Picklist is allowing nulls

Forgive me if this is too "database 101" but if the field is not required to have a value, then <NULL> in the database means no value.   If other fields in the record are being populated, then SLX will still save the record, but with no value - <NULL> in that field.    In most cases, this does not present a problem in SalesLogix. 

 

Exceptions would be numeric fields which are used in mathmatic formulas or text concantenation (you have a "select color" picklist and later refer to a Red Widget, using the selected color).   To avoid type mismatches here you'd have to default these fields to 0 or a blank value (blank in a a text field IS a value), or use code to avoid using these fields when they are null. 

 

 

 

 

Copper Elite Contributor
Posts: 72
Registered: ‎04-01-2009

Re: Picklist is allowing nulls

Got it. Thanks!