Data not transferred from New Call to request when request initiated from call and content of
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 06:50 AM
Scenario - Data not transferred from New Call to request when request initiated from call and content of description is long if it has more than 4000 characters.
Question -Can anyone provide script include for above scenario using below procedure.
Solution prosed -To handle this scenario you need to fire an Ajax call on "sys_tiny_url" table and fetch the record with sys_id, there you will get the value of the field that has long value.
I tried this scriptinclude but it may not correct-
var DataFromCallRequestToOtherRequest = Class.create();
DataFromCallRequestToOtherRequest.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getDescription: function(urlId) {
var gr = new GlideRecord('sys_tiny_url');
if (gr.urlId) {
var description = gr.sysparm_description;
var shortDescription = gr.sysparm_short_description;
var affectedCI = gr.sysparm_affected_ci;
var affectedService = gr.sysparm_affected_service;
return {
"description": description,
"short_description": shortDescription,
"affected_ci": affectedCI,
"affected_service": affectedService
};
} else {
return null;
}
},
type: 'DataFromCallRequestToOtherRequest'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 07:34 AM
Hi chinna,
1. How are you calling the script include? (May not be important here.)
2. Why is the 'sys_tiny_url' table referenced line 4, when the logic in the "if" statement is referencing parameters form the client side and no field values on the 'sys_tiny_url' record. (the field on that table is named 'data' and defined to have length 65,000 OOB, type: 'Compressed'.) Also, there is no 'gr.query();' before line 5, so I expect it always returns null. You can use 'gr.get(urlId);' before line 5 and check the return value of that. Or change line 5 to 'if (gr.get(urlID)) {' and you wont have to add a line to get the return value in a variable to use in the "if" statement.
3. If the 'return' is reached, seems you want to return an object. If so define an Object variable, load values, and return the result. See existing script includes that do that for an example.