I need to prompt a user IF the status = proposal. If not, it should run the agent. What is missing? If I use @command RunAgent in the edit button, the (changestatus) agent runs fine. If I attempt to run it as below, it complains of line #19 and invalid universal ID!!! Thoughts…
function confirm_edit() {
var status = document.forms[0].FormStatus.value=="Proposal"
if (status){
confirm("Are you sure the status should be changed?);
location.href = "/test/test.nsf/(changestatus)?openagent";
}
else{
location.href = "/test/test.nsf/(changestatus)?openagent";
}
}
Subject: Invalid UniversalID & JS function+agent
var status = document.forms[0].FormStatus.value==“Proposal” this should be
var status = document.forms[0].FormStatus.value=“Proposal”
if (status==“Proposal”)
{
…ur statements…
}
After this if any thing goes wrong it meants something wring inside the agent.
Subject: Invalid UniversalID & JS function+agent
How does the changestatus agent know what the Universal ID is?
Ben
Subject: RE: Invalid UniversalID & JS function+agent
Thanks all… it is not supposed to know the docID. The error is coming from the agent (my customized onerror…) BUT it does not happen if the button executes the RunAgent directly vs. this script then the agent!?! Maybe it’s the way it is launched…