Thanks Timothy Leavitt, that's exactly what I was looking for. In addition, I added the "TotalPhones" column as a Transient property of ZenTutorial.Contact class.
Property TotalPhones As %Integer [ Transient ];
- Log in to post comments
Thanks Timothy Leavitt, that's exactly what I was looking for. In addition, I added the "TotalPhones" column as a Transient property of ZenTutorial.Contact class.
Property TotalPhones As %Integer [ Transient ];
Edit: Ok, so I THOUGHT I answered my own question. Read up on asynchronous and synchronous modes via the online documentation. Here's my "solution".
ClientMethod onSelectRow() [ Language = javascript ]{
// Set mode var zenSynchronousMode='true'
// Do some synchronous stuff
// Turn off mode when done
zenSynchronousMode='false'
}It hasn't worked :(
Ok, I *think* I have it now.
ClientMethod onSelectRow() [ Language = javascript ]{ var resultsPane=zenPage.getComponentById('resultsPaneId'); var isHidden=resultsPane.getHidden(); if (!isHidden) { var table=zenPage.getComponentById('workBioTable'); var dataRow=table.getRowData(table.selectedIndex); if (dataRow) { var rowID = zenPage.GetSelectedRowId(dataRow.RequestDate,dataRow.Worksheet,dataRow.SpecId); if (rowID) { this.populatePIDForm(dataRow); var waittoend = zenPage.GetAuditLogs(rowID); this.populateAuditEvents(); } }} // end-if}Note the variable 'waittoend' and the zenPage.GetAuditLogs(RowId) method. This process builds the global that the secondary tablePane is built from. Without the return value, it is possible for the table to refresh before the global is built for the newly selected row.
Testing this has been difficult because in the most cases, the table was displayed correctly but several dozen clicks later you gasp, "Did I just see that!?" when you notice that on this one occasion it did not update correctly.
Done! See update in description.
Thanks @alexander-koblov, your solution worked perfectly :)
Thanks Wolf Koelling. I should have made it more explicit that %vars are shared across NAMESPACES not processes. When a user logs into our system their process remains active as long as they are logged in. During their login session they can call any number of COS routines to perform a wide range of different functions. Variables not explicitly killed off still reside in memory and this was the problem I had to solve.
I had to be sure that
a) The %ZLOG COS routine would not crash out because of missing variables the routine expects.
b) All the calls or entry points into %ZLOG would still work as normal otherwise a system-wide crash would occur across all our databases.
c) Be able to identify that if my background process had called %ZLOG then use the PPG created before the call to %ZLOG. No other code in our system uses PPGs whereas there is a plethora of globals, %variables and non-percent variables.
I could have used a scratch or temporary global such as ^CacheTempUser.DataExtract($JOB). This type of global is killed off when the instance is brought down for our daily backup job. A PPG was very easy to implement.
I have placed a strikethrough on the erroneous statement in my answer.
This is excellent! Probably the best answer on this question. I would add that sometimes the process is the login session of an individual user and what the user does within that session needs to be carefully managed!
You can also use set $ZS=1234567 to set the max-limit memory for your process. Useful if the default memory is inadequate for a particular process but is fine for everything else.
Nope, certificate error still remains. Our web security policy blocks access to sites with certificate errors.
Error details are as follows
VERIFY DENY: depth=0, CommonName "*.influitive.com" does not match URL "globalmasters.intersystems.com"
Hi Marco,
I think your problem might be to do with having declared 'TotalMatrix' as a transient property, it does not exist in the 'Relations' table. In my example, I referenced a table class called 'ZenTutorial.PhoneNumber' but my SQL statement did NOT refer to a 'TotalPhones' column.
Consider this
colExpression="(select count(*) from ZenTutorial.PhoneNumber where Contact=ZenTutorial.Contact.ID)"
So the result of the SQL goes into my TotalPhones column on my tablePane but the ZenTutorial.PhoneNumber class does not recognise it as a SQL field. Transient properties are useful when opening %Persistent objects and dynamically setting the transient property at the %OnOpen() event based on a set of conditions. As TotalPhones is marked as transient, it is not stored in the Global Mapping for %Library.CacheStorage. You cannot reference it in your SQL statement.
What if you tried something like
SELECT COUNT(*) AS TotalMatrix FROM Relations
You will need all those relationships in there though for it to work. If you have a <column> section defined in your tablePane be sure to set colName="TotalMatrix"
I hope that helps.
I would like a join code. Thanks.
Stephen
No more certificate errors. I believe the issue with the certificate is now resolved.
Maybe is obvious to people but the downside to encryption is that if you lose your encryption keys, you lose all of your encrypted data. That would be ironic if the reason you encrypted your data was to prevent data loss and theft. This fear of data loss has been the key driver for not using key-based encryption within our applications - even though there are good business reasons for doing so.
You can also get this kind of information from the cache.cpfand CSP/bin/CSP.ini files. The Write $ZV function will get your version information. You may also view the system start-up time from the cconsole.log
We don't have any plans to introduce new namespaces but I can see how this would be a useful feature for some people. We have 'training' and 'live' namespaces that have a one-to-one mapping with a database. It allows you to test software in a "logically partitioned" area of the production server. This setup has its quirks. When you copy a live routine into a training database you have to run a routine that essentially converts references to live namespaces and replaces them with training namespaces. Training namespaces always end in 'T'. If you forget to run this routine, you could accidentally modify the live data...
1. Good question but I'm not fully sure I understand the design-time and runtime concepts so I'll try to explain it in different terms. If you open two Caché objects in memory using something like ##class(MyProjectName.MyClass1).%OpenId(id1) and ##class(MyProjectName.MyClass2).%OpenId(id2) can you create an arbitrary parent-child relationship object that links the two open objects within the executing ClassMethod? The implication is that if you were then to delete the parent object, you would also delete it's children.
2. Exporting individual classes from one server to another and getting compile errors due to missing dependencies and child dependencies. The classes have been provided by another programmer but the relationships are not necessary for what I am doing. I would question why so many relationships were created but I suspect the programmer was trying to ensure that all the data and all the levels of a single global were mapped to a class property.
3. I'll initially try to keep this high-level and theoretical rather than immediately delve into working code examples. I can tell you that the classes have been created from a Global using a CacheSQLStorage strategy.
Thank you for sharing. Really interesting post.
Sadly, the %CSP.REST class does not exist in Caché 2013.1.6 and the Class Explorer UML tool only works in Caché 2014.1 or later. We really struggle to keep pace with upgrades to Caché as there is always a fear that something will break after an upgrade is applied. Testing to confirm everything is working as expected is a huge undertaking and requires a lot of organisation. The next opportunity to upgrade Caché will probably be around Sept-Oct 2017.
Thanks Tom, we have implemented something very similar using the $System.License object.
Fixed XML parsing error in mapping_sample2.zip
Try this instead
mapping.example2_fixedxmlparsererror.zip
The MappingExample3.zip archive did not contain any Globals.
Use mappingexample3_withglobals_1.zip if you want to import the global ^ParentChild used in the illustration.
The link in MappingExample4.zip appears to be missing.
I have attached my own version mappingexample4_community_v1.zip including the full ^ParentChild global. This version does not contain example usage of 'Next Code' and 'Invalid Conditions' as referenced in the article.
As a example of using invalid conditions, if you want to skip all the 3rd subscripts in that have "DEL" as the subscript value use {L3}="DEL" as your invalid condition.
Philip sent me his sample files. Here they are datagridproblerm2013.zip
The I+3 is a hard-coded expression. At first it appears arbitrary or random. I have just taken +3 as an example. We have real-world examples of expressions like
When some condition is met
S LINE(I-8)="some value"
When another condition is met
S LINE(I-17)="some value"
The hard-coded offset does not come from a variable. A lack of comments in the code makes it very difficult to understand and debug.
What about using more complex subcommand prefixes such as
ZZMYCOMMAND /MYSWITCH:OPT1:"some_param"
Could you code that using %ZLANG ?
I find RSS feeds for subject groups are useful way to identify new posts. There are sort and filter options for:
I think all online forums suffer from 'unhelpful' and 'badly described' posts. Maybe sorting by 'most votes' or 'most active' would help?
The behavioural issues you describe come from people and it is hard to design a technical solution to "fix" people. Most forums I have used give kudos to users who provide a lot of technical detail and frown upon users who ask one line questions showing no evidence of having tried to find a solution themselves. On balance, all forums need to treat beginners and inexperienced users with respect. We are all ignorant of something and we all have to start with nothing (no knowledge)
Don't be afraid of up-voting or down-voting posts. Sometimes it's useful to link to an older post that dealt with the problem rather than duplicating questions/answers.
Could you share your straightforward code? For searching all routines in a namespace in Cache ObjectScript, I have used Find in Files within Cache Studio (class is %SYS.%Studio.Project) but it looks like you are looking to programmatically replace what is returned as a result. The basic 'Find and Replace' only seems to only apply to the currently active window. I do not know if Atelier has more advanced Find in Files and & Replace feature to search the entire namespace but from the documentation I've read, I suspect not.
Other search facilities I have used include %GCHANGE routine and %RFIND. %GCHANGE has an option for changing the contents of a global - useful if you have XECUTE and indirection (@) statements that call executable code from a global reference. This practice was more common when the size of routines had to be very small and executing statements from within a global reference was one way getting round this limitation. If you have no executable code in globals then %GCHANGE probably doesn't apply.
Check out the ObjectScript function $TEXT to return source code from a routine. You could use ZINSERT and ZREMOVE commands to programmatically alter the contents of source code.
UPDATE: If I was trying to solve this problem. I would do a find in files to get the routine references. Verify the output and copy the contents to a plain text file. Clean up the file if necessary removing data that is not required. Read the contents of the file to obtain the routine references. Use ZINSERT and ZREMOVE to replace the source code contents. You will probably need to re-compile for the changes to take effect.
@Wolf Koelling I had the same problem but there is a work-a-round. There's a article that describes how to download a digital certificate from your CA and import it into the cacerts store using keytool.
One of the difficulties I had was I was unable to modify the cacerts file using keytool because it required admin access to make changes to a file under C:\Program Files(x86)\Java.
Fortunately, you can copy the cacerts file to your user directory and change the eclipse.ini file to reference the new location for your cacerts certificate store.
-Djavax.net.ssl.trustStore=C:/Users/user1/cacerts
Then follow the instructions to download the atelier plugin here
Your installation requirements may be different from mine, so you may want to contact Intersystems WRC for advice specific to your needs. Please understand however that it is a problem with the Java certificate store, used by your JRE, not recognising your CA to allow HTTPS traffic to download the plugin through the eclipse IDE. It is not a firewall issue.
For reference, you can get a list of error codes from General Error Codes and SQL Error Codes . From the error description, it seems to be complaining about the 1st parameter.
If the 'gc' object is a %SQL.Statement then the %Prepare method only takes one parameter. What happens when you pass in pQuery to the %Prepare method?
Have you tried executing the SQL in the SQL Shell or System Management Portal?
do $System.SQL.Shell()
There have been times when I have been asked to provide a 'proof-of-concept' or a 'working example' demonstrating a problem or some unexpected behaviour. With code snippets, it is easy to embed code in a post; however, for more complex examples, it is beneficial to download a working example to test the behaviour out for yourself.
Here are some references to posts where I used the 'file upload' feature.
There is currently provision for pdf, zip, tar, gz, png and jpg file types with files up to 256 MB in size.
