This record has been modified again. Do the manual merge again.

Hi!

Why is it happening?

  • Hello Artem,
    Thanks for your question.

    I found a Support ticket showing the same behavior, and it suggested the following workaround:

     

    QCCR1E147932
    The workaround is to add the following code snippet in the ScriptLibrary function recordUpdateConflicts.autoMerge, where shown on the screenshot attached:
    
    if (fileName == "incidents")
    {
    var modifiedFile = new SCFile("incidents");
    if( modifiedFile.doSelect("incident.id=\""   vars.$L_file.incident_id   "\"") == RC_SUCCESS )
    {
    argNames.push("record");
    argVals.push(modifiedFile);
    argTypes.push(6);
    // print("modified date");
    }
    }

    Hope this helps!

    BR!

    If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution. If you are satisfied with anyone’s response please remember to give them a LIKE by clicking on the Thumb and show your appreciation.

  • Thank's, Jose_A_SM!

    I'll try to fix it.

  • Hi Jose,

    My customer is running on SM9.63 and has this same problem. I wanted to try out your suggestion, but I am unsure exactly where in the autoMerge function the code should be added. I cannot seem to open the QCCR you reference to in Sparks or wherever. Are you able to help out?

    Currently the code of the function is this:

    function autoMerge() {
    var isGUI = (system.functions.gui() == true || system.functions.gui() == "true") ? true : false;
    var hasModified = false;
    var fileName = system.functions.filename(system.vars.$L_file);
    if (fileName == "incidents") {
    hasModified = !system.functions.iscurrent(system.vars.$L_file);
    } else {
    var modified = vars.$G_RC_MODIFIED;
    var updateStatus = system.functions.updatestatus(system.vars.$L_file);
    hasModified = (updateStatus == modified);
    }
    var mode = (vars.$L_mode) ? vars.$L_mode : "";
    if (hasModified && isGUI && mode.indexOf("add") != 0 && exists(system.vars.$L_file)) {
    try {
    var argNames = new SCDatum();
    var argVals = new SCDatum();
    var argTypes = new SCDatum();
    var results = new SCDatum();
    argNames.setType(8);
    argVals.setType(8);
    argTypes.setType(8);
    results.setType(8);
    argNames.push("file");
    argNames.push("second.file");
    argNames.push("prompt");
    argNames.push("boolean1");
    argNames.push("second.record");
    argVals.push(vars.$L_file);
    argVals.push(vars.$L_file_save);
    argVals.push(vars.$L_exit);
    argVals.push("true");
    argVals.push(vars.$L_list);
    argTypes.push(6);
    argTypes.push(6);
    argTypes.push(2);
    argTypes.push(4);
    argTypes.push(6);
    results.push("file");
    results.push("second.file");
    results.push("prompt");
    results.push("second.record");
    return system.library.RAD.run("record.update.conflicts", argNames, argVals, argTypes, results);
    } catch (e) {
    print(e);
    return null;
    }
    } else return null;
    }

     Kind regards,

    Cas van Voorthuizen

  • As entitled customer you will find the defect and the workaround here :

    https://softwaresupport.softwaregrp.com/doc/group/softwaresupport/search-result/-/facetsearch/document/LID/QCCR1E147932 

    Workaround :

    In ScriptLibrary recodUpdateConflicts search function autoMerge .  

    You have to add some code before the line "

    results.push("file");

    Code to be added: 

    if (fileName == "incidents")
    {
    var modifiedFile = new SCFile("incidents");
    if( modifiedFile.doSelect("incident.id=\"" vars.$L_file.incident_id "\"") == RC_SUCCESS )
    {
    argNames.push("record");
    argVals.push(modifiedFile);
    argTypes.push(6);
    }
    }

     

    I'll attach a screenshot how it should look like after adding the code.