Skip to content

Instantly share code, notes, and snippets.

@EliJDonahue
Created January 1, 2017 23:04
Show Gist options
  • Select an option

  • Save EliJDonahue/2e95b77597f0bfc0dc1f65bd3370d5cc to your computer and use it in GitHub Desktop.

Select an option

Save EliJDonahue/2e95b77597f0bfc0dc1f65bd3370d5cc to your computer and use it in GitHub Desktop.
Sets the background color of a non-current item's form
var itm = document.thisItem;
var inn = itm.getInnovator();
// if is_current property exists in the cache, use it
var isCurr = itm.getProperty("is_current","");
// else, retrieve is_current from the database
if(isCurr === ""){
itm = inn.getItemById(itm.getID());
isCurr = itm.getProperty("is_current", "");
}
// set form background color if the item is not current
var formBody = document.getElementsByTagName("body")[0];
if (isCurr == "0") {
formBody.style.backgroundColor = "#EFEFEF";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment