When does the editing state get changed to editing state adding?


Author
Message
Paul Chase
Paul Chase
Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
When adding a record when should the editing state change to adding?

I am handling the set default values event of a business object however the editing state is idle.. I would think that is should be adding??

Anyways for now I am can set my own property so I know that values that are set from the set default value event. below

Private Sub BoWoLineItem1_SetDefaultValues() Handles BoWoLineItem1.SetDefaultValues

With BoWoLineItem1

.woi_PayRate = Me.BoWorkOrderHeader1.woh_PayRate

.End With

End Sub

Private Sub BOWoLineItem_FieldPropertyChanged(ByVal sender As Object, ByVal e As BOWoLineItemFieldChangedEventArgs) Handles Me.FieldPropertyChanged

Select Case e.FieldChanged

Case BOWoLineItemFieldNames.woi_PayRate

'-----------------------------------------------

'

'--- Update Check Item Details Reg and OT Hours

'

'-----------------------------------------------

'Check to see if this value was changed due to the set defaul values

If Me.EditingState = MicroFour.StrataFrame.Business.BusinessEditingState.Adding Then

 -> doesnt work replace with custom property?

'bail

Exit Select

End If


Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You may want to test on the row state of the BO rather than the editing state.  For example:

If Me.CurrentRow.RowState = Adding Then
   '-- add your logic
End If

This will provide a more granular depiction as to what is going on within the record itself.  But the editing state gets set after the row has been added and the default values event has been raised.  So if you have just called the Add() method, it will call the NewRow within the BusinessLayer which raises the OnSetDefaultValues() and the last call it makes is the SetEditingState. 

Paul Chase
Paul Chase
Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)Advanced StrataFrame User (592 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I didnt see this before. thats perfect thanks trent
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
No problem Smile
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