On 8/18/12 10:55 AM, Paul McNett wrote:
> 
> The simplest thing to do would be to edit your employees bizobj and set a 
> default
> department for new employees to a valid department so it doesn't default to 
> ''.

You would do this in your employee bizobj's afterInit or InitProperties methods 
using
code like:

self.DefaultValues["DepartmentId"] = "33001"

or (to get it dynamically):


  self.DefaultValues["DepartmentId"] = self.getDefaultDepartmentId

def getDefaultDepartmentId(self):
  """You'd have your own logic for determining this, but this should start 
you."""
  cur = self.getTempCursor("select id from departments order by 1")
  if not cur.RowCount:
    raise ValueError("Need at least one department in order to add an 
employee.")
  return cur.Record.id


Paul

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to