Using the If And code

J

Jeffshex

I know the if code to start off my will be:
if(parseInt(XDocument.DOM.selectSingleNode("//my:WeekTotal").text) < 40)
---Now I need to add in after that:
AND If my:AfterTotal is NOT Equal To my:WeekTotal - 40
 
J

Jeffshex

I have not tried that, but I did get this way to work:
if(parseInt(XDocument.DOM.selectSingleNode("//my:WeekTotal").text) > 40
if(parseInt(XDocument.DOM.selectSingleNode("//my:AfterTotal").text)!=(parseInt(XDocument.DOM.selectSingleNode("//my:WeekTotal").text)-40))

XDocument.UI.Alert("Your after hours are not all accounted for. Please
correct this in order to submit.")
----------------------------------------------------------------------------------------------
Now the tricky part is inserting it into this working existing code I have:
function CTRL186_7::OnClick(eventObj)
{
// Submit code
if(parseInt(XDocument.DOM.selectSingleNode("//my:WeekTotal").text) <= 35){

var clicked = XDocument.UI.Confirm("Your week total is under 35 hours. Do
you wish to continue?",1);
if(clicked == 1) {
XDocument.Submit();
XDocument.UI.Alert("Your status report has been submitted successfully.");
Application.ActiveWindow.Close();
}

}
else{
XDocument.Submit();
XDocument.UI.Alert("Your status report has been submitted successfully.");
Application.ActiveWindow.Close();
}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top