Nuno Canas wrote:
> Property Versao As %Integer [ Calculated, SqlComputeCode = { Set
> {*}=##class(ECOM.EmpresaObjectivo).CurrentVersion({Ano})
> }, SqlComputed ];Okay, let's not do this as a computed! > Method VersaoGet() As %Integer [ CodeMode = expression ] We won't need this. > ClassMethod CurrentVersion(ano As %Integer) As %Integer We won't need this. > The last one will be Activated deactivating all the others for the same > year (my problem is not this)... Depois � muito facile. In your %OnBeforeSave() just select the MAX(Versao) WHERE :ano=Ano, add one to $g(result), and save to i%Versao. Versao can be a persistent %Integer [NOT Calculated]. > Clear !? Sim!
