Add error messages to return from RAD format.ctrl.exec

Idea ID 1771094

Add error messages to return from RAD format.ctrl.exec

When running format control from JS – need to return bad validations messages to results, now messages from fc only appears in messages.

      cFormatControls = {}; 
      var cRetStructure = {"exit": null, "file": null, "message": null}
      cFormatControls["device"] = new SCFile("formatctrl", SCFILE_READONLY);
      cFormatControls["device"].doSelect("name=\"device\""); 
cFormatControls["device"]["validation.popup"]=false;

      var argNames = new SCDatum(); argNames.setType(8);
      var argVals = new SCDatum(); argVals.setType(8);
      var argTypes = new SCDatum(); argTypes.setType(8);
      var results = new SCDatum(); results.setType(8);

            argNames.push("file");  // fFile
            argVals.push(fDeviceFile);
            argTypes.push(6);

            argNames.push("record"); // file Format Control
            argVals.push(fFormatCtrl1);
            argTypes.push(6);

            argNames.push("target.file"); // file Master Format Control
            argVals.push(cFormatControls["device"]);
            argTypes.push(6);

            argNames.push("name"); // Action
            argVals.push("update");
            argTypes.push(2);

            argNames.push("text"); // result
            argVals.push(null);
            argTypes.push(2);

            argNames.push("second.file"); // old file
            argVals.push();
            argTypes.push(6);

            results.push("text");
            results.push("file");
            results.push("messages");

      var radResults = lib.RAD.run("format.ctrl.exec", argNames, argVals, argTypes, results);
      
      cRetStructure["exit"] = system.functions.val(radResults.results[0], 2); //"badval";//
      cRetStructure["file"] = radResults.results[1];
      cRetStructure["message"] = radResults.messages; // this object empty, add messages here
3 Comments
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor
Status changed to: Waiting for Votes
 
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor
Status changed to: Accepted
 
Micro Focus Contributor
Micro Focus Contributor
Status changed to: Delivered

Have delivered in SM9.64

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.