Unable to Perform Update

Unable to Perform Update

CSI/SyteLine CO Lines Form and Error Message

When this happens in SyteLine, the user can hit the [Refresh Current] shortcut and then retry the

save. Usually that works.

But what if the error message pops up with every little update? Then it becomes a nuisance. We

don’t know the root cause of this. Obviously the system detects a collision. In the meantime here’s

the workaround solution we came up with.

The idea is to programmatically simulate the [Refresh + Save] to prevent a recurrence of the

“Unable to perform update..” error message.

Create a form variable . Name it anything. Ours is “CurIndex”.


‘In the StdFormSave event handler, execute this From Script Method to capture the Index of the

current row. The position of the cursor in the collection.

Sub _CAPSA_StoreIndex()

Dim iIndex As Integer

Unable to Perform Update

iIndex = ThisForm.CurrentIDOCollection.GetCurrentObjectIndex

ThisForm.Variables("CurIndex").Value = Cstr(iIndex)

End Sub

In the StdFormSaveCompleted EventHandler,

1. Perform a StdFormRefresh. The collection is refreshed however, the cursor is repositioned

on the first row of the collection. Which is undesirable.

2. Executed a different Form Script Method to reposition the cursor on the row that was in

focus when the user hit [Save].

Sub _CAPSA_SetIndex()

Dim iIndex As Integer

iIndex = CINT(ThisForm.Variables("CurIndex").Value)

ThisForm.CurrentIDOCollection.MoveCurrentIndexAndRefresh(iIndex, False)

END Sub

Jon Bossman