Replies

Thank you so much ! this is exactly what I was looking for.

Hi John Kumpf ,

In my case this field cannot be kept as a calculated. I need this to be unique and persistent.

Thanks

No, we have no object reference of HttpRequest (SetHeader is a method of HttpRequest object)

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.)

The below routine can be used for it.

CLSCOPY
Q

COPY(Class,NewClass,Qual="")
; Copy a class
; Pass Qual as 'ck' to keep the source
(Class,NewClass, Qual)
;TSTART
Q:Class="" "Class Name Can't be empty"
Q:$D(^oddDEF(Class))'=11 "Class "_Class_" is not found."
^oddDEF(NewClass) = ^oddDEF(Class)
^oddDEF(NewClass,1) = NewClass
K:'(Qual["k") ^oddDEF(NewClass,"s")
$system.OBJ.Compile(NewClass,Qual,.ER)
$system.OBJ.Compile(NewClass,Qual,.ER)
;I ER TROLLBACK Q ER(1)
ER ER(1)
;TCOMMIT
1

COPYPKG(Pkg,NewPkg,Qual="") ; Copy a package
(Pkg, NewPkg, St, Qual)
St
Sub = Pkg_"."
While 1 {
Sub = $O(^oddDEF(Sub)) Q:Sub=""
Sub,!
$P(Sub,".") '= Pkg Q
St($I(St)) = Sub_"|"_$$COPY(Sub,NewPkg_"."_$P(Sub,".",2,*),Qual)
}
St

This works, exactly I wanted  !!  Thanks a lot to everyone.