go to post Vitaliy Serdtsev · Feb 8 I'm getting an error: ERROR #9406: Unexpected format for value of field, searchCriteria, using class base mappingAfter fixing the JSON, the error disappeared: {"searchCriteria": {..}} ==> {"searchCriteria": [{..}]}Also note the mapping between the fields professionalId/professionalNif and preparation/actPreparation
go to post Vitaliy Serdtsev · Feb 8 Your code does not take into account the numbers, so an incorrect result is given for "L33T C0d3r".
go to post Vitaliy Serdtsev · Feb 7 SELECT JSON_ARRAYAGG(json_obj) FROM (SELECT TOP 5 JSON_OBJECT( 'Name':name ,'Age':age ,'DOB':to_char(dob,'Day DD Month YYYY') ) json_obj FROM sample.person )SELECT JSON_ARRAYAGG(json_obj) FROM (SELECT JSON_OBJECT( 'Name':name ,'Age':age ,'DOB':to_char(dob,'Day DD Month YYYY') ) json_obj FROM sample.person ) WHERE %VID BETWEEN 1 AND 5
go to post Vitaliy Serdtsev · Jan 30 Reduced your code to 127: ClassMethod ToKeyPad(p) As %String { a s l=$f(" 0 1 ABC2 DEF3 GHI4 JKL5 MNO6 PQRS7TUV8 WXYZ9",$$$UPPER($e(p,$i(i)))) q:l=1 r s:l $p(r,l-2\5,*+l-2#5+1)="" g a }
go to post Vitaliy Serdtsev · Jan 29 Reduced your code to 137: ClassMethod ToKeyPad(p) As %String { f i=1:1:$l(p){f j=0:1:9{f l=1:1:$f($p(" 0^1^ABC2^DEF3^GHI4^JKL5^MNO6^PQRS7^TUV8^WXYZ9","^",j+1),$e($$$UPPER(p),i))-1 s r=$g(r)_j}} q r }
go to post Vitaliy Serdtsev · Dec 20, 2023 Yes, most likely this is legacy code. For some reason I thought that since the %JSON package classes appeared only in IRIS, the code would also have to be new. PS: by the way, can you compile an XData block without a name? Studio doesn't highlight the error?
go to post Vitaliy Serdtsev · Dec 19, 2023 It is strange that the bug has not been fixed yet, because it is easy to fix it by adding one line to ##class(%JSON.Generator).GenerateMappingFromXdata(): <..> For i=1:1:count { Set xdata=compiledclass.XDatas.GetAt(i) Set configName=xdata.Name If configName="" Continue ; since the Name field is required, how can it be empty? If xdata.MimeType'="text/xml" Continue <..>PS: by the way, I didn't quite understand why need to check "configName", given that "Name" is a required field. Any ideas?
go to post Vitaliy Serdtsev · Nov 15, 2023 For versions of Caché 5.0.x, try the following code: #include %systemInclude n s list=$lb( "test", "for", "searching unknown strings here is a very long piece with enough characters to get a lowercase alpha as a $list marker", "items", "in", "aaatArGetwaaaa", "lists", $lb( "/subs", "/values", "nested list", "did you see that ""w"" before the third piece?", "Stuart Strickland", "Yaron Munz") ) s str=$$$UPPER($$cccvt^%Wpglo(list,$$$MaxStringLength,.warn)) ; or ; s str=$$$UPPER($$listDump^%Wprim(list,9)) i 'warn { s str=$e(str,3,$l(str)-2) ; remove << & >> ;s @("LIST="_str) zw LIST w !,$f(str,$$$UPPER("Targetw")) }Result: 162 If you end up searching for globals that use $lb(), then you might find it useful: $$gloFind^%Wprog(gref,string,case,.record) - for Caché 5.0.x ##class(%Global).Find/Get() - for new versions of Caché/IRIS
go to post Vitaliy Serdtsev · Nov 10, 2023 You can convert a list to a string (and vice versa), regardless of the number of nestings. Unfortunately, I can't test this code for Caché 5.x, but I think it should work. Here is a small example of searching for a string in a list: #include %systemInclude n s list=$lb( "test", "for", "searching unknown strings here is a very long piece with enough characters to get a lowercase alpha as a $list marker", "items", "in", "aaatArGetwaaaa", "lists", $lb( "/subs", "/values", "nested list", "did you see that ""w"" before the third piece?", "Stuart Strickland", "Yaron Munz") ) s str=$$$UPPER(##class(%Utility).FormatString(list,,.overflow)) i 'overflow { ;s @("LIST="_str) zw LIST w !,$f(str,$$$UPPER("Targetw")) }Result: 162
go to post Vitaliy Serdtsev · Aug 25, 2023 There are much more interesting examples in the documentation, for example: w -"2Cats"_"Rats" w "8 apples" - "4 oranges" w "8 apples" - "four oranges"
go to post Vitaliy Serdtsev · Aug 25, 2023 To your data storage scheme, I would like to clarify one point. Let's say there is the following data: Organization ID 1 2 3 GetOrgUpdatesResponse ID Organizations 1 2,3 2 1,2 3 1,3 If you delete ID=1 (GetOrgUpdatesResponse), then ID=2 and ID=3 (Organization) will be automatically deleted. But in this case, the rows ID=2 and ID=3 (GetOrgUpdatesResponse) will contain incorrect data and the referential integrity will be violated. Or am I wrong?
go to post Vitaliy Serdtsev · Aug 24, 2023 Alternatively, you can create a custom task that runs every 15 minutes, in which to enable disabled users. Since there are other ways to connect besides CSP, this will be more universal. PS: why not disable "Disable account if login limit reached" and reduce Invalid login limit?
go to post Vitaliy Serdtsev · Aug 24, 2023 What about method %SYS.Audit.Erase(Flags As %Integer = 0)? Erase the audit file. Flags: 0 - Erase all contents 1 - Erase and create new audit file 2 - Erase and create new audit file, treat as encryption state changed Note that bit 1 infers that ALL data in the audit database will be deleted, not just Audit data
go to post Vitaliy Serdtsev · Aug 23, 2023 Look at the class %SYSTEM.CSP: CSS>d $system.CSP.DisplayConfig() ... CSS>w $system.CSP.GetConfig("DefaultPasswordChangePage") %CSP.PasswordChange.cls CSS>d $system.CSP.SetConfig("DefaultPasswordChangePage","CSS.CSP.ChangePassword.cls") CSS>w $system.CSP.GetConfig("DefaultPasswordChangePage") CSS.CSP.ChangePassword.cls
go to post Vitaliy Serdtsev · Aug 23, 2023 I did a little test: I created ZAUTHENTICATE.mac from scratch only with your code and got an error 5610 Referenced macro not defined: GetCredentialsFailedAfter adding the following lines, the compilation was successful: GetCredentials(ServiceName,Namespace,Username,Password,Credentials) Public { #include %occErrors #include %sySecurity ... }
go to post Vitaliy Serdtsev · Aug 23, 2023 Out of curiosity, how would you override that write statement in %CSP.Lookup? Isn't that generated code which one wouldn't want to touch? The source code of the %CSP.PageLookup class is available in %SYS namespace
go to post Vitaliy Serdtsev · Aug 22, 2023 I also noticed three things from your screenshots: instead of the standard program %SYS.Task.RunLegacyTask you are using a non-standard CTools.Task.Legacy. Is this how it should be? you have disabled "Reschedule task after system restart?". Is this how it should be? your task is scheduled for 4:00:00 under Task2, but judging by the history, it was launched at 11:52 and 11:56 under Administrator. Something doesn't add up here.
go to post Vitaliy Serdtsev · Aug 22, 2023 Now it's clearer, you're cleaning up own audit records. As @Yaron Munz pointed out, it's most likely that the Task2 user does not have some rights. For simplicity, you can login to Caché Terminal under this user in the ACB namespace and call your code: ACB:Task2>Do ^CleanAuditLogTables(14)
go to post Vitaliy Serdtsev · Aug 22, 2023 The problem can be solved in two ways: use OPTIONS="popup,sortbox" make a correction to the %CSP.PageLookup Write " <a href=""javascript:searchSort("_..QuoteJS(value)_");"" title=""Sort Results by "_alias_""">" | V Write " <a href=""javascript:searchSort("_i_");"" title=""Sort Results by "_alias_""">" In both case, the query will take the form "ORDER BY <the ordinal number of the field>", instead of "ORDER BY <field name>"