Code to Verify an Email Address
function VerifyEmail(Inputs, Outputs)
{
var sEmailAddr = Inputs.GetProperty("Address List")
var sInd = sEmailAddr.indexOf("@")
var sInd1 = sEmailAddr.indexOf(".")
var sInd2 = sEmailAddr.indexOf(" ")
if (sInd == -1 || sInd1 == -1 || sInd2 != -1)
{
Outputs.SetProperty("Status", "Failure");
Outputs.SetProperty("Address List", sEmailAddr);
}
else
{
Outputs.SetProperty("Status", "Success");
Outputs.SetProperty("Address List", sEmailAddr);
}
}
Code to Verify a FAX address
function VerifyFax(Inputs, Outputs)
{
var strFax = Inputs.GetProperty("Address List");
var strFaxURL;
if (strFax.length == 10)
{
strFaxURL = TheApplication().InvokeMethod("LookupValue", "MMF_CONTACT_FAX_ADDRURL", "FAX URL");
//strFax = "91" + strFax + "@fax.mmf.capital.ge.com"
strFax = "91" + strFax + strFaxURL;
Outputs.SetProperty("Status", "Success");
Outputs.SetProperty("Address List", strFax);
}
else
{
Outputs.SetProperty("Status", "Failure");
}
}
Code to Set Activity Due Date excluding Saturday and Sunday
function ActivityDueDate(iDate)
{
var retDate = new Date;
var Saturday = 6;
var Sunday = 0;
if (ToNumber(iDate) > 0)
{
retDate.setDate(retDate.getDate()+ ToNumber(iDate));
}
var sDay = retDate.getDay();
if (sDay == Sunday)
{
retDate.setDate(retDate.getDate()+ 1);
}
else if (sDay == Saturday)
{
retDate.setDate(retDate.getDate()+ 2);
}
var dDate = (retDate.getMonth()+1) + "/" + retDate.getDate() + "/" + retDate.getFullYear() + " 06:00:00";
return (dDate);
}
Code for Required * Image
Code Validated
No comments:
Post a Comment