You could do as Robert said, or you could create an SQL gateway connection to the execution namespace and query it from the original namespace.
- Log in to post comments
You could do as Robert said, or you could create an SQL gateway connection to the execution namespace and query it from the original namespace.
I'm just curious why you would want to convert from JSON to a result set? Everything I could think of that would make you want to do that would be better served by using a %Library.DynamicArray.
If this is your application and your Entra instance, you may check the application's manifest (in Entra, go to app registrations, click your app, then click manifest) and make sure there isn't an accessTokenAcceptedVersion or requestedAccessTokenVersion that is set to 1. That would require you to use the older endpoints, not the v2 ones you are trying to access. It will need to be set to null or 2.

No need to get fancy with extra apps and paid services. You can usually email a text message to a phone using plain old SMTP if you know the provider so you can look up the SMS gateway for them. Here are some of the biggest ones, at least where I am:
If your provider isn't on that list, you can most likely find the SMS gateway via a simple Google search. Then you can send an email using the phone number and that domain as the recipient, and it will go to the phone as a text message with a subject line. For example, if you send an email to a Verizon user, the email address would look something like 5551234567@vtext.com. You can even do this from within Outlook or Gmail if you want to test it out. Mind the character limits, of course.
Several of these are already stored in IRIS. When you create or edit a user, you have an option there to select a mobile provider. You can also add new providers which requires a name and the SMS gateway. These are stored in a table called %SYS.PhoneProviders.
Thank you for the good review, Robert; That makes me feel like a DC celebrity! 🙂
I have corrected the return types and resubmitted the application for approval for IPM, so once that's approved, this should be fixed.
This kind of very small but impactful tinkering with the existing functionality is one of my favorite things to do.
If your goal is to set a value on insert, you don't need a trigger for that. You can just declare that property with an InitialExpression defined.
That is already true as seen in Vitaliy's comment above. Personally, I prefer to use {}.%New() and then use the %Set method because you can provide a third argument to explicitly say whether the value you are adding is a number, string, boolean, stream, etc. to eliminate any ambiguity. We have alphanumeric fields that should be considered strings, but if they happen to be all numbers, they are incorrectly inserted as numeric values in JSON if we don't specify.
If you have Auditing turned on, you can check your audit log for login failures in system management portal. That will tell you why the login failed, which might point you in the right direction.
Does the test user account have the right security resources to access the database you're trying to log into? The quick easy way to check if you have a security-related issue is to give the test user the %All role and see if the issue goes away. If it does, you need to figure out what resource/role is missing for the user account. You don't want to permanently leave the %All role on there.
Yes. You can use a variable name starting with ^, like ^MyGlobal, and it will be a global. You will not be able to access it via SQL, but you will be able to see it with the globals in the system management portal. You can also reference globals in a different namespace by using ^|"namespace"|MyGlobal.
It might be nice to make such tracking conditional. Like "Log all queries that take over 10 seconds to run" or whatever number is appropriate for your usage.
The only places I know of are, if it caused an xDBC error, that in the system management portal under System Operation, System Logs, xDBC Error Logs, and if it was a query run through the management portal itself, you'd be looking in the global %sqlcq and for your search mask, use %sqlcq("NAMESPACE","SMPQueryHistory","USERNAME" to see the query history for a specific user. That's where the query history you see in the SQL section of the management portal is stored.
I don't know of anything overall, though.
All we can tell from this is that in the class gen.Custom.HS.Model.OEOrdItem.TabularTextResultsEMR, you have a method called GetData, and on line 872 of the .1 file for that class, you have a variable named rs that is undefined.
I'll echo the idea that you don't really want to be using the /api/atelier web app this way because of the %Development requirement and the arbitrary SQL execution, and because it includes a lot of other functionality that you probably don't want people to have access to.
BUT if you're really intent on using that API, then you could make your own web application in the management portal that uses the same dispatch class that /api/atelier does and create a new resource to be the required resource to access it. Make sure your users have permission to use that resource, and then assign the appropriate table and view permissions in a role that you either give to those users or assign to the Web Application as an application role.
Are you looking for something like:
ClassMethod ExceptionTest() [ Language = python ]
{
import sys
import iris
import traceback
try:
print(1/0)
except ZeroDivisionError as e:
errobj=iris.cls("%Exception.General")._New(str(e),42)
stack_trace_list = traceback.format_tb(e.__traceback__)
if stack_trace_list:
last_instruction_line = stack_trace_list[-1].strip()
errobj.Location = last_instruction_line
a = errobj.Log()
}Which gives:
.png)
Page not found, or Invalid Action? If it's page not found, how is the web application configured?
@Enrico Parisi , with Global Masters, we get a few points for having an answer marked as correct on the community. People often only mark the first correct answer they see. So if the user who posted the question didn't see this thread before the AI bot's post appeared, it's somewhat likely that the bot's post will be marked as the correct answer even though a human user answered the question first. That's all. Seems just a little unfair to me.
@DC AI Bot
When I checked on this post earlier today, Vitaliy's correct answer was here, but the AI Bot's was not. Now it's showing here as if the AI Bot's answer was first. That is troublesome, particularly if Vitaliy is a Global Masters user.
The specific issue here is probably that when you tried to set text = type.%Get("text"), the variable "type" wasn't an object because it didn't exist or wasn't a dynamic object/array within the original object. You might want to try:
set iter = identifiers.%GetIterator()
while iter.%GetNext(.key, .value, .type ) {
set type = value.%Get("type")
if $ISOBJECT(type){
set text = type.%Get("text")
}
else{
set text = ""
//Or whatever you wanted to do if type wasn't an object.
}Maikel, if your variable is named var in your ObjectScript code, then you would use where xyz = :var in the embedded query. The colon marks that this is a host variable.
You can set this up using your routine mappings. You can have each namespace have a different database for its globals but share a database for the routines. Then they'll all have their own data, but be running off of the same code.
I only have back to Cache 2018, not 2017, but can you try:
set myproc = ##class(%SYS.ProcessQuery).%OpenId($J)
if myproc.ClientExecutableName = "CSTUDIO.EXE"{
//You are in Cache Studio
}
else{
//You are not in Cache Studio
}I'm not totally clear on what you're trying to do, but I have a feeling you might want to replace "quit" with "return status". Inside a catch block, a quit command will quit just the catch block and code execution will continue after it. Replacing that with return status would make the code execution stop right there, returning the error.
Here's my small but useful contribution:
Look in the System Management Portal under System Administration, Security, Applications, Web Applications, and look for the /csp/sys application. That's the System Management Portal. You can probably set a required resource there, and then only people who have that resource should be able to access it. You'll probably want to make a new resource, not just use an existing one. Just make sure you have that resource before you make that change so you don't lock yourself out!
Calling the methods this way is effective for testing the methods, yes. You just want to get really familiar with the %CSP.Request class. This approach isn't a good way to troubleshoot issues with your routes, or with authentication, though, as it bypasses those steps. For that, you'd probably have to define %request appropriately, then call some of the methods your API inherits from %CSP.REST, but I'm not as familiar with those.
And in addition to all of that, one of the workarounds people seem to like using is to have things comma-separated and enclosed in " to make sure it's getting the right commas, but I'm working on ERP software for the millwork industry in America. We're still allergic to metric here, and we use " to mean inches and ' to mean feet, so we can't use those either!
I know it's odd, but I've had three separate companies ask me for data formatted this way in the past couple of years. I'm not sure why, other than that the pipe is less common to run into within the data than commas.
We have had a few people ask for a CSV using a pipe as a separator. If you run into that and need to open it in Excel, you do that by going to the data tab, then click From Text/CSV. It may detect the separator character automatically, but if not there is a place where you can set it. (You may want to right click on the GIF and open in new tab if it's too fuzzy.)