My Oracle Support Banner

Reverting The Changes From PM File Resulting In UndoRecord Error (Doc ID 2419135.1)

Last updated on FEBRUARY 06, 2019

Applies to:

Siebel CRM - Version 16.19 [IP2016] and later
Information in this document applies to any platform.


On : 16.19 [IP2016] version, Field Service

Custom logic is implemented to identify duplicate records: (i.e) when First Name + Last Name matches then a pop-up or warning message will get popped up, and then a pop-up applet will be opened to show the duplicates.
The logic works perfectly if the user tabs out of the field and clicks on CTRL+S.
However, if the user does some changes and if the cursor is on the same field where the value is edited, then an error is thrown "Method UndoRecord is not Allowed Here".

Method UndoRecord is not Allowed Here

The issue can be reproduced at will with the following steps:
1. Implement PM with code:

Applet: Contact List Applet
JS: TestUndoPM.js


if (typeof(SiebelAppFacade.TestUndoPM) === "undefined") {

  define("siebel/custom/TestUndoPM", ["siebel/listpmodel"],
      function() {
          SiebelAppFacade.TestUndoPM = (function() {

              function TestUndoPM(pm) {
                  SiebelAppFacade.TestUndoPM.superclass.constructor.apply(this, arguments);

              SiebelJS.Extend(TestUndoPM, SiebelAppFacade.ListPresentationModel);

              TestUndoPM.prototype.Init = function() {
                  // Init is called each time the object is initialised.
                  // Add code here that should happen before default processing
                  SiebelAppFacade.TestUndoPM.superclass.Init.apply(this, arguments);
                  SiebelJS.Log(this.Get("GetName") + ": TestUndoPM:      Init method reached.");
                  // Add code here that should happen after default processing

                  this.AddMethod("InvokeMethod", PreInvokeProcess, {
                      sequence: true,
                      scope: this
                  }); //pre handler

              TestUndoPM.prototype.Setup = function(propSet) {
                  // Setup is called each time the object is initialised.
                  // Add code here that should happen before default processing
                  SiebelJS.Log(this.Get("GetName") + ": TestUndoPM:      Setup method reached.");
                  SiebelAppFacade.TestUndoPM.superclass.Setup.apply(this, arguments);
                  // Add code here that should happen after default processing

              function PreInvokeProcess(methodName, psInputArgs, lp, returnStructure) {

                  var outps = false;

                  if (methodName === "WriteRecord") {

                      var sLastName = theApplication().ActiveApplet().BusComp().GetFieldValue("Last Name");
                      var sFirstName = theApplication().ActiveApplet().BusComp().GetFieldValue("First Name");

                      outps = sLastName == "xyz" ? true : false;

                      if (sLastName != "" && sFirstName != "") {

                          if (outps) {
                              // Checked with UndoRecord commented. It will not undo the changes done. So it needs to be added. "CancelOperation" is not enough.
                              SiebelJS.Log("In PreInvokeProcess");
                              returnStructure["CancelOperation"] = true;
                              returnStructure["ReturnValue"] = "";
                              alert("Duplicate Exists");



              return TestUndoPM;
          return "SiebelAppFacade.TestUndoPM";




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.