Appframe Knowledge Base


1 hits
0

How to execute a procedure from javascript

// Fire without parameters
procMyProcedure.execute();

// Fire without parameters synchronously
procMyProcedure.execute(true);

// Fire without parameters with callback
procMyProcedure.execute(function(err, data) {
    if (err === null) {
        // use data
    } else {
        alert(err);
    }
});

// Fire without parameters synchronously with callback
procMyProcedure.execute(function(err, data) {
    if (err === null) {
        // use data
    } else {
        alert(err);
    }
}, true);

// Fire and forget
procMyProcedure.execute({
    Param1: "foo",
    param1: 12345
});

// Fire using callback
procMyProcedure.execute({
    Param1: "foo",
    param1: 12345
}, function(err, data) {
    if (err === null) {
        // use data
    } else {
        alert(err);
    }
});

// Fire synchronously
procMyProcedure.execute({
    Param1: "foo",
    param1: 12345
}, true);

// Fire synchronously with callback
procMyProcedure.execute({
    Param1: "foo",
    param1: 12345
}, function(err, data) {
    if (err === null) {
        // use data
    } else {
        alert(err);
    }
}, true);

components web · Perma link post comment Posted by: Peter Øren (16-jan-2012)