wwBusinessObject::New

Creates a new oData member. Creates a PK value and sets any defaults coded in the New method.

Overload this method to set default values on the oData object properties.

***Create new object
IF !DODEFAULT()
   RETURN .F.
ENDIF

* **Set default values
THIS.oData.FromName = "Unknown"
THIS.oData.SendTo = "All"
THIS.oData.ThreadId = SUBSTR(SYS(2015),2)
THIS.oData.MsgTime = DATETIME()

RETURN .T.
o.new(llNoNewPk)

Return Value

.T. or .F.

Parameters

llNoNewPk If .T. no new PK is assigned, meaning you're responsible for creating the new Pk after the oData record has been created.

Remarks

The numeric PK that New() generates is not guaranteed to be sequential. wwBusiness generates a new PK on New() operation, but if the record is not saved the PK is thrown out and not returned to the pool. If you need sequential keys you can use CreateNewId() with a custom key name and manage that on your own.


See also:

Class wwBusinessObject

© West Wind Technologies, 1996-2022 • Updated: 11/09/18
Comment or report problem with topic