go to post David Hockenbroch · Jul 28 Phil, I'm not sure about VS Code, but you can do this in studio by creating a new CSP page with the following contents: <csp:StudioSimpleTemplate name="CustomCommentHead" type="CLS" mode="new"> /// Organization: /// Version 1.0 /// Author/Co-author: /// Project: /// Date: /// Description: /// Change Log: /// Notes: Then save and compile that file. It doesn't matter where. Then when you click File, New, Custom, you'll see your CustomCommentHead template. If you choose it, you'll get a .cls file with those lines already inserted.
go to post David Hockenbroch · Jun 29 If you're developing in Studio, open the file that contains that TestAccountSearchWithoutAccount method, then click the "View Other Code" button so you're looking at the INT code. If it says no other code to view, that's fine; you're already where you need to be. There should be a small text field near the top of the window with a drop down arrow on its left end. In that text field, type TestAccountSearchWithoutAccount+6 and press enter. That should take you directly to the line where the error is occurring. Something on that line is trying to reference an object that doesn't exist. That's what "INVALID OREF" means. Whatever objects are on that line, check how they were created and/or opened and see if there's a chance that the object doesn't exist.
go to post David Hockenbroch · Jun 22 The columns have a clientType property. Is that what you're looking for? That would be: set colType = cols.GetAt(x).clientType That will get you an integer that corresponds to a data type, as documented here. So if that clientType is 1 it's Binary, 2 is a date, 3 is a double, and so on.
go to post David Hockenbroch · Jun 21 After using your %ExecDirect() method, you should have a %SQL.StatementResult Object. Let's assume you called this object rs (for result set). So you did something like set rs = ##class(%SQL.Statement).%ExecDirect(blahblahblah). From there: //Get the list of columnsset cols = rs.%GetMetaData().columns//Loop through the result objectwhile rs.%Next(){//Loop through the columns for x=1:1:rs.%ResultColumnCount{ //Get the value of each column set colValue = rs.%GetData(x) //Get the name of each column set colName = cols.GetAt(x).colName //TODO: Add whatever you're doing with the name and value here }}
go to post David Hockenbroch · Jan 18 Here's some documentation on the INTO clause. As Robert already said, though, it's a way to do an embedded query and store the result columns into variables in the host language.
go to post David Hockenbroch · Jan 10 Are you sure that's where your problem is? If I do: select MONTH(dateadd(mm,-1,GETDATE())) I get 12. If I create a query with a where clause similar to yours on my data, it works as expected.
go to post David Hockenbroch · Nov 18, 2022 Is that what you want to do, or should you be defining your property as: Property Status As %String(VALUELIST = ",InProgress,Done,Canceled") [ InitialExpression = "InProgress" ]; This makes InProgress the default status when a new CarDealer.Order is created.
go to post David Hockenbroch · Nov 15, 2022 This might be easier to do with XPath rather than a loop. First, you'll need to create a %XML.XPATH.Document object, maybe using the create from string method: set sc = ##class(%XML.XPATH.Document).CreateFromString(xmlstring,.mydoc) Check that the status you get back from that is not an error. If it isn't, you mydoc should be an XPath document. Then you should be able to use the EvaluateExpression method of that document to get what you want, something like: set sc = mydoc.EvaluateExpression("/Msg/Parties/Party[AgentId=1]/OrgCode","",.value) If that status is okay, the value you're looking for will be in value, unless there are multiple XML nodes that match that path. W3 provides the XPath syntax specification here.
go to post David Hockenbroch · Nov 7, 2022 I've had to do this a time or two in a development environment. Sometimes you can find it under System Operation > Processes and terminate the process. If that doesn't work, you can look at the process ID of the process and kill it at the OS level (the kill command in Linux, or taskkill in Windows). Just be aware that depending on what it's doing and how the task was written, you may end up with some weird stuff.
go to post David Hockenbroch · Oct 10, 2022 Others have already explained why you can't use those list functions on a list of datatype. As an alternative approach, though, you could change your persistent class to save the original string that you are using to create the list, then use your $ListFromString etc. on that as you have been.
go to post David Hockenbroch · Oct 7, 2022 Is oneFldLogin.cls the login page for the application? Go to your management portal, System Administration, Security, Applications, Web Applications, and find the web app. At the bottom, under Custom Pages, is that set as the login page? If you open it in Studio or VS Code, does oneFldLogin.cls extend %CSP.Login?
go to post David Hockenbroch · Sep 29, 2022 You could create a new class that extends %ZEN.Component.toolbar, and override the ongetdata property to be a certain method name, then define that method in the class. Then you'd have your own custom tag to use in your zen pages. Here's more information on creating custom Zen components. Inevitably, though, someone is going to come in here and tell you not to use Zen in any new development because it's deprecated, FYI. Which makes me sad, because I still really like working with it.
go to post David Hockenbroch · Sep 29, 2022 In the management portal, go to System Administration, Security, Applications, Web Applications and find your application. Under security settings, disable Unauthenticated, and enable Password. Then, when you send your requests, you need to include a base 64 encoded basic authentication header with the username and password, or on the end of the URL include ?CacheUserName=username&CachePassword=password. Keep in mind, though, that if you aren't using HTTPS, you could end up transmitting a username and password in plain text or in a very easily decrypted way. If you want only specific users to be able to access the API, consider creating a new Resource then setting that resource as the Resource Required in the security settings, then only giving that resource to people who need to access the API.
go to post David Hockenbroch · Sep 28, 2022 Here's the documentation for that function. It looks like ##CLASS(Ens.Util.FunctionSet).Lookup("AllowLT", pRequest.GetValueAt("OBR:21"),"0",4) would do what you're asking; if the table or value can't be found, it'll return a 0.
go to post David Hockenbroch · Sep 22, 2022 If you have multiple cursors anywhere in the class with the same name, that will come up. If it says C10, then you must have two different places where you're doing a "DECLARE C10 CURSOR FOR . . ." and you'll have to rename one of those cursors.
go to post David Hockenbroch · Jul 29, 2022 You can probably make that work, but why not put the method in a %CSP.REST class to start with and have the CSP page call it? That seems more in line with the way those things are meant to be used.
go to post David Hockenbroch · Jul 18, 2022 I think what you're looking for might be setting the isolation level to read committed. This will make the process wait for the in-progress changes have been committed, though you'll still want to make sure you handle SQLCODE -114 somehow, too. That's the code you get back if there's a timeout waiting for the lock. You should be able to set that using: %SYSTEM.SQL.Util.SetOption("IsolationMode",1,.oldval) If you do that before your query, the rest of the process will run at that isolation level. You can use that same method to set the LockTimeout too, by the way. Default is 10 seconds.
go to post David Hockenbroch · Jul 18, 2022 The error seems to occur when it's trying to access the log file. Under you advanced settings, have you checked where it's trying to find or create your log file and made sure it's valid?
go to post David Hockenbroch · Jun 6, 2022 Double check your IP address and port in the settings on the Preferred Server menu.