Hi all,
I'm testing triggers with javascript...
My question is should I have to specify an application to run the javascript below? Or leave it to blank?
Thanks
Hi all,
I'm testing triggers with javascript...
My question is should I have to specify an application to run the javascript below? Or leave it to blank?
Thanks
Have you a clue about passing from a trigger the $file to scriptlibrary?
thanks
You asked about that in another thread where you got many answers but you provided very little information about what you where attempting to do.
In the trigger I want to launch a script from the script library which call a rad app.
My trigger code is :
system.library.Test.Java_ScriptExecute( "scriptname", system.vars.$File);
My Script library:
function Java_ScriptExecute( scriptname, record )
{
print("coucou JS");
var rteReturnValue = new SCDatum();
var argNames = new SCDatum();
var argVals = new SCDatum();
argVals.setType(8);
argNames.setType(8);
var argVal;
argVal=new SCDatum();
argVal.setType(2);
argVal.push("name");
argVal.push("file") ;
argVal.push("boolean1") ;
argNames.push(argVal);
argVal=new SCDatum();
argVal.setType(2);
argVal.push(scriptname);
argVal.push(record) ;
argVal.push("true") ;
argVals.push(argVal);
// print(argVals) ;
system.functions.rtecall("callrad",
rteReturnValue,
"script.execute",
argNames,
argVals,
true);
}
My script simply do
print(system.vars.$script.subcategory);
Hope it helps
Change
system.library.Test.Java_ScriptExecute( "scriptname", system.vars.$File);
to
system.library.Test.Java_ScriptExecute( "scriptname", record);
And in the scriptlibrary do not use the name record as the file variable as this conflicts with triggers. User for example localrecord instead.
I have replace the system.library.Test.Java_ScriptExecute( "scriptname", system.oldrecord) this bug and close my client. This is my sc.log file:
14043 11/05/2008 16:59:43 ==== received signal 11, errno was 0, code was 1, when accessing address 0x00000034 ====
14043 11/05/2008 16:59:43 0x003590F0 (+0x0048) sytermCatchWithInfo(0xB,0xFFBEDE08,0xFFBEDB50,0x0, 0x0,0x0) - scenter
14043 11/05/2008 16:59:43 0xFF0FB218 (+0x000C) __sighndlr(0xB,0xFFBEDE08,0xFFBEDB50,0x3590A8,0x6F 9CA0,0x6F9C90) - libthread.so.1
14043 11/05/2008 16:59:43 0xFF0F821C (+0x0708) sigacthandler(0xB,0x6F9BF8,0x0,0x0,0x0,0xFF10C000) - libthread.so.1
14043 11/05/2008 16:59:43 0x000C10F4 (+0x0080) dacopy(0x20,0xFC4758,0x98C984,0x0,0xFC4758,0x0) - scenter
14043 11/05/2008 16:59:43 0x004665BC (+0x03B0) _Z16functions_commoniP9JSContextP8JSObjectjPlS3_(0 xEC,0x98A070,0x98D018,0x6,0xB545F4,0xFFBEE0F4) - scenter
14043 11/05/2008 16:59:43 0x0046A42C (+0x0030) _Z6f236JSP9JSContextP8JSObjectjPlS3_(0x98A070,0x98 D018,0x6,0xB545F4,0xFFBEE0F4,0x45F034) - scenter
14043 11/05/2008 16:59:43 0x004FEBF4 (+0x0624) js_Invoke(0x46A3FC,0xB5460C,0x0,0x0,0x98D018,0xB54 5EC) - scenter
14043 11/05/2008 16:59:43 0x00506850 (+0x7150) js_Interpret(0x0,0x80000000,0x8,0xFC7C70,0x8C9E30, 0xB54558) - scenter
14043 11/05/2008 16:59:43 0x004FEC54 (+0x0684) js_Invoke(0x0,0xB54538,0x0,0xF379E0,0x98B748,0xB54 530) - scenter
14043 11/05/2008 16:59:43 0x004FEE78 (+0x00B8) js_InternalInvoke(0x0,0x0,0x0,0xFFBEE438,0x98A070, 0x0) - scenter
14043 11/05/2008 16:59:43 0x004DA3B4 (+0x001C) JS_CallFunction(0x98A070,0x98B748,0x1089CD8,0x0,0x 0,0xFFBEE62C) - scenter
14043 11/05/2008 16:59:43 0x00448C50 (+0x01D4) _ZNK11CJsCallable9RawInvokeEP8JSObjectiPlS2_(0x107 C940,0x0,0x0,0x0,0xFFBEE62C,0x6FA278) - scenter
14043 11/05/2008 16:59:43 0x00455404 (+0x0024) _ZNK11CJsCallable4EvalEP5datum(0x107C940,0xD02C80, 0x0,0x0,0x0,0x0) - scenter
14043 11/05/2008 16:59:43 0x00453238 (+0x03CC) EvalJScriptExpression(0xD02C80,0x10332B40,0x1,0xFF BEE988,0x3A,0xFFBEE988) - scenter
14043 11/05/2008 16:59:43 0x0036BC5C (+0x0094) _jscriptTrigger(0xFFBEE980,0x6FF330,0x1,0xFFFFFFF8 ,0x0,0x84C2A0) - scenter
14043 11/05/2008 16:59:43 0x0036B768 (+0x0B0C) CallTrigger(0x849438,0xFFBEE980,0x4,0x849550,0x849 568,0x4) - scenter
14043 11/05/2008 16:59:43 0x0036D06C (+0x028C) triggerCall(0x849438,0x4,0x849550,0x849568,0x0,0x8 49550) - scenter
14043 11/05/2008 16:59:43 0x000E0A8C (+0x0C28) dbUpdate(0x849438,0x8494E8,0x0,0x0,0xFFBEEC54,0xFF BEED18) - scenter
14043 11/05/2008 16:59:43 0x0022F580 (+0x0864) pdbsUpdate(0x8B28B8,0xFFBEED20,0xFFFFFFFF,0x6FBA5C ,0x6FBA68,0x6FA278) - scenter
14043 11/05/2008 16:59:43 0x0021B618 (+0x0310) pdbUpdate(0x8B28B8,0x8B2818,0x1,0xFFBEEFF0,0xCF714 0,0x8B29B8) - scenter
14043 11/05/2008 16:59:43 0x00425EAC (+0x000C) evrupVar(0x8B28B8,0x31,0x1,0xCF7140,0xCF7140,0x120 ) - scenter
14043 11/05/2008 16:59:43 0x00425FA0 (+0x00DC) evrup(0x8B2898,0x9,0x1037BA80,0x72DF64,0x6FA278,0x 6EB178) - scenter
14043 11/05/2008 16:59:43 0x00122D94 (+0x04EC) _evalOperator(0x8B2898,0x1,0xFFBEEFF0,0x103DEEB8,0 x10204830,0xFFFFFE00) - scenter
14043 11/05/2008 16:59:43 0x00123478 (+0x03BC) eval1(0x8B2898,0x0,0x103B8E58,0xFFBEEFF0,0xCF714C, 0x8B2898) - scenter
14043 11/05/2008 16:59:43 0x0012148C (+0x0314) eval(0x63CBF8,0x0,0x0,0x3,0x3,0x84C2A0) - scenter
14043 11/05/2008 16:59:43 0x0035C180 (+0x0078) ThreadRunNew(0x84C2A0,0x3E8,0x0,0x3,0x6FD524,0x84C 2A0) - scenter
14043 11/05/2008 16:59:43 0x0035C084 (+0x02C8) ThreadReceiveInput(0x1156ED8,0x65E5B8,0x8D33A8,0x3 8F,0x6FA278,0x6D616667) - scenter
14043 11/05/2008 16:59:43 0x004973E8 (+0x10C4) _ZN6CTopaz7executeEP9CThreadIO(0x84ACE0,0xAF6248,0 xFFFFFFFF,0x3,0x84B728,0x496324) - scenter
14043 11/05/2008 16:59:43 0x004962C8 (+0x07B8) _ZN6CTopaz9processIOEv(0x84ACE0,0xFFBEF3B8,0x0,0x3 ,0x6FA278,0x84ACE0) - scenter
14043 11/05/2008 16:59:43 0x004927B8 (+0x02D0) _ZN6CTopaz7processEPcS0_RP16cCollAttachments(0x84A CE0,0x1215760,0x10DF4B0,0xFFBEF63C,0xFE8C36,0x88E4 50) - scenter
14043 11/05/2008 16:59:43 0x00369D14 (+0x0234) _Z12soap_requestP4soapPcS1_RS1_RP16cCollAttachment s(0x88E450,0xF5D9C0,0x10DF4B0,0xFFBEF560,0xFFBEF63 C,0xFFBEF560) - scenter
14043 11/05/2008 16:59:43 0x0048F400 (+0x0688) _Z18soap_serve_requestP4soapP16SOAP_ENV__HeaderRP1 6cCollAttachments(0x88E450,0x0,0xFFBEF63C,0x2,0x88 E450,0xA400) - scenter
14043 11/05/2008 16:59:43 0x0048E6C0 (+0x0590) _Z10soap_serveP4soapP16SOAP_ENV__Header(0x88E450,0 x0,0x5,0x6F9991,0x88E450,0x88E450) - scenter
14043 11/05/2008 16:59:43 0x00361C14 (+0x0064) _Z20serve_soap_requestorP4soapP16SOAP_ENV__Header( 0x88E450,0x0,0x96,0x0,0xCD,0x88E450) - scenter
14043 11/05/2008 16:59:43 0x003630D0 (+0x0CE4) topazSOAPserver(0x0,0x0,0x0,0x0,0x0,0x20100002) - scenter
14043 11/05/2008 16:59:43 0x000AC56C (+0x0880) symanContinue(0x3,0xFFBEF9B4,0x1,0x0,0x0,0x2010000 2) - scenter
14043 11/05/2008 16:59:44 0x000ABC88 (+0x03B4) syman(0x3,0xFFBEF9B4,0x0,0x1,0x78,0x3) - scenter
14043 11/05/2008 16:59:44 0x000965CC (+0x00C0) main(0x3,0xFFBEF9B4,0xFFBEF9C4,0x6F9BE0,0x0,0x0) - scenter
14043 11/05/2008 16:59:44 0x0009629C (+0x005C) _start(0x0,0x0,0x0,0x0,0x0,0x0) - scenter
Don't use the "system" for record or oldrecord. This is defined incorrectly in the documentation too. Referencing those variables will only work WITHOUT the system container.
hi
i use to call any function present in the ScriptLibrary and its a pass by reference call.
system.library.ScriptName.FunctionName( system.vars.$file );
ScriptName
FunctionName( File )
{
// The variable File will contain the reference of File
// The values can be fetched as File.columnName
}
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks