Question Alex Kogan · Apr 5, 2022

I have a few Radio buttons, some of which have to have the same value.  I need to know which one the user have selected, so I am using text, however it does not work well so far.

Example: 
I have 4 Radio buttons: Apple, Pear, Lemon and Orange, with values: Apple, Pear have Value 1, and Lemon and Orange have Value of 2
(this unfortunatelly cannot be changed for this particular application)

I need to figure out that the user picked specifically Apple, so I am using text as follows:

5
0 185
Question Alex Kogan · Apr 26, 2021

Hello,

I have a quick question regarding TSTART, however not certain if there is an answer.

If I am inside the transaction and I loose connection - I always assumed that transaction would TROLLBACK, however it does not.

Is there anything special I need to set up with my TSTART, in order for this transaction to safely rollback?

*********

As example: Let's say I am inside the TSTART and setting up / altering some data and my VPN connection got disconnected.  I kind of expect all the data to be rolled back.  

Thank you,

Alex

6
0 258
Question Alex Kogan · Mar 5, 2021

I have a quick question regarding swizzled objects.

I have an original object, say Object a, I am working with.

I set a property a.something.somethingother.somethingelse.myNewProperty  to some value x.

Then at some point I am saving a and continuing to work with it.  I assume here by saving a, I saved myNewProperty as well. (as it should work)

5
0 457
Article Alex Kogan · Jan 22, 2021 2m read

This concept may be known to some, but I just found it very useful and I would like to share as it may help someone else.

If you are working with CSP or Zen you sometimes come across the need to use embedded JavaScript. Suppose you are working with some loops, which use < or > as shown in example below:

&js< 

               var test = document.getElementById('seTest');

               for (var i = 0; i < test.options.length; i++) {

                              // Do Something here with my test.options[i]...

               }             

>

2
5 554
Article Alex Kogan · Nov 15, 2020 11m read

Hello all,

               I would like to share the Foreign Key setup I recently used for my project and found it is very useful.  When asking around, I realized that there are some developers out there, who would like more information on explicit foreign key setup, so I would like to briefly discuss explicit foreign key setup and give a quick sample on how to set it up

3
1 817
Discussion Alex Kogan · Jan 16, 2020

This is a lesson learned, which I would like to share with community.  


Recently I ran into an issue, where I was using %ConstructClone and it kept cloning extra records, which were not needed.  The record for which I was trying to run a clone had many-to-one relationships.  

The solution to this issue was using param -1.  If you run %ConstructClone(-1) it will not clone relationships, but rather just clone single oref as desired in this case.


I hope this information helps someone who is working with similar records.

0
0 539
Question Alex Kogan · Nov 5, 2019

I have a custom written date, setup as myDate in my application, which always behaved fine for years, and now it's acting a little weird. 

When I run SQL in Display mode the date shows as 1/10/1841 for some but not ALL rows.

When I run the same exact query in logical Mode the date shows normal format, in my case, for example 10/1/2019.  When the application is running is shows the incorrect date.  When I run the terminal session and open a ref point and ask to write a date is shows 10/1/2019, but I am expecting internal format here - 65287.   

4
0 378
Question Alex Kogan · Sep 5, 2019

Hello,

I have a small SQL question.  

Running an example queries in our Samples Namespace: 

1. select top 5 Description,Category from Cinema.Film order by Category - runs fine no issues and returns 2 columns as expected

2. select top 5 * from Cinema.Film order by Category - runs fine no issues and returns 8 columns as expected

3. select top 5 Description,Category,* from Cinema.Film order by ID - runs fine no issues, and returns 10 columns, with my first 2 repeated

4. When I try to combine the first 2 queries: 

select top 5 Description,Category,* from Cinema.Film order by Category

I get an error:

4
0 223
Question Alex Kogan · Jun 4, 2019

Hello,

I assume there is a simple explanation for this, but I do get <OBJECT DISPATCH> error, when I am trying to set a global to a value.

My example is huge, but I reproduced it using Samples namespace:  

First I delete the Title from ##class(Cinema.Film)  - 3 

Secondly:

SAMPLES>s ref=##class(Cinema.Film).%OpenId(3)
SAMPLES>w ref.Title

SAMPLES>set ^AK(1)=$G(ref.Title)

SET ^AK(1)=$G(ref.Title)
^
<OBJECT DISPATCH> *Property 'Title' in class 'Cinema.Film' must be MultiDimensional

$D also does not work, same error, however this works fine: if ref.Title S ^AK(1)=ref.Title

4
0 1031
Question Alex Kogan · Feb 1, 2019

Hello all,

I have an XSL question and I wanted to see if someone within a community can help me out.  

To Summarize: I am working with XSL documents, single and multi-pages.  
Inside my style sheet XML document, which is supporting my pages, everything on the page, including a headers, footers and the items are calculated 
based on the portrait measurements. 
Pages come up on the screen as portrait, but sometimes, depending on dynamic data are wide, they do not print properly in portrait.

1
0 515
Question Alex Kogan · Nov 15, 2018

Greetings all,

I have a quick SQL question.  I am working with a class, which has a calculated property, which in turned indexed.
The calculation for this property is created based on another property value via: 
SqlComputeOnChange = attributes  - so basically every time I add a property attribute to my class, my new property 
is calculated based on some SqlComputeCode which calls some class method.

That initial setup works as designed.

1
0 314
Question Alex Kogan · Jun 14, 2018

Hello All,

I hope it's not a silly question. 

Here is my issue:
I have 3 simple classes:

Parent class, let's say:

Class ParentClass Extends %RegisteredObject
{
 Property a As %String;
}
 
and two children classes
Class A.Child Extends ParentClass
{
Property b As %String;
}

Class B.Child Extends ParentClass
{
Property c As %String;
}

So no issues - all compiles and seem to work.

But, when I add %XML.Adaptor to my parent class, so:

Class ParentClass Extends (%RegisteredObject, %XML.Adaptor)
{
 Property a As %String;

3
0 1249
Question Alex Kogan · Jan 11, 2018

My questions are regarding ClassMethods with a private keyword tags.

When we use a wizard to add a new method, we are given a options to
select private checkbox to make it a private method as well as 
Class Method checkbox in the same time. 

1. What would be the reason and the case to select and use them both?   
2. Secondly, if there is such a case in already developed application is it
safe to remove the private tag from ClassMethod? Obviously if it's not a 
ClassMethod private tag cannot be removed as easily.

Thank you,

11
0 604
Question Alex Kogan · Nov 28, 2017

Hello,

I was wondering if there is a way to maybe temporarily alter the [Private] tag dynamically or any other way to run a Unit test against class method, which has been labeled as [Private]?

I mean, I understand there is a workaround to create a non private class method inside this class, which will in turn call this private method  and run a Unit test on the non private method, but I am looking for a way to do this without altering the original class.

Thank you,

Alex

2
0 414
Question Alex Kogan · May 12, 2017

Hello All,

I have a question / issue regarding the calling list.FindOref(<object from indexOpen call>)
Here is a simple way to reproduce the issue: 
2 classes: Utility.contacttypes and Utility.person
*************************

Class Utility.contacttypes Extends %Persistent
{
Property description As %Library.String(TRUNCATE = 1);
/// Index for property description
Index descriptionIndex On description [ Unique ];
}

*************************

5
0 401
Question Alex Kogan · May 8, 2017

I am using a method: %OverrideGuidAssignment("NEW GUID HERE") to override my GUID, and would like to know if there are any parameters, which allow this method to return a status & or error msg? If you currently set it to a variable it returns the new GUID you originally passed in, regardless of if it failed to override or not.

Thank you in advance

5
0 473