User bio
404 bio not found
Member since Dec 14, 2023
Posts:
Replies:
Thank you!
I tried an SQL update first but I got an error :
<Insert/Update operations not supported on this table.>
For the global solution it work fine for me but only if the new method asn't been compiled before
So first add the method then change the global value and finaly compile.
// Clone the source method and insert it as the first method in the imported class
if (debug) { write "adding methodname classmethod to "_className,!}
set clonedMethod = method.%ConstructClone()
set tSC = classDefinition.Methods.Insert(clonedMethod)
if ($$$ISERR(tSC)) { quit }
set tSC = classDefinition.%Save()
if ($$$ISERR(tSC)) { quit }
// we set the method in first position
set ^oddDEF(className,"m",methodName,11)=1
// we recompile the class
set tSC = $system.OBJ.Compile(classDefinition.Name, "cbk")
If you need to move an already existing methods I suppose that removing it and compiling before should work fine but is a naive solution(in my case I don't need it).
Thanks, The existing part got me. I will check if the file exist beforehand and create it otherwhise
Certifications & Credly badges:
Stephane has no Certifications & Credly badges yet.
Global Masters badges:



Followers:
Stephane has no followers yet.
Following:
Thank you!