How to call script include in flow action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 02:25 AM
Hello All,
I have script include and flow with custom flow action and they are OOB. But while triggering it facing issue as
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 02:52 AM
Hi,
both flow and script include are in "Human Resources: Lifecycle Events" scope?
are you sure it's the correct way to invoke it? i.e. are you sending correct input to it with correct type
Did you check any other place how it's invoked?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 03:09 AM
I don't know that's correct or not in that function
changeStartDate: function(inputs, outputs) {
gs.info('test 1' + inputs + ' ' + outputs );
try {
var currentCaseGr = inputs.currentCase;
var payload = JSON.parse(currentCaseGr.payload);
var startDate = payload.what_should_the_new_employee_s_start_date_be;
if (gs.nil(startDate)) {
var payloadStartDateNullErrMsg = this._formatUtil.format(
'Change start date flow: new start date not populated for case: {0}.',
currentCaseGr.getUniqueValue());
throw this._errorUtil.getError(payloadStartDateNullErrMsg);
}
var parentCaseGr = currentCaseGr.parent.getRefRecord();
var parentCaseSysId = parentCaseGr.getUniqueValue();
if (!parentCaseGr.isValidRecord()) {
var parentCaseNotValidErrMsg = this._formatUtil.format(
'Change start date flow: parent case: {0} not valid.', parentCaseSysId);
throw this._errorUtil.getError(parentCaseNotValidErrMsg);
}
this._changeSubjectPersonJobStartDate(parentCaseGr, startDate);
this._changeSubjectPersonProfileStartDate(parentCaseGr, startDate);
this._changeTaskDueDate(parentCaseSysId);
// update the 'Change start date' case to 'Closed complete' state
currentCaseGr.state = 3;
currentCaseGr.update();
this._errorUtil.validateGrForError(currentCaseGr);
} catch (error) {
throw this._errorUtil.handleExceptionMethod('changeStartDate', error);
}
},
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 03:34 AM
I don't know that's correct or not in that function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 04:54 AM
Hi,
check any other place how it's getting invoked.
you might have to understand the function and accordingly send the parameters.
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader