Implementing the Next ID Function


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Bill Cunnien (12/28/2007)

private void CustomersBO_BeforeSave(MicroFour.StrataFrame.Data.BeforeSaveUndoEventArgs e)
{
   
NextIDBO mNextIDBO = new NextIDBO();
   
this.CustID = mNextIDBO.GetNextID("CM");
}

Crying

Alas!  This works even when editing an old customer record, too!!  Very scary!  I was in a demo to my manager when this reared its ugly head.  How do I check to make sure that I am actually in Add mode as opposed to Edit mode while in the BO?

Thanks,
Bill

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)StrataFrame VIP (1.2K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
'Twas an easy fix.  The custid field has a default value of 0, so I just checked to see if the value was zero.  If true, then grab the next ID.  Whew!  Major crisis quickly melts into a very minor code change.

Tongue

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search