PDA

View Full Version : vvFormat.object part of vvFormat_toJSON


mjhaston
06-25-2008, 01:30 PM
I'm sure I'm doing something wrong. It seems like my environment isn't setup correctly. I've changed the code below to:

vvFormat.object='A1000';

and then possibly this:

vvFormat.object='APPLIB30/A1000';



chain ( 'EK' : '01' : Xcusno ) a1000 @cusRecord2;
if %found(a1000);
//vvFormat.object='DEMOCMAST';
vvFormat.object='A1000';
vvFormat.success='Y';
@data = vvFormat_toJSON(vvFormat:%addr(@cusRecord2));
vvHttp_out(@data:JSON);
else;
vvHttp_out('{"SUCCESS":"0","MSGTXT":"Invalid Customer"}':JSON);
endif;



This runs fine interactively, when my library list is setup. I did add the necessary libraries to my test environment. I'm wondering what I'm doing wrong to get this message:

The value in this field is invalid.



When I check out the response in Firebug it's ....


[{text:"Administration",leaf:false,qtip:"Administration Options",expandable:true,children:[{text:"Users"

,leaf:true,qtip:"work with users and authorizations (vvUsers)",misc1:"VVUSERS",misc2:"vvusers.pgm",misc3

:"*SPL",expandable:false},{text:"Groups",leaf:true,qtip:"work with groups (vvGrps)",misc1:"VVGRPS",misc2

:"vvgrps.pgm",misc3:"*SPL",expandable:false},{text:"Options",leaf:true,qtip:"work with options (vvOpts

)",misc1:"VVOPTS",misc2:"vvopts.pgm",misc3:"*SPL",expandable:false},{text:"Environments",leaf:true,qtip

sean.lanktree
06-25-2008, 01:41 PM
Are you retrieving the session ID at the beginning of your program?

If so, you can use the following procedure to set up your library list:


yourSessionIDVariable=vvHttp_in('sid');
vvUtility_setLibToEnv(yourSessionIDVariable);


After the call to this procedure, you can open your A1000 file.

mjhaston
06-25-2008, 02:14 PM
Thanks Sean. Turns out I was missing a couple of things dealing with the session. Got it working. Sweet.




var sid = parent.getSid();

params: {sid: sid, action: 'getCustRec', xcusno: Ext.getCmp('XCUSNO').getValue()},