Hi @Eduard Lebedyuk Yes, you are totally right. Using query class element will be concise and faster. The point to use dynamic query are when the user choose the parameters to you do the query. Using my simple example, when the method receive a name param or a age param to build the where clause. I really don't know how to solve it using query class. In my $0.02 maybe will create an ByName and a ByAge methods, and another to combine both. Like I said, it's a simple example that can solved by an OR, but in a complex report with the user need to choose by parameters use dynamic query could be an alternative
Have you tried to make the namespace a binary value and pass the user and password as a parameter?
s Attr3=$lb(128,"intersystems-Namespace",$lb("%SYS"))
s Attr4=$lb(0,"intersystems-Routine",$lb("iscRoutine"))
s Attr5=$lb(0,"intersystems-Roles",$lb("iscRole1","iscRole2"))
s Attr6=$lb(0,"userPassword",$lb(password))
s Attr7=$lb(0,"cn",$lb("test20"))
s Attr8=$lb(0,"uidNumber",$lb(58129))
s Attr9=$lb(0,"gidNumber",$lb(58129))
s Attr10=$lb(0,"homeDirectory",$lb("/home/test20"))
s Attributes=$lb(Attr1,Attr2,Attr3,Attr4,Attr5,Attr6,Attr7,Attr8,Attr9,Attr10)
s Status=##Class(%SYS.LDAP).AddExts(LD,DN,Attributes,"","")
i Status'=$$$LDAPSUCCESSw !,"AddExts error: "_Status_" - "_##Class(%SYS.LDAP).Err2String(Status) g LDAPError
You can see an example of that on LDAP.mac on Namespace Samples.
"So then if I store the Injection element_key (in the case of an array), as a property in the ImageFile object which references the injection, I will be able to get to the various Injection properties from the ImageFile instance? "
Sure, just to pay attention to manage the array key, that will be like your ID
"What would I store in the ImageFile in the case of a list? "
You can use list like a collection, could be of %SerialObjects or other types like %Strings, in the table will be save like $Piece in the column
go to post
Thanks @Lorenzo Scalese and congrats for the JSON-filter and the deserved nomination
go to post
Congratulations for all winners and a big thanks to you all participants for these amazing apps!
go to post
cool, thank @Vitaliy.Serdtsev for the enlightenment
go to post
Thank you very much @Evgeny Shvarov
go to post
Hi @Eduard Lebedyuk
Yes, you are totally right. Using query class element will be concise and faster.
The point to use dynamic query are when the user choose the parameters to you do the query.
Using my simple example, when the method receive a name param or a age param to build the where clause. I really don't know how to solve it using query class.
In my $0.02 maybe will create an ByName and a ByAge methods, and another to combine both.
Like I said, it's a simple example that can solved by an OR, but in a complex report with the user need to choose by parameters use dynamic query could be an alternative
go to post
👍
go to post
Thank you very much @Maks Atygaev
go to post
That sounds great!!

Excited to see incredible new apps
go to post
Awesome!! Love the promo, congrats @Maks Atygaev
go to post
Great job!
go to post
Hi,
Have you tried to make the namespace a binary value and pass the user and password as a parameter?
s Attr3=$lb(128,"intersystems-Namespace",$lb("%SYS")) s Attr4=$lb(0,"intersystems-Routine",$lb("iscRoutine")) s Attr5=$lb(0,"intersystems-Roles",$lb("iscRole1","iscRole2")) s Attr6=$lb(0,"userPassword",$lb(password)) s Attr7=$lb(0,"cn",$lb("test20")) s Attr8=$lb(0,"uidNumber",$lb(58129)) s Attr9=$lb(0,"gidNumber",$lb(58129)) s Attr10=$lb(0,"homeDirectory",$lb("/home/test20")) s Attributes=$lb(Attr1,Attr2,Attr3,Attr4,Attr5,Attr6,Attr7,Attr8,Attr9,Attr10) s Status=##Class(%SYS.LDAP).AddExts(LD,DN,Attributes,"","") i Status'=$$$LDAPSUCCESS w !,"AddExts error: "_Status_" - "_##Class(%SYS.LDAP).Err2String(Status) g LDAPError
You can see an example of that on LDAP.mac on Namespace Samples.
I hope that helped you
go to post
Sure. That would be great!
go to post
Thanks @Evgeny Shvarov.
Yes it works with IRIS, I tried on IRIS version 2018.1.2 and works fine
go to post
Thank you very much Artanniel
go to post
You did a great job!!!
I was using the old version for a while, and this new improvements help me a lot..
Thanks very much
go to post
Sounds Great!
It's like the ruby tools: Reek and Rubocop
I miss this kind of tools in caché, I can't wait to use it
go to post
"So then if I store the Injection element_key (in the case of an array), as a property in the ImageFile object which references the injection, I will be able to get to the various Injection properties from the ImageFile instance? "
Sure, just to pay attention to manage the array key, that will be like your ID
"What would I store in the ImageFile in the case of a list? "
You can use list like a collection, could be of %SerialObjects or other types like %Strings, in the table will be save like $Piece in the column
go to post
Sorry for delay...
You can use both, as a list you will use the insert method like a relationship
Set inj = ##class(PET.Injection).%New(), inj.Desc = "blabla "_i
Do study.Injection.Insert(inj)
It will add a column with the list
You can use an array, but you must use SetAt:
And it will create another table with the name of the property
go to post
Hi,
You can create Injection as a %SerialObject and add to Study as a list
Property Injection As list Of PET.Injection;
`` `
```
go to post
awesome