Normal Topic Restrictions not right with KeyField elements (Read 929 times)
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Restrictions not right with KeyField elements
Jan 7th, 2017 at 4:09am
Print Post Print Post  
I made a KeyField element with values separated by semicolons to use as a PickList.  Made it a Mandatory field with the restriction "!".  But then I found I could not proceed through the records even though they had values in them. After some frustrating time to troubleshoot, I decided to see what happens in the sample file for Countries.  Imagine my surprise to find it also happens there.   Here are four modified screen shots showing  the error message screen when I try to go to Next Record. And a picture of the two test fields with their values are shown on the bottom.  The left element is a Key Field, the right element is a normal Text Field.

Both fields blank:


Both filled:


Key Field filled, Text Field blank:


Key Field blank, Text Field filled,


You can see that the Text field is only listed when it is blank.  But the Key field show up when blank, or when it has a value.  The value is shown in the error message. No other restriction other than the "!"Is there a note somewhere that says a Key Field cannot be restricted?
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Restrictions not right with KeyField elements
Reply #1 - Jan 8th, 2017 at 11:45pm
Print Post Print Post  
Try removing the trailing semicolon. I suspect that this is causing Sesame to see a blank value at the end, which may be the reason you are getting a warning about it being empty.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Restrictions not right with KeyField elements
Reply #2 - Jan 9th, 2017 at 2:53am
Print Post Print Post  
Thanks Carl.  A quick test indicates that is the solution.  I had just connected to look for a response, and was also going to add another problem.  I found that if I did a search for "=" or "/=" I would get the wrong result set.  But if I used an "a" or a "b", etc, it worked OK.

But removing the trailing semicolon also  fixed that.  I will have to make a note in my Sesame Library about the trailing semicolon.

Thanks again.
  
Back to top
 
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Restrictions not right with KeyWord elements
Reply #3 - Jan 9th, 2017 at 4:31am
Print Post Print Post  
Just to provide a further update,

I had to remove any leading ";" and any trailing ";".  I was having the KeyElement updated from a PickList that was adding a trailing semicolon.  So I modified the code to add a leading semicolon instead, but then had to modify the code to eliminate the leading one if the PickList was empty so no semicolon is inserted with the first entry, but subsequent ones get a ";" + vComboBox

Thanks again Carl
  
Back to top
 
IP Logged