This is from a StockTransfer.
Assume that the setting is true normally. I want to set it to false, attempt to activate the transfer and if it errors for whatever reason, capture the reason in the event log.
Can I use this code to set it one way or another? Temporarily using VB .Net for this plugin!
- Code: Select all
Try
stockTransfer.Manager.Database.ReadSysData("GLParams", "SaveErroredSets", false)
stockTransfer.ActivateRecord()
Catch ex As Exception
LogToEventLog(String.Format("Error during activating Stock Transfer '{0}', error '{1}'", sTransferNo, ex.Message), System.Diagnostics.EventLogEntryType.Error)
stockTransfer.Manager.Database.ReadSysData("GLParams", "SaveErroredSets", true)
End Try