This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Update property in Department table

I would like to update CustomProperty03 for Department where FullPath = 'PZ'. I've prepared the script:

Public Function HRS_Department_Update() As String

    Dim dbDepartment As IEntity = Nothing
    Dim f As ISqlFormatter = Connection.SqlFormatter
    Dim result As String = "NOK"
	
	If Session.Source.TryGet( Query.From("Department").Where(f.Comparison("FullPath", "PZ", ValType.String, , CompareOperator.Equal, FormatterOptions.NonUnicodeLiterals)).SelectNonLobs, dbDepartment ) Then
		dbDepartment.PutValue("CustomProperty03", "Test")
		result = "OK"
    End If
	
	Using uow As IUnitOfWork = Session.StartUnitOfWork()
        uow.Put(dbDepartment)
        uow.Commit()
    End Using
	
	Return result
End Function


Function returns "OK" but CustomProperty03 is empty.