How do I create a custom Property Parameter?
Here's my current attempt:
{
Property p1 As %String(MAXLEN = 5, myPropName = "myPropValue");
Method test()
{
set ..p1 = 10
//write ..p1.Parameters
set p1 = ##class(%Dictionary.PropertyDefinition).%OpenId("Testing.PropertyParameters||p1")
zwrite p1
do p1.Parameters.SetAt("myPropValue", "myPropName")
set key = ""
for {
set item = p1.Parameters.GetNext(.key)
if (key = "") {
quit
}
write !,"key: ", key,", Item: ",item
}
do p1.%Save()
write ..p1.%GetParameter("myPropName")
write !
}
}
I've visited:
(Using %Dictionary classes)
https://irisdocs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page...
(Class definition for %Dictionary.PropertyDefinition)
https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?...
(DC article that might be a similar topic)
https://community.intersystems.com/post/how-set-property-parameters-cos
(Using Literal Properties)
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...
I am successfully opening the property definition in that code, and I can use:
select * from %Dictionary.PropertyDefinition where Name [ 'p1'
in the same namespace to view that definition. I'm even successfully updating the Parameters list of that PropertyDefinition object. Still, things don't seem to work. I need to delete the myPropName part of the property definition, but then after I compile and click back into Studio, it repopulates the prop definition with that (probably getting it from the property definition in the db, which I changed).
Thanks.