StrataFrame Forum

AfterAddNew

http://forum.strataframe.net/Topic19070.aspx

By Geoff Hirst - 9/4/2008

Guys,

I have a BO that has an AfterAddNew event, in this event I set some defaults but I am finding that this is failing because the currentrowindex of the BO is -1. Is this correct?

I am running the 1.6.6. beta from 27th August 2008.

best

Geoff

By Greg McGuffey - 9/4/2008

Geoff,



Try handling the SetDefaultValues event on the BO. Works much better, more reliably than AfterAddNew.
By Geoff Hirst - 9/4/2008

Greg,

That is a real Doh! moment. Can't say why I never saw that event before. Interesting thing was that initially, it didn't solve the problem. When I did some digging I found that a childformdialog still had a legacy BOTranslation that wasn't in use but this was obviously corrupting the object creation.

At then end of it, issue now seems solved and many thanks for the input.

best

Geoff.

By Greg McGuffey - 9/5/2008

Glad you got it going Geoff. And not to long ago I was using AfterAddNew to set some default values and it wouldn't work....DOH! Glad to share the lesson!
By StrataFrame Team - 9/5/2008

I can certainly see how that one would be confusing Smile  That's why we made a conscious decision to put the stub for the SetDefaultValues event handler within the template of a new business object (and the CheckRulesOnCurrentRow event, too).
By Greg McGuffey - 9/5/2008

Yeah, I remember to use that one when I'm setting up defaults at the BO level. Were I used to have a brain fart was when then doing some additional setting at the form level or beyond...The last time was finally enough pain and I remember it now! Cool