COPY(Class,NewClass,Qual="") ; Copy a class ; Pass Qual as 'ck' to keep the source N (Class,NewClass, Qual) ;TSTART Q:Class="" "Class Name Can't be empty" Q:$D(^oddDEF(Class))'=11 "Class "_Class_" is not found." M ^oddDEF(NewClass) = ^oddDEF(Class) S ^oddDEF(NewClass,1) = NewClass K:'(Qual["k") ^oddDEF(NewClass,"s") D $system.OBJ.Compile(NewClass,Qual,.ER) D $system.OBJ.Compile(NewClass,Qual,.ER) ;I ER TROLLBACK Q ER(1) I ER Q ER(1) ;TCOMMIT Q 1
COPYPKG(Pkg,NewPkg,Qual="") ; Copy a package N (Pkg, NewPkg, St, Qual) K St S Sub = Pkg_"." While 1 { S Sub = $O(^oddDEF(Sub)) Q:Sub="" W Sub,! I $P(Sub,".") '= Pkg Q S St($I(St)) = Sub_"|"_$$COPY(Sub,NewPkg_"."_$P(Sub,".",2,*),Qual) } Q St
go to post
Thank you so much ! this is exactly what I was looking for.
go to post
Thank you @Rodolfo Pscheidt . It worked after your change.
go to post
Hi John Kumpf ,
In my case this field cannot be kept as a calculated. I need this to be unique and persistent.
Thanks
go to post
Thanks to all for your valuable responses.
go to post
No, we have no object reference of HttpRequest (SetHeader is a method of HttpRequest object)
go to post
The above example would work but how can I do it with Ensemble Outbound adapter. Since we have no reference of HttpRequest object.
(I did not find a field like ContentType in Adapter class.)
go to post
Thanks a lot..
go to post
Thanks a lot !!
go to post
The below routine can be used for it.
Q
COPY(Class,NewClass,Qual="")
; Copy a class
; Pass Qual as 'ck' to keep the source
N (Class,NewClass, Qual)
;TSTART
Q:Class="" "Class Name Can't be empty"
Q:$D(^oddDEF(Class))'=11 "Class "_Class_" is not found."
M ^oddDEF(NewClass) = ^oddDEF(Class)
S ^oddDEF(NewClass,1) = NewClass
K:'(Qual["k") ^oddDEF(NewClass,"s")
D $system.OBJ.Compile(NewClass,Qual,.ER)
D $system.OBJ.Compile(NewClass,Qual,.ER)
;I ER TROLLBACK Q ER(1)
I ER Q ER(1)
;TCOMMIT
Q 1
COPYPKG(Pkg,NewPkg,Qual="") ; Copy a package
N (Pkg, NewPkg, St, Qual)
K St
S Sub = Pkg_"."
While 1 {
S Sub = $O(^oddDEF(Sub)) Q:Sub=""
W Sub,!
I $P(Sub,".") '= Pkg Q
S St($I(St)) = Sub_"|"_$$COPY(Sub,NewPkg_"."_$P(Sub,".",2,*),Qual)
}
Q St
go to post
This works, exactly I wanted !! Thanks a lot to everyone.