I have a webpage that is used for inserting data. User saves and the objects are build and then .added into the clsa business list base. I then call save on that business list base and it calls data layer and insert into database. Each insert returns the new records id and assign it to record id property. once back to webpage, i want to grab the new id's for just inserted records and use for something else. but they all say 0
I am doing
objects.add(new object)
objects.add(new object)
objects.add(new object).......
objects.save()
for each item as object in objects
response.write(item.NewRecordID) 'it comes back as 0, rather than the new id
next
You don't say which version of the framework you're using, but the first thing I'd try is to change "objects.Save()" to "objects = objects.Save()". In general, "objects.Save()" is always incorrect code in CSLA. Remember that the DP_ routines return an updated copy of the object - they don't update the object in-place.
HTH
- Scott
I am doing
m_LineItems =
New LineItems
loop
LineItem item = new lineitem
...update values
m_LineItems.add(item)
end loop
m_lineitems.save()
investigate LineItemId for each item so as to do whatever
As Scott stated earlier the bug is in your code.
m_lineitems.save() is wrong.
It needs to be:
m_lineitems = m_lineitems.save()
Joe
Copyright (c) Marimer LLC