I am trying to replace a column's content with a javascript button in SharePoint. By following http://buildsharepointconcepts.blogspot.com/2018/05/go-to-workflow-initiation-form-on.html
This seems to be working fine.
function StartWorkflowJsLink(overrideCtx) {
/*If you have multiple list views on page better hard code this ListID Variable*/
var ListID = overrideCtx.listName;
var ItemGuid = '';
/*Replace Template ID*/
var TemplateID = '{D184A9EF-2DFB-4D67-828C-9C2FAF85B3B9}'; /* Get it from workflow start page URL. It will be changed everytime you republish the workflow.*/
var SourceURL = window.location.href;
var ItemID = overrideCtx.CurrentItem.ID;
var webAbsoluteURL = _spPageContextInfo.webAbsoluteUrl;
var WFPageURL = '/wfsvc/9e06e2e17b974ce99c06ad30abf9229d/WFInitForm.aspx?';
debugger;
var workflowURL = webAbsoluteURL + WFPageURL + 'List=' + ListID + '&ID=' + ItemID + '&TemplateID=' + TemplateID + '&Source=' + SourceURL;
var btnHTML = btnHTML = "<input type=\"button\" onclick=\"GotoWFStartPage('" + workflowURL + "');\" value=\"Start Workflow\"></input>";
return btnHTML;
}
function GotoWFStartPage(workflowURL) {
window.location.href = workflowURL;
}
function registerListRenderer() {
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.Templates.Fields = {
'Review': {
'View': StartWorkflowJsLink
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
}
ExecuteOrDelayUntilScriptLoaded(registerListRenderer, 'clienttemplates.js');
However, I am trying to change the function to only display StartWorkflowJsLink if the Review column equals Start.
I tried following this article but it seems to not be working.
Any help that can be provided would be greatly appreciated.
Thank you.