Licensing-Inquiry Regarding Ticket Creation from Custom Portal

xingrui
Tera Contributor

Hi everyone.

I would like to inquire whether it is permissible for a requestor to create records directly on the task's inheritance table through a widget in a custom portal. Specifically, I am concerned about potential licensing violations associated with this functionality.

I have researched this topic online and within community resources but have been unable to locate relevant documentation.

If anyone has insights or information on this matter, I would greatly appreciate your assistance.

Best Regards

10 REPLIES 10

Mark Manders
Mega Patron

Nobody can tell you anything about licensing, because that's your contract with ServiceNow. To know for sure: contact your sales rep. Any other answer will be a guess.

 

However: any user without a license has access to a portal and you can put any record producer on the portal for a user to create them. Since you aren't mentioning anything about this table, it's unclear if it's an OOB table or a custom one. Any end user should be able to see his or her own records. But again: we didn't draw up your contract with ServiceNow.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Thank you @Mark Manders .

 

About the table, I am considering inheriting from task ( just like incident, sc_request, problem), and I believe it is an Out-of-the-Box (OOB) table. Is that correct?

Additionally, could you please clarify whether it is possible to use GlideAjax to create a record instead of using a Record Producer? Thank you.

No.

If you create anything yourself (field/table/app) it is not OOB. It's very simple: anything you create or change on the instance (except data) is not OOB, because ServiceNow didn't provide it to you when you got the instance. 

And what do you mean by using GlideAjax to create records? How are end users giving the input for the record? You can use GlideAjax within a record producer, you will need the information somewhere client side to run logic on to create something.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark


@Mark Manders wrote:

No.

If you create anything yourself (field/table/app) it is not OOB. 


OMG.. SHOCKED BUT THANKS.

 


@Mark Manders wrote:

You can use GlideAjax within a record producer, you will need the information somewhere client side to run logic on to create something.


Here is PART of my SCRIPTS...

 

HTML Template

 

<form id="promptForm">
<input type="date" id="field1" name="field1" required>
<select id="field2" name="field2" required>
  <option value="">--Please choose an option--</option>
  <option value='09'>09</option>
  <option value='10'>10</option>
  <!--...more options-->
</select>
<select id="field3" name="field3" required>
  <option value="">--Please choose an option--</option>
  <option value='00'>00</option>
  <option value='30'>30</option>
</select>
<button id="submit-btn" type="submit" class="fc-button">Submit</button>
</form>

 

 Client controller

 

api.controller = function($timeout, $scope, $http, $rootScope, spUtil, $window) {
    /* widget controller */
var c = this;
/*...more other actions*/
document.getElementById("promptForm").onsubmit = function (event) {
  event.preventDefault();
  var field1 = document.getElementById("field1").value;
  var field2 = document.getElementById("field2").value;
  var field3 = document.getElementById("field3").value;
  var snDate = field1 + " " + field2 + ":" + field3 + ":00";
  var jsStartDate = new Date(field1 + "T" + field2 + ":" + field3 + ":00");
  var jsEndDate = new Date(jsStartDate.getTime() + 1800 * 1000);
  var snStartDate = formatDateTime(jsStartDate);
  var snEndDate = formatDateTime(jsEndDate);

  if (!c.data || !Array.isArray(c.data.fullyBooked)) {
    alert("Data is not initialized correctly.");
    return;
  }
  if (!isNaN(jsStartDate.valueOf())) {
    var valueJSON = {
      user: c.data.userID,
      start_at: snStartDate,
      end_at: snEndDate,
      event_title: "Booked_" + c.data.userName
    };
    var ga = new GlideAjax("global.submitFromPortal");
    ga.addParam("sysparm_name", "insert");
    ga.addParam("sysparm_table", c.data.table);
    ga.addParam("sysparm_value_json", JSON.stringify(valueJSON));
    ga.getXML(callback);
  } else {
    alert("Invalid date." + snStartDate);
  }
  document.getElementById("promptForm").reset();
};
};

 

 Script Include

 

var submitFromPortal = Class.create();
submitFromPortal.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    insert: function() {
        var tableName = this.getParameter("sysparm_table");
        var valueJSON = this.getParameter("sysparm_value_json");
        if (!tableName || !valueJSON) {
            return 'lack of parameter';
        }

        try {
            var parsedData = JSON.parse(valueJSON);
            var gr = new GlideRecord(tableName);
            gr.initialize();
            for (var key in parsedData) {
                if (gr.isValidField(key)) {
                    gr.setValue(key, parsedData[key]);
                }
            }
            var sys_id = gr.insert();
            return sys_id;
        } catch (error) {
            return 'Error handle: ' + error.message;
        }
    },
    update: function() {
        var tableName = this.getParameter("sysparm_table");
        var valueJSON = this.getParameter("sysparm_value_json");
        var record = this.getParameter("sysparm_gr_sysid");
        if (!tableName || !valueJSON || !record) {
            return 'lack of parameter';
        }

        try {
            var parsedData = JSON.parse(valueJSON);
            var gr = new GlideRecord(tableName);
            gr.get(record);
            for (var key in parsedData) {
                if (gr.isValidField(key)) {
                    gr.setValue(key, parsedData[key]);
                }
            }
            var sys_id = gr.update();
            return sys_id;
        } catch (error) {
            return 'Error handle: ' + error.message;
        }
    },
    type: 'submitFromPortal'
});

 

 

Can I use those SCRIPTS rather than RECORD PRODUCER?