Print Thread
"Required" changes in Descendent Component
#6678 08/25/04 06:52 PM
Joined: May 2002
Posts: 36
I
indigo Offline OP
Member
OP Offline
Member
I
Joined: May 2002
Posts: 36
I have a TOracleDataSet descendant component I use in my applications. The field definitions have been loaded as persistent fields. I go in and set all the fields Required property to false. Later, I find that fields which are listed as non-null in the database have been set back to required. How do I prevent DOA from modifying the Required property in the persistent fields of the descendant component?

Re: "Required" changes in Descendent Component
#6679 08/25/04 07:06 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
Do you set the Required property to False at design-time or at run-time?


Marco Kalter
Allround Automations
Re: "Required" changes in Descendent Component
#6680 08/25/04 07:19 PM
Joined: May 2002
Posts: 36
I
indigo Offline OP
Member
OP Offline
Member
I
Joined: May 2002
Posts: 36
When "Add All Fields" is used to pull in the persistent field definitions, the fields that do not allow null have "required" set "True" and the ones that allow null have "required" set False. I then select all the fields and set "required" to false. When I run the program, I get messages like "TransactionNo must have a value.". When I check I find that the persistent field "Required" value has reverted to "True". I am not sure when this is happening.

There was another post from someone in this forum who described the same or similar problem but I don't understand how they fixed it:

"I found a combination where it would work. The reason is that the internal TDataSetProvider uses the field list of the internal TOracleDataSet to identify mandatory columns. I had to set those columns to not required too and not only the fields of my TClientDataSet descendent."

Re: "Required" changes in Descendent Component
#6681 08/26/04 09:16 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
Are you using a TDataSetProvider as well? I can't imagine why the Required properties of these persistent fields would change. As a test you could set TOracleDataSet.OracleDictionary.RequiredFields to False. Now the internal TOracleDataSet processing will not even attempt to determine the required fields.


Marco Kalter
Allround Automations
Re: "Required" changes in Descendent Component
#6682 08/26/04 09:23 PM
Joined: May 2002
Posts: 36
I
indigo Offline OP
Member
OP Offline
Member
I
Joined: May 2002
Posts: 36
I am not using a TDataSetProvider. I decided just to override the DoAfterOpen in my component and set Required := False for all fields.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.022s Queries: 13 (0.007s) Memory: 2.5168 MB (Peak: 3.0421 MB) Data Comp: Off Server Time: 2024-05-11 08:41:32 UTC
Valid HTML 5 and Valid CSS