Javascript code to get current session object and its association

0
I have an entity as shown below Can someone help me on getting AppSettings object associated with the Current Session using Javascript. I tried as below  mx.data.get({         xpath : "//System.Session",         filter: {             sort:[["LastActive","desc"]],             references : {                         "MyAppModule.AppSettings_Session" : { }             }         },        callback : function(sessionObjs){             alert(sessionObjs[0].getReferences("MyAppModule.AppSettings_Session"));        } }); Above code gives me session object but how can I make sure it is current session object and also need to find the AppSettings object associated with current session object sessionObjs[0].getReferences("MyAppModule.AppSettings_Session")) is not returning any data. I see an association created in database tables
asked
2 answers
3

Hi Mohan,

Keep in mind that retrieves from the client are always subject to the security and access rules.

I would suggest that you setup the access rights so that current user can only access one AppSettings object.

then you can retrieve this by

mx.data.get({
       xpath : "//MyModule.AppSettings",
       callback : function(o){
            o
       }

});

Hope this helps,

Andrej

answered
0

Is there a way to get the current active session and its guid using javascript?

answered