Ok, I’ve managed to get it working by wrapping the jQuery inside a function and then calling the function with DFFS Rule.
// Insert button if case is Open
function showCloseButton() {
// var statusValue = getFieldValue("Status");
// if (statusValue = "Open") {
jQuery("input[id$='_diidIOSaveItem']").before("<input type='button' id='CloseTicket' class='ms-ButtonHeightWidth' style='margin-right:4px;' value='Close this case' onclick='closeTicket()' />");
// }
}
The above code could be used within different rules based on if else conditions, but in my case, I just called this function based on the rule condition, so sections I didn’t need I commented out.
Hope this is the correct way for doing this.
BTW, where can I read about what I can do with within DFFS using different JS tweaks? For example, setFieldValue, getFieldValue – I would like to know what is available to play with?