Eduard Lebedyuk · Aug 27, 2019 go to post

It's a %GlobalCharacter stream.

In BPL I need to create it and write a few lines inside before sending it to BO.

Eduard Lebedyuk · Aug 23, 2019 go to post

I'd add another Operation called MockSOAPOperation which accepts SOAP requests and calls your method.

After that change Business Host setting(s) to point to this mock operation.

Eduard Lebedyuk · Aug 23, 2019 go to post

In jQuery you don't need Allow* headers.

On server try this for TESTING ONLY:

Do %response.SetHeader("Access-Control-Allow-Origin",..GetOrigins())
Do %response.SetHeader("Access-Control-Allow-Credentials","true")
Do %response.SetHeader("Access-Control-Allow-Methods","GET, PUT, POST, DELETE, OPTIONS")
Do %response.SetHeader("Access-Control-Max-Age","10000")
Do %response.SetHeader("Access-Control-Allow-Headers","Content-Type, Authorization, Accept-Language, X-Requested-With")

And GetOrigins

/// Get Origin from %request object
ClassMethod GetOrigins() As %String
{
    set url = %request.GetCgiEnv("HTTP_REFERER")
    return $p(url,"/",1,3) // get http(s)://origin.com:port
}
Eduard Lebedyuk · Aug 22, 2019 go to post

You can alter queries via Studio/Atelier/VS Code IDEs.

In portal you can run DROP QUERY and create the query again.

Eduard Lebedyuk · Aug 19, 2019 go to post

Please describe your use case?

Do you need one time adjustment? If so move globals.

If children can freely change parents, consider one-many relationship instead.

Eduard Lebedyuk · Aug 19, 2019 go to post

I never use hardcoded global names in code, all global references are defied as macros (preferable) or parameters (allows overloads).

Readme or documentation can provide some additional information on used globals but more as a reference.

Eduard Lebedyuk · Aug 18, 2019 go to post

Solved.

Streams are not passed only for overloaded methods.
This does not work:


public class API {
    public void sendMessage(byte[] msg) throws Exception {}
    public void sendMessage(byte[] msg, String Id) throws Exception {}
}

However this does:

public class API {
    public void sendMessage(byte[] msg) throws Exception {}
    public void sendMessageId(byte[] msg, String Id) throws Exception {}
}
Eduard Lebedyuk · Aug 18, 2019 go to post

Try it like this:

/// d ##class(isc.test.Utils).Test2()
ClassMethod Test2()
{
    set from = "^A"
    set to = "^B"
    kill @from, @to
    set @from@(1) = "A"
    set @from@(2) = "B"
    set @from@(3) = "C"
    
    do ..InvertList(from, to)
    
    zwrite @from,@to
}

ClassMethod InvertList(from, to) As %Status
{
    #define ForAll(%in,%gn) s gn%in=$na(%gn) s %in="" f { s %in=$o(@gn%in@(%in)) q:%in=""
    #define EndFor }

    $$$ForAll(key, @from)
        set @to@(@from@(key))=key
    $$$EndFor
}

For me it returns

^A(1)="A"
^A(2)="B"
^A(3)="C"
^B("A")=1
^B("B")=2
^B("C")=3
Eduard Lebedyuk · Aug 18, 2019 go to post

Enjoy.

#define ForAll(%in,%gn) s gn%in=$na(%gn) s %in="" f { s %in=$o(@gn%in@(%in)) q:%in=""
#define EndFor  }

set glvn = "^MyGlobal"
$$$ForAll(value, @glvn)
    write value,!
$$$EndFor
Eduard Lebedyuk · Aug 18, 2019 go to post

Metrics can store history, i.e.:

Property MetricProperty As Ens.DataType.Metric (AUTOHISTORY=50) [MultiDimensional];

Docs.

Eduard Lebedyuk · Aug 16, 2019 go to post

Check @Alexey.Maslovanswer - it is a correct solution for your use case.

Still, to set environment variables for current you can use this utility.

Eduard Lebedyuk · Aug 12, 2019 go to post

Extend %Fileman class:

Class MyFilemanDate Extends %FilemanDate {

Parameter STRICTDATA = 1;

}

And call it:

##class(MyFilemanDate).LogicalToDate()
Eduard Lebedyuk · Aug 12, 2019 go to post

Two ways I know how to add your page:

1. To DeepSee User Portal (from Analyze This):

Set tItem=##class(%DeepSee.UserLibrary.Link).%New()
Set tItem.fullName="Analyze This"
Set tPage="AnalyzeThis.UI.CSVImport.zen"
Set tItem.href=$system.CSP.GetPortalApp($namespace,tPage) _ tPage
Set tItem.title="Analyze This"
Set tSC=tItem.%Save()

2. To Favorites:

set sc = ##class(%SYS.Portal.Users).%AddFavorite("Name", "URL")

Eduard Lebedyuk · Aug 12, 2019 go to post

Datatype parameters can be set as properties parameters.

In your case you have a property somewhere:

Property myDate %FilemanDate;

You need to modify it like this:

Property myDate %FilemanDate(STRICTDATA=1);

And recompile the class.

Eduard Lebedyuk · Aug 9, 2019 go to post

Documentation states there's an argument SubDir As %Boolean = 0 in ExportAllClassesIndividual  method.

Description: If SubDir is true then it will export sub-packages as subdirectories.

Try setting it to 1.

Eduard Lebedyuk · Aug 8, 2019 go to post

Classes extending %Persistent with default Storage have GetStored method for persistent properties.

SYS.Database in your case has custom storage, that's why this method does not exist.