UpdateStatesPostSave method (WinStudio scripts)

Applies To

IWSIDOCollection interface

Definition

Performs operations that WinStudio normally performs after a save operation.

Syntax

object.UpdateStatesPostSave( )

  Part   Description
object Required. A reference to a valid IDO collection object.

Remarks

After a save operation, WinStudio normally performs the following tasks:

  • It deletes any objects in the collection that were marked for deletion.
  • It refreshes all modified objects and new objects and updates components bound to the refreshed data.
  • It resets the status of objects in the collection and of each individual property value as well as the status of components bound to the properties. The new state is set to not new; the modified state is set to not modified; the save button is disabled; all property values are marked as valid.

This method performs the three operations that WinStudio normally performs after a Save but does not save objects in a collection. This method is designed to be used with the SaveDeferStateUpdate method, which saves objects in a collection but does not perform the three tasks.

In some cases, you might need to execute actions after a successful Save operation has occurred, but before the three tasks are performed. If your actions fail, you can then rollback the effects of the save. The SaveDeferStateUpdate method, used in conjunction with this method, allows you to do this.

This method does not save objects and must be used with caution because data changes appear to have been committed to the database.

Example

Sub Main()
   Dim bSuccess As Boolean
   Dim ReturnValue As String
   bSuccess = ThisForm.CurrentIDOCollection.SaveDeferStateUpdate()
   If (bSuccess) Then
   End If
   If (bSuccess) Then
      ThisForm.CurrentIDOCollection.UpdateStatesPostSave()
   Else
   End If
   ReturnValue = "-1"
End Sub
Related topics