0 votes

We need the updated (saved) data of the client form in our serverscript, therefore a CebPerform('CEB_APPLY') is programmatically executed for launching the serverscript.
The serverscript will be started and finished successfully, but the callback success function is NOT triggered.

How we can fix this?

Example:

CebPerform('CEB_APPLY');
var scriptFile = "serverscripts/test.js"
    var scriptFunc = "TestServerScript"
    var URL = "dialog?_macrofile=MacroAjax&_macro=RunScript&File=" + scriptFile + "&Func=" + scriptFunc + "&key=" + Model('key') + "&entity=" + Model('entity') + "&editHandle=" + Model('editHandle');
$.ajax({
    url: URL,
    type: "GET",
    //data: ExtraParams,
    success:
    function (html, textStatus, jqXHR) {
        // this is never reached ?!
        alert("Back:" + html)
        if (IsNotEfficyErrorHtml(html, function (errorMsg) {
                alert(errorMsg)
            })) {
            CebPerform('CEB_STATE');
        }
    }
})
asked in WorkFlow / Serverscript by (120 points)

1 Answer

+1 vote
Best answer

Hello Geert,

CebPerform refreshes the page, so anything you put after that call will normally not be executed.

See this other question: https://overflow.efficy.com/?qa=2937/updating-linked-product-lines-oppo-edit-not-other-browsers

Kristof's reply to this question also applies to your case.
For what you're trying to do I would suggest using the "EditStateWithScript" function.

Cheers,
Robert

answered by (836 points)
selected by
1,173 questions
1,432 answers
1,726 comments
325 users