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

Can't set property of checkout objVer

Hello everybody,

I am trying to update a property with the following code: 

      [... lookups is initialized ...]

        propertyValueNew.Value.SetValueToMultiSelectLookup(lookups);

        var lastObjVer  =  dashboard.Vault.ObjectOperations.GetLatestObjVer(objVer.ObjID,false,true);
        if(!dashboard.Vault.ObjectOperations.IsObjectCheckedOut(lastObjVer.ObjID,false)){
            dashboard.Vault.ObjectOperations.CheckOut(lastObjVer.ObjID);
        }
       dashboard.Vault.ObjectPropertyOperations.SetProperty(lastObjVer, propertyValueNew);  <= error on this line
        dashboard.Vault.ObjectOperations.CheckIn(lastObjVer.ObjID);
when I execute this code, I get : 
" CustomControlSite.cpp, 1051, L'objet est verrouillé dans M-Files, mais la version à laquelle vous tentez d'accéder n'est pas la version actuellement verrouillée. Ceci est peut-être dû à des données non réactualisées sur le client M-Files. Veuillez rafraîchir l'écran. (0x8004002D) "
That means I am trying to update a non checkout objet. How? I don't understand
Thanks