main logo
Subject: Is it MANDATORY DEFAULT values within PK ???
Author: Leriel Garay Hurtado
Posted: 2000/10/04 17:55:00
 
View Entire Thread
New Search


according to standart behavior of cbizobj:
Is it MANDATORY to have pre-set DEFAULT values within PK fields
of tables in the DBC?

I have many entities or tables of the traditional struct 'key-value'
where most of times 'key' is an abbreviation of 'value'
for instance Colors:
'R' Red
'G' Green
or Shapes:
'R' Round
'O' Oval
and so on..

I just created a bo for maintaining such entities, but when I´m
adding new records I've got two vfp errors, I went to trap then
and I realized following secuence:

cbizness.vcx:new()-this.onnew()-
This.oBehavior.SetNewPK()-
This.GetNextLocalPK(lcBaseTable, lcPrimaryKey)

and here you are guilty lines:

lcDefaultValue = DBGETPROP(tcBaseTable + "." + tcPrimaryKey, ;
"Field", "DefaultValue")
luRetVal = EVAL(lcDefaultValue)

No matter what DBGETPROP() returns it is evaluated so if
lcDefaultValue is empty I get my first error, later derived one arrives as well.


Shall I override
cBhavior.VCX: cDataBehavior.GetNextLocalPK()?
Is there some foreseen to avoid such error ?

thanks in advance again,
bst rgds,
Leriel
 
©2000 Leriel Garay Hurtado
<-- Prior Message New Search Next Message -->