Re: Can't Save Record Mandatory field is null

2022-01-29 Thread Arnaud de Montard via 4D_Tech


> Le 27 janv. 2022 à 22:55, Alan Tilson via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Hello Keisuke,
> You make it sound simple, so how do I "parse the xml"?
> Open it in a text editor and search for "reject null values"?
> Thanks!


Hi Allan, 
it seems to be "never_null". 

But if you prefer a "code, do it for me" solution, I'd suggest to get the xml 
as Miyako said, then convert it to object, as object is far way simpler to 
browse than xml with 4D. 

Get structure in XML and convert to object:
+++
C_TEXT($structureXML_t;$XMLroot_t)
EXPORT STRUCTURE($structureXML_t)
$XMLroot_t:=DOM Parse XML variable($structureXML_t)
If (ok=0)
$error_t:="DOM Parse XML variable failed"
Else 
C_OBJECT($db4d_o)
$db4d_o:=Xml_ToObject($XMLroot_t)
DOM CLOSE XML($XMLroot_t)
End if 
+++

An example of what you'll get:
+++
{
"base": {
"collation_locale": "fr",
"name": "InternalDatabase",
"uuid": "AEBAD9E131B8E24AB5A93B28C5E95DCA",
"schema": {
"name": "DEFAULT_SCHEMA"
},
"table": [
{
"id": "1",
"name": "ADHERENT",
"uuid": "8AFCE92A7A6BA548BB3BD46F5CD5A0FE",
"field": [
{
"autosequence": "true",
"id": "1",
"name": "PK",
"never_null": "true",
"type": "4",
"unique": "true",
"uuid": 
"E37EF365C2A57242B395A5F3420113D7",
"index_ref": {
"uuid": 
"E48A518C9DD8427BB1BA601B1A28248F"
},
"field_extra": {
"enterable": "false",
"mandatory": "true", 
"modifiable": "false",
"editor_field_info": {
"color": {

"alpha": "255",
"blue": 
"5",

"green": "30",
"red": 
"216"
}
}
}
},
../..
+++

Soume source code to convert xml to object:





-- 
Arnaud 


**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2022-01-27 Thread Alan Tilson via 4D_Tech
Hello Keisuke,
You make it sound simple, so how do I "parse the xml"?
Open it in a text editor and search for "reject null values"?
Thanks!
Alan

On Wed, Jan 26, 2022 at 6:46 PM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> you can "export structure" and parse the xml.
>
> I cannot find a way to search for fields with "Reject NULL Values" set to
> true. Surely this must be possible, so can someone please let me know how
> to do it?
>
> **
> 4D Internet Users Group (4D iNUG)
> New Forum: https://discuss.4D.com
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2022-01-26 Thread Keisuke Miyako via 4D_Tech
you can "export structure" and parse the xml.

I cannot find a way to search for fields with "Reject NULL Values" set to
true. Surely this must be possible, so can someone please let me know how
to do it?

**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2022-01-26 Thread Alan Tilson via 4D_Tech
Hello again,
I cannot find a way to search for fields with "Reject NULL Values" set to
true. Surely this must be possible, so can someone please let me know how
to do it?
Thank you,
Alan

On Wed, Jan 26, 2022 at 12:26 PM Alan Tilson  wrote:

> Hello Sannyasin,
> I just got bitten by this same issue, so thank you very much for sharing
> the solution.
> We had a field that was accidentally marked to 'Reject null input values'
> over 15 months ago and today it started causing problems!
> But we are back up and running after searching for this issue. I had only
> looked at Mandatory fields previously.
> Much appreciated,
> Alan Tilson
>
> On Wed, Sep 7, 2016 at 4:19 PM Sannyasin Siddhanathaswami <
> sid...@hindu.org> wrote:
>
>> Solved!
>>
>> Tech support found that I had “Reject null input values” on by First Name
>> field! We must have checked that by accident at some point. Unchecking it
>> fixed the issue.
>>
>>
>> --
>> Sannyasin Siddhanathaswami
>>
>> On September 1, 2016 at 11:25:56 PM, Sannyasin Siddhanathaswami (
>> sid...@hindu.org) wrote:
>>
>> Regarding the debug log, I was able to start and stop it from the
>> maintenance tab on the 4D Server administration window. That’s good enough
>> as I didn’t have any other activity at the logging time. Of course, I don’t
>> understand enough of what the log says to see any problem...
>>
>> --
>> Sannyasin Siddhanathaswami
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
>
>
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2022-01-26 Thread Alan Tilson via 4D_Tech
Hello Sannyasin,
I just got bitten by this same issue, so thank you very much for sharing
the solution.
We had a field that was accidentally marked to 'Reject null input values'
over 15 months ago and today it started causing problems!
But we are back up and running after searching for this issue. I had only
looked at Mandatory fields previously.
Much appreciated,
Alan Tilson

On Wed, Sep 7, 2016 at 4:19 PM Sannyasin Siddhanathaswami 
wrote:

> Solved!
>
> Tech support found that I had “Reject null input values” on by First Name
> field! We must have checked that by accident at some point. Unchecking it
> fixed the issue.
>
>
> --
> Sannyasin Siddhanathaswami
>
> On September 1, 2016 at 11:25:56 PM, Sannyasin Siddhanathaswami (
> sid...@hindu.org) wrote:
>
> Regarding the debug log, I was able to start and stop it from the
> maintenance tab on the 4D Server administration window. That’s good enough
> as I didn’t have any other activity at the logging time. Of course, I don’t
> understand enough of what the log says to see any problem...
>
> --
> Sannyasin Siddhanathaswami
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2016-09-07 Thread Sannyasin Siddhanathaswami
Solved!

Tech support found that I had “Reject null input values” on by First Name 
field! We must have checked that by accident at some point. Unchecking it fixed 
the issue.


--
Sannyasin Siddhanathaswami

On September 1, 2016 at 11:25:56 PM, Sannyasin Siddhanathaswami 
(sid...@hindu.org) wrote:

Regarding the debug log, I was able to start and stop it from the maintenance 
tab on the 4D Server administration window. That’s good enough as I didn’t have 
any other activity at the logging time. Of course, I don’t understand enough of 
what the log says to see any problem...

--
Sannyasin Siddhanathaswami
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2016-09-02 Thread Sannyasin Siddhanathaswami
Regarding the debug log, I was able to start and stop it from the maintenance 
tab on the 4D Server administration window. That’s good enough as I didn’t have 
any other activity at the logging time. Of course, I don’t understand enough of 
what the log says to see any problem...

--
Sannyasin Siddhanathaswami
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2016-09-02 Thread Sannyasin Siddhanathaswami
That’s helpful. I suspect now that it’s some related table that has bad data in 
it’s primary key field even though the error I get when saving says it’s in my 
main Members table. I doubt this helps, but this is the full error:
Error when executing the method "Test Method" at line number 18
Cannot save record 81770 in table Members of database Akasha Danta

Error code: 1046
Cannot save record 81770 in table Members of database Akasha Danta
component: 'dbmg'
task -21, name: 'P_9'

Error code: 1049
Cannot update record 81770 in table Members of database Akasha Danta
component: 'dbmg'
task -21, name: 'P_9'

Error code: 1116
Mandatory field is Null in record 81770 in table Members
component: 'dbmg'
task -21, name: 'P_9'

I wanted to activate the debug log and see if there was anything helpful there, 
but I can’t seem to get the debug log to work:
SET DATABASE PARAMETER(34;2+4)  // enables file with v14 format, with 
parameters and runtimes
QUERY([Members];[Members]EMB=81766)
[Members]UUID:=Generate UUID
SAVE RECORD([Members])
SET DATABASE PARAMETER (34;0) // disables file

But no file is created in the Logs folder next to the structure file on our 4D 
server (v15.1 on a Mac). Any idea why a log file isn’t created?





--
Sannyasin SiddhanathaswamiOn September 1, 2016 at 12:47:49 AM, Arnaud de 
Montard (arn...@init5.fr) wrote:


Hi,
note that the code you send detects mandatory fields but not primary keys… 
while PKs *are* mandatory.

--
Arnaud de Montard
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2016-08-31 Thread Sannyasin Siddhanathaswami
Aloha Kirk, Good hint. I’ll look at related tables/fields for mandatory. I’ll 
also double check I have primary keys on everything. I thought I did.

Chip, unfortunately I get this error when I try to save a record with code 
without loading a form.

--
Sannyasin Siddhanathaswami

On August 31, 2016 at 4:31:14 AM, Chip Scheide 
(4d_o...@pghrepository.org) wrote:

Sannyasin,
You can also get that error if there are related or linked records. I've
never seen this come up outside of a change in structure when there is
existing data. And a primary key field that doesn't get set, of course.
Those might be clues.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2016-08-31 Thread Kirk Brooks
Sannyasin,
You can also get that error if there are related or linked records. I've
never seen this come up outside of a change in structure when there is
existing data. And a primary key field that doesn't get set, of course.
Those might be clues.

On Tue, Aug 30, 2016 at 9:05 PM, Sannyasin Siddhanathaswami <
sid...@hindu.org> wrote:

> It says :
> Cannot Save record…
> Cannot update record…
> Mandatory field is Null in record…
>


-- 
Kirk Brooks
San Francisco, CA
===
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Can't Save Record Mandatory field is null

2016-08-30 Thread Sannyasin Siddhanathaswami
Aloha,

I’m having a super weird error in our database. For maybe 1000 records I get an 
error when opening/saving a record.

It says :
Cannot Save record…
Cannot update record…
Mandatory field is Null in record…

I’ve run verify records in the maintenance center and it didn’t find any errors.

I don’t have any mandatory fields in this table, and confirmed that with this:
$lastFieldNum:=Get last field number(->[Members])
For ($x;1;$lastFieldNum)
GET FIELD ENTRY 
PROPERTIES(Table(->[Members]);$x;$list;$mandatory;$nonenterable;$nonModifiable)
If ($mandatory)
ALERT(Field name(Table(->[Members];$x)))
End if

Any clue what’s going on here?




--
Sannyasin Siddhanathaswami

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**