- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 01:51 PM
I'm not sure what I'm missing here. I have an issue where Approved Standard change templates keep having there updated date/by fields update when ever someone completes a new Standard Change using that template. But if i add a reference in the published_ref field, the updated date/by remains the same.
KB0787919 - states that reverting the (Generate Template On Approval) br to OOB will fix the issue and Publish the item.
I've verified that we didn't update the business rule.
When I compare this to my developer instance, the BR's are exactly he same as well.
I've also verified in both environments, that when I create a Standard Change using the any template but Updated Date and By are showing my name and the date/time i closed the change. And when the change templates published_ref field is not blank, both fields remain the same as when approved.
Any Reason why this would happen?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2022 06:09 AM
I am glad it cleared your concerns, but unfortunately, I cannot answer the whole scenario behind this vs using "Last Used" field to keep it simple 🙂
You can create a custom field tho if it's required.
Thanks,
G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 06:43 PM
Hello Eric,
Are you guys using the OOB workflow?
Thanks,
G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2022 03:43 AM
NO we are not. Is that where the issue lays? I look at my personal dev instance to compare, but didn't look deeply.
Suggestions on which activity? I'll probably answer my own question, but if you wouldn't mind.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2022 05:15 AM
Hello,
OOB workflow is calling the following script includes:
1)StdChangeUtilsSNC - This is read-only.
2)StdChangeUtils
Thanks,
G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2022 06:05 AM
OK, went to my WF and changed the script. Took what was in my DEV instance and back out custom.
Workflow Activity - Run Script - Validate Categorisation
//backout to test OOB script - 3/22/22
// var util = new StdChangeUtils();
// var validationStatus = util.validateCategorisation(current);
// activity.answer = validationStatus;
// if (validationStatus == 'failure') {
// var link = '<a href="std_change_proposal.do?sys_id=' + current.getUniqueValue() +
// '">' + current.number + '</a>';
// gs.addErrorMessage(gs.getMessage(
// 'Cannot approve the Proposal {0}, validation has failed.', link));
// current.approval = 'requested';
// } else if (validationStatus == 'success') {
// current.approval = 'approved';
// }
//OOB Script to validate/publish template -
var util = new StdChangeUtils();
/* Check that all mandatory fields are completed on the Proposal record and also check that
the template contains the mandatory fields and does not contain any restricted fields and
also any Change Task Templates...but only if we're creating or modifying a Proposal */
if (current.proposal_type != 3) {
var result = new StdChangeUtils().validateProposal(current, true /* Show errors */, true /* Validate tasks */);
activity.answer = result ? 'success' : 'failure';
if (!result) {
var link = '<a href="std_change_proposal.do?sys_id=' + current.getUniqueValue() + '"><b>' + current.number + '<b></a>';
gs.addErrorMessage(gs.getMessage('Cannot approve the Proposal {0}, validation has failed.', link));
current.approval = 'requested';
} else
current.approval = 'approved';
} else {
activity.answer = 'success';
current.approval = 'approved';
}
So reviewed a "Change Proposal" and the workflow completes as expected. This activity didn't error.
I saw in logs something about:
com.glide.script.RhinoEcmaError: "rep" is not defined. plugin://com.glideapp.report/ui.jtemplates/sys_report_security.xml.6 : Line(1) column(0) ==> 1: rep.isPublished(); |
My Script includes are OOB, or so I'm thinking.
1)StdChangeUtilsSNC (screenshot) - no versions listed to this item
2)StdChangeUtils
var StdChangeUtils = Class.create();
StdChangeUtils.prototype = Object.extendsObject(StdChangeUtilsSNC, {
initialize: function(request, responseXML, gc) {
StdChangeUtilsSNC.prototype.initialize.call(this, request, responseXML, gc);
},
/***************************
*
*Add customer changes below
*
****************************/
type: 'StdChangeUtils'
});
Again, no versions here either and "Published Item" is still not populated on the template.