How can I do this:
<Data name="hyperlink">
<RetrievalCode>
<![CDATA[set res=""
set colId=""
for
{
set colId = $order( ^ohtest("mltab","main","Dta",{L4},colId) )
quit:(colId = "")
set indexTab = $g(^ohtest("mltab","main","Dta",{L4},colId,"Index"))
if indexTab'="" {
set res = res_"<hyperlinkIndexTab><colId>"_colId_"</colId><iTab>"_indexTab_"</iTab></hyperlinkIndexTab>"
}
}
s {hyperlink}=res]]></RetrievalCode>
</Data>
programatically?
I have:
set global = "^ohtest"
set iTab="main"
//hyperlink
set storData = ##class(%Dictionary.StorageSQLMapDataDefinition).%New()
set storData.Name = "hyperlink"
set storData.RetrievalCode = "<![CDATA[set res="""" set colId="""" for{set colId = $order( "_global_"(""mltab"","_iTab_",""Dta"",{L4},colId) ) quit:(colId = """") set indexTab = $g("_global_"(""mltab"","_iTab_",""Dta"",{L4},colId,""Index"")) if indexTab'="""" {set res = res_""<hyperlinkIndexTab><colId>""_colId_""</colId><iTab>""_indexTab_""</iTab></hyperlinkIndexTab>""}} s {hyperlink}=res]]>"
do storMap.Data.Insert(storData)
But it doesn't work. How to let generate code provided above?
your first problem is, putting CDATA declaration in code. Caché will add it without you, and then you put iTab without quotes.