Last active
June 7, 2017 16:28
-
-
Save dbrewitz/399a83605364b369caeb30bc2affb0f8 to your computer and use it in GitHub Desktop.
Update statuses of Zoho Projects with JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These functions could be combined into one edit at a time. | |
// Set all Zoho projects from null to medium in custom "County Priority" field | |
function ZohoProjectStatusUpdate() { | |
var ele = document.querySelectorAll('.dropDownMenu .pointer[onclick*="ajaxShowPag"]') | |
for (var i = ele.length; i >= 0; i--) { | |
(function (index) { | |
setTimeout(function () { | |
ele[index].click() | |
changeItup(index) | |
}, i * 4500) | |
})(i) | |
} | |
function changeItup(i) { | |
setTimeout(function () { | |
var pub = document.querySelector('.w100per.h38.mT0[labelname="County Priority"]') | |
var sub = document.querySelector('#editprojdiv .buttonNew[value*="Update') | |
pub.getElementsByTagName('option')[2].selected = true | |
sub.click() | |
}, 2000) | |
} | |
} | |
ZohoProjectStatusUpdate() | |
// Set all Zoho projects from private to public for portal users (read only) | |
function ZohoProjectUpdate() { | |
var ele = document.querySelectorAll('.dropDownMenu .pointer[onclick*="ajaxShowPag"]') | |
for (var i = ele.length; i >= 0; i--) { | |
(function (index) { | |
setTimeout(function () { | |
ele[index].click() | |
changeIt(index) | |
}, i * 4500) | |
})(i) | |
} | |
function changeIt(i) { | |
setTimeout(function () { | |
var pub = document.querySelector('.pT15 input[value*="2"]') | |
var sub = document.querySelector('#editprojdiv .buttonNew[value*="Update') | |
pub.click() | |
sub.click() | |
}, 2000) | |
} | |
} | |
ZohoProjectUpdate() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment