Evgeny Shvarov · Aug 29, 2019 go to post

1 - Is there any plans to automatize the module.xml generation by using something like a Wizard?

Submit an issue?  More over, craft a module which supports that! And PR - it's a Community Package manager.

3 - Is it possible to run pre/post-install scripts as well? Kind of what installer classes do.

I think, this already in place. @Dmitry Maslennikov who contributed a lot will comment.

4 - Is also possible to use the module.xmlto provide a contextual root?

We maybe can use the code! Thanks! @Dmitry Maslennikov ?

Evgeny Shvarov · Aug 27, 2019 go to post

Perfect!

So, what is the setting of this parameter to export classes into:

/src/cls

folder?

Evgeny Shvarov · Aug 27, 2019 go to post

Sorry Vivek. My code provides you the Id of objExternalUser you save (possible create) above. It's 1).

It's not the latest inserted record. I thought you need:

I need RowId of inserted record.

Out of curiosity: why do you need the latest record?

Evgeny Shvarov · Aug 27, 2019 go to post

I agree. I don't know the reasons which caused to limit the MAXLEN to 50 characters... 

It steals months (if not more) of developers time to find out what was the bug and why this doesn't work because of MAXLEN=50;

Evgeny Shvarov · Aug 27, 2019 go to post

As I see in your code you already do some "error handling". So you can continue:

Change your code

Do objExternalUser.%Save()

to the following:

set stat=objExternalUser.%Save()

if $$$ISERR(stat) {

 #; error handling

 d $System.OBJ.DisplayError(stat)

}

HTH.

Out of curiosity - you have empty Try-Catch block. Why don't use it?

you could embrace your code into the following:

$$$TOE(objExternalUser.%Save())

And catch your error with status in catch then.

Evgeny Shvarov · Aug 27, 2019 go to post

Hi @Vivek Nayak!

Always check the status of %Save - it could result in an error. And I think this what was happened in your case.

90% of my "it doesn't save" with %Save caused by MAXLEN of %String property. %String property goes with MAXLEN=50 by default and it's often not enough. Check you have a such ;)

Evgeny Shvarov · Aug 21, 2019 go to post

That's why I like to develop with IRIS docker containers - every time you have clean IRIS with no garbage code, cache, temp globals, whatever... - you have only what you setup in a build dockerfile script.

Evgeny Shvarov · Aug 19, 2019 go to post

Hi Salma!

If you import this file from this Open Exchange project it can do the export classes in folders:

Once imported call this to setup a folder:

USER>do ##class(dev.code).workdir("my/workdir/src")

Call this to export all classes, macro, deepsee resources in a given workdir.

USER> do ##class(dev.code).export()

You also can import the whole package too.

HTH

Evgeny Shvarov · Aug 18, 2019 go to post

Global name is in the var already. Here is the code I needed it for:

ClassMethod InvertList(from, to) As %Status

{



set iter=$o(@from@(""))

while iter'="" {

 set value=@from@(iter)

 set @to@(value)=iter

 set iter=$O(@from@(iter))

 }

}

Evgeny Shvarov · Aug 18, 2019 go to post

Says 

#1038: Private variable not allowed : 'gniter=$na(from)' : Offset:21 [zInvertList+1^Example.Globals.1]

for

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(iter,from)

set value=@from@(iter)

set @to@(value)=iter

$$$EndFor

}
Evgeny Shvarov · Aug 18, 2019 go to post

Maks, thanks for that project!

Do you want to add a sort of "For Each" for a global?

Suppose a have a global ^A(index)=value

And I need to go through all the indexes to do something with the value. 

Currently, I do the following in Objectscript to perform this:

s iter=$Order(^A(""))

while iter'="" {

set value=^A(iter)

/// do something with value

set iter=$O(^A(iter))

}

Would be great to change this to something like that:

zforeach(iter,^A) {

set value=^A(iter)

/// do something with value

}

Evgeny Shvarov · Aug 14, 2019 go to post

Updated the ObjectScript code blocks in your post a bit. 

And don't see any DeepSee cubes here - is this DeepSee related?