Вы находитесь на странице: 1из 62

Parent Applet Name Script

function WebApplet_PreInvokeMethod (MethodName)


//HAF1.0:HLD.QOM.2.2.B4:Script added by NDIPANJAN on 07-Feb-2006
//to implement the functionality of B2C button.
//Begin
{
if(MethodName == "New B2C")
{
try
{
var boBusObj = TheApplication().ActiveBusObject();
var bcCon;
var bcAcc = boBusObj.GetBusComp("Account");
bcCon = bcAcc.ParentBusComp();
var sConId = bcCon.GetFieldValue("Id");
var sLastName = bcCon.GetFieldValue("Last Name");
var sFstName = bcCon.GetFieldValue("First Name");

bcAcc.NewRecord(0);
bcAcc.ActivateField("Name");
bcAcc.SetFieldValue("Name",sLastName + ", " + sFstName);
bcAcc.WriteRecord();
var sAccId = bcAcc.GetFieldValue("Id");
var bsBusSer = TheApplication().GetService("HAF BusinessToCustomer");
var bsInputs = TheApplication().NewPropertySet();
var bsOutputs = TheApplication().NewPropertySet();
bsInputs.SetProperty("Contact Id",sConId);
bsInputs.SetProperty("Account Id",sAccId);
bsBusSer.InvokeMethod("NewB2C", bsInputs, bsOutputs);
bcAcc.ClearToQuery();
bcAcc.SetSortSpec("Created (DESCENDING)");
bcAcc.ExecuteQuery();
}
catch(e)
{
throw(e);
}
finally
{
bsBusSer = null;
}
return(CancelOperation);
}
WebApplet_Pr return(ContinueOperation);
Account List eInvokeMetho }
Applet - child d //End.

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{

if( MethodName == "UpdateOrder" )


{
CanInvoke = "TRUE";
return( CancelOperation );
}
else
{
Activity List WebApplet_Pr return (ContinueOperation);
Applet With eCanInvokeMe }
Navigation thod }
var i = 0;
var isRecord;
var ViewName;
var BC;
var Primary;
try
{
ViewName = TheApplication().ActiveViewName();
if (ViewName =="Contact Details View (Detail tab)")
{
BC= this.BusComp();
BC.ClearToQuery();
BC.ExecuteQuery(ForwardBackward);
isRecord = BC.FirstRecord();

while (isRecord)
{
Primary = BC.GetFieldValue("SSA Primary Field");
if(Primary == "N")
{ i++;
isRecord =BC.NextRecord();
}
else
{
return(ContinueOperation);
}
}
}

catch (e)
{
throw(e);
}
finally
{
i=null;
ViewName = null;
BC=null;
Primary = null;
}

}else
//End
Communication WebApplet_Pr
Address MVG eInvokeMetho return (ContinueOperation);
Applet d }

CUT Premise
Meter Points List
Applet Admin (declarations) var sNew = "N";
function WebApplet_PreInvokeMethod (MethodName)
{
//HAF 1.0 SE.3.1.C1 - Added By SSRIVANI On 15-02-2006
try
{
if (MethodName == "NewRecord")
{
sNew = "Y";
}
if (MethodName == "UndoRecord")
{
sNew = "N";
}
if ((MethodName == "WriteRecord") && (sNew == "Y"))
{
var SrvPntBC = this.BusComp();
var SrvPntZip = SrvPntBC.GetFieldValue("Personal Address Id");
var IPS = TheApplication().NewPropertySet();
var OPS = TheApplication().NewPropertySet();
IPS.SetProperty("Service Point Id", SrvPntZip);
IPS.SetProperty("Input Type", "Service Point Address Id");
var ValidateBS = TheApplication().GetService("HAF Service Point Validation BS");
ValidateBS.InvokeMethod("ValidateSP", IPS, OPS);
var RetVal = OPS.GetProperty("Validated");
if (RetVal != "Y")
{
TheApplication().RaiseError("HAF_SRV_PNT_ERR_MSG_1");
}
sNew = "N";
}
}
catch (e)
{
throw (e);
CUT Premise WebApplet_Pr }
Meter Points List eInvokeMetho return (ContinueOperation);
Applet Admin d }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{
if( MethodName == "MovePartsToOrderLineItem" )
{
CanInvoke = "TRUE";
return( CancelOperation );
FS Field Engineer WebApplet_Pr }
Activities Form eCanInvokeMe return (ContinueOperation);
Applet w/ Toggle thod }

function WebApplet_PreInvokeMethod (MethodName)


{

if (MethodName == "MovePartsToOrderLineItem") //MovetoPartTracker


{
var oBS;
var inpPS;
var outPS;
inpPS = TheApplication().NewPropertySet();
outPS = TheApplication().NewPropertySet();
inpPS.SetProperty("Activity Id", this.BusComp().GetFieldValue("Id"));
oBS = TheApplication().GetService("HAF Part Tracker OrderLineItem BS");
oBS.InvokeMethod("MovePartsToOrderLineItem", inpPS, outPS);
inpPS = null;
outPS = null;
oBS = null;
return (CancelOperation);
}
else
{
FS Field Engineer WebApplet_Pr }
Activities Form eInvokeMetho return (ContinueOperation);
Applet w/ Toggle d }
function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{

if( MethodName == "MovetoPartTracker" )


{
CanInvoke = "TRUE";
return( CancelOperation );
}
else
{
return (ContinueOperation);
FS Template WebApplet_Pr }
Activity Plan eCanInvokeMe return (ContinueOperation);
Action List Applet thod }

function WebApplet_PreInvokeMethod (MethodName)//Added by NDIPANJAN on 30-01-06.


{
if (MethodName == "MovetoPartTracker")
{
var oBS;
var inpPS;
var outPS;
inpPS = TheApplication().NewPropertySet();
outPS = TheApplication().NewPropertySet();
inpPS.SetProperty("Activity Id", this.BusComp().GetFieldValue("Id"));
oBS = TheApplication().GetService("HAF Part Tracker Movement BS");
oBS.InvokeMethod("MovetoPartTracker", inpPS, outPS);
inpPS = null;
outPS = null;
oBS = null;
return (CancelOperation);
}
else
{
return (ContinueOperation);
FS Template WebApplet_Pr }
Activity Plan eInvokeMetho
Action List Applet d }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{

if( MethodName == "NewRecord" )


{
CanInvoke = "TRUE";
return( CancelOperation );
}
else
{
return (ContinueOperation);
Global Account WebApplet_Pr }
Sub Account List eCanInvokeMe return (ContinueOperation);
Applet thod }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{

if (MethodName == "SmartScript")
{
CanInvoke = "TRUE";
return (CancelOperation);
}
HAF Account Call WebApplet_Pr
Script Runs List eCanInvokeMe return (ContinueOperation);
Applet thod }
function WebApplet_PreInvokeMethod (MethodName)
{
if (MethodName == "SmartScript")
{
TheApplication().InvokeMethod("RunSmartScript","HAF-Need Analysis","","ENU","USD");
return (CancelOperation);
HAF Account Call WebApplet_Pr }
Script Runs List eInvokeMetho return (ContinueOperation);
Applet d }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{

if( MethodName == "UpdateOrder" )


{
CanInvoke = "TRUE";
return( CancelOperation );
}
else
{
return (ContinueOperation);
WebApplet_Pr }
HAF Activity Fax eCanInvokeMe return (ContinueOperation);
List Applet thod }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{

if( MethodName == "UpdateOrder" )


{
CanInvoke = "TRUE";
return( CancelOperation );
}
else
{
return (ContinueOperation);
HAF Activity WebApplet_Pr }
Hummingbird List eCanInvokeMe return (ContinueOperation);
Applet thod }
AddrAssocBC.ClearToQuery();
AddrAssocBC.SetSearchSpec("Id", AddrRowId);
AddrAssocBC.ExecuteQuery();
if (AddrAssocBC.FirstRecord())
{
AddrAssocBC.Associate(NewAfter);
AddrAssocBC.WriteRecord();
}
AddrMVGBC.SetFieldValue("SSA Primary Field", "Y");
AddrMVGBC.WriteRecord();
ContactBC.SetFieldValue("Primary Personal Address Id", AddrRowId);
}
else
{
AddrMVGBC.NewRecord(NewAfter);
AddrMVGBC.SetFieldValue("HAF Street Number", strNum);
AddrMVGBC.SetFieldValue("Street Address", strAddr1);
AddrMVGBC.SetFieldValue("Street Address 2", strAddr2);
AddrMVGBC.SetFieldValue("City", sCity);
AddrMVGBC.SetFieldValue("Country", sCountry);
AddrMVGBC.SetFieldValue("Postal Code", sPostCode);
AddrMVGBC.SetFieldValue("Verified Flag", "Y");
AddrMVGBC.SetFieldValue("SSA Primary Field", "Y");
AddrMVGBC.WriteRecord();
ContactBC.SetFieldValue("Primary Personal Address Id",
AddrMVGBC.GetFieldValue("Id"));
}
}
ContactBC.SetFieldValue("Review Profile Flag", "Y");
ContactBC.WriteRecord();
ContactBC.InvokeMethod("RefreshRecord");
this.InvokeMethod("CloseApplet");
return (CancelOperation);
}
}
catch (e)
{
throw(e);
}
finally
{
AddrBC = null;
AddrBO = null;
AddrAssocBC = null;
AddrMVGBC = null;
ContactBC = null;
ContactVBC = null;
HAF Contact WebApplet_Pr }
Verification Popup eInvokeMetho return (ContinueOperation);
Applet d }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{
if (MethodName == 'EditRecord')
{
TheApplication().SetProfileAttr("WorkflowName", "HAF UAN Tip-Compensation Update WF");
}

if (MethodName == 'NewRecord')
{
TheApplication().SetProfileAttr("WorkflowName", "HAF UAN Tip-Compensation Insert WF");
}
HAF IXMAL Tip WebApplet_Pr
Compensation List eCanInvokeMe return (ContinueOperation);
Applet thod }

function WebApplet_PreInvokeMethod (MethodName)


HAF IXMAL Tip WebApplet_Pr {
Compensation List eInvokeMetho return (ContinueOperation);
Applet d }
function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
/*
if( MethodName == "UpdateOrder" )
{
CanInvoke = "TRUE";
return( CancelOperation );
}
else
{
WebApplet_Pr return (ContinueOperation);
HAF Safecon List eCanInvokeMe }*/
Applet thod }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{
//HAF1.0::Script added by VSAKARAY on 15-Feb-2006
//to implement the functionality of Generating Connection Numbers,
//Master Codes,Guard Codes and Key Ids.
if( MethodName == "GenerateConnectionNo" )
{
var bcCurBC = this.BusComp();
var sConNum = bcCurBC.GetFieldValue("HAF Connection Number");
if (sConNum == null || sConNum == "")
CanInvoke = "TRUE";
return(CancelOperation );
}
if( MethodName == "GenerateMasterCode" )
{
var bcCurBC = this.BusComp();
var sMCode = bcCurBC.GetFieldValue("HAF Master Code");
if(sMCode == null || sMCode == "")
CanInvoke = "TRUE";
return(CancelOperation );
}
if( MethodName == "GenerateGuardCode" )
{
var bcCurBC = this.BusComp();
var sGCode = bcCurBC.GetFieldValue("HAF Guard Code");
if (sGCode == null || sGCode == "")
CanInvoke = "TRUE";
return(CancelOperation );
}
if( MethodName == "GenerateKeyId" )
{
var bcCurBC = this.BusComp();
var sKeyId = bcCurBC.GetFieldValue("HAF Key Id");
if (sKeyId == null || sKeyId == "")
CanInvoke = "TRUE";
return(CancelOperation );
HAF Subscription WebApplet_Pr }
Account Form eCanInvokeMe return (ContinueOperation);
Applet thod }
}
catch(e)
{
throw(e);
}
finally
{
bcCurBC = null;
bsBusSer = null;
}
}
if(MethodName == "GenerateKeyId")
{
try
{
var bcCurBC = this.BusComp();
var bsBusSer = TheApplication().GetService("HAF Code Generation");
var bsInputs = TheApplication().NewPropertySet();
var bsOutputs = TheApplication().NewPropertySet();
bsInputs.SetProperty("Region Code","R01");
//bsInputs.SetProperty("Region Code",bcCurBC.GetFieldValue("HAF RYCK Region"));
bsInputs.SetProperty("Region Code","R01");
bsBusSer.InvokeMethod("Generate Key Id",bsInputs,bsOutputs);
var sKeyId = bsOutputs.GetProperty("HAF Key Id");
if(sKeyId == null || sKeyId == "")
{
sErrMsg = "X_HAF_KEY_ID_Err_Msg_1"
TheApplication().RaiseError(sErrMsg);
return(CancelOperation);
}
else
{
bcCurBC.SetFieldValue("HAF Key Id",sKeyId);
bcCurBC.WriteRecord();
return(CancelOperation);
}
}
catch(e)
{
throw(e);
}
finally
{
bcCurBC = null;
bsBusSer = null;
}
}
HAF Subscription WebApplet_Pr
Account Form eInvokeMetho return (ContinueOperation);
Applet d }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{
//HAF1.0::Script added by VSAKARAY on 15-Feb-2006
//to implement the functionality of Generating Debit Id.
if(MethodName == "GenerateKID")
{
var bcCurBC = this.BusComp();
var sDebitId = bcCurBC.GetFieldValue("HAF KID");
if (sDebitId == null || sDebitId == "")
{
CanInvoke = "TRUE";
return(CancelOperation );
}
}
if( MethodName == "GenerateIXMALId" )
{
var bcCurBC = this.BusComp();
var sIXMALId = bcCurBC.GetFieldValue("HAF IXMAL Id");
if (sIXMALId == null || sIXMALId == "")
{
CanInvoke = "TRUE";
return(CancelOperation );
}
HAF Subscription WebApplet_Pr }
Account List eCanInvokeMe return (ContinueOperation);
Applet thod }
}
catch(e)
{
throw(e);
}
finally
{
bcCurBC = null;
bsBusSer = null;
sErrMsg = null;
}
}
if(MethodName == "GenerateIXMALId")
{
try
{
var bcCurBC = this.BusComp();
var bsBusSer = TheApplication().GetService("HAF Code Generation");
var bsInputs = TheApplication().NewPropertySet();
var bsOutputs = TheApplication().NewPropertySet();
bsBusSer.InvokeMethod("GenerateIXMALId",bsInputs,bsOutputs);
var sSerNum = bsOutputs.GetProperty("Serial Number");
if(sSerNum == null || sSerNum == "")
{
sErrMsg = "X_HAF_IXMAL_ID_Err_Msg";
TheApplication().RaiseErrorText(sErrMsg);
return(CancelOperation);
}
else
{
var sIxmalId = "K"+ sSerNum;
bcCurBC.SetFieldValue("HAF IXMAL Id",sIxmalId);
bcCurBC.WriteRecord();
return(CancelOperation);
}

}
catch(e)
{
throw(e);
}
finally
{
bsBusSer = null;
bcCurBC = null;
sErrMsg = null;
}
HAF Subscription WebApplet_Pr }
Account List eInvokeMetho return (ContinueOperation);
Applet d }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{

if( MethodName == "UpdateOrder" )


{
CanInvoke = "TRUE";
return( CancelOperation );
}

if( MethodName == "MovetoPartTracker" )


{
CanInvoke = "TRUE";
return( CancelOperation );
}
Order Entry - WebApplet_Pr return (ContinueOperation);
Activity List eCanInvokeMe
Applet thod }
function WebApplet_PreInvokeMethod (MethodName)
{
if (MethodName == "MovetoPartTracker")
{
var oBS;
var inpPS;
var outPS;
inpPS = TheApplication().NewPropertySet();
outPS = TheApplication().NewPropertySet();
inpPS.SetProperty("Activity Id", this.BusComp().GetFieldValue("Id"));
oBS = TheApplication().GetService("HAF Part Tracker Movement BS");
oBS.InvokeMethod("MovetoPartTracker", inpPS, outPS);
inpPS = null;
outPS = null;
oBS = null;
return (CancelOperation);
}
else
{
return (ContinueOperation);
}
Order Entry - WebApplet_Pr
Activity List eInvokeMetho
Applet d }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


Order Entry - WebApplet_Pr {
Order List Applet eCanInvokeMe return (ContinueOperation);
(Contact) thod }
var bcProduct = GetPicklistBusComp("Product");
//var bcProduct = GetPicklistBusComp("Product w/ ST constraint");
bcProduct.ClearToQuery();
bcProduct.SetViewMode(AllView);
bcProduct.SetSearchSpec("Name",vSubsc);
//var vtest = vPrdarr[0];
bcProduct.ExecuteQuery();
var vc = bcProduct.FirstRecord();
var vId = bcProduct.GetFieldValue("Id")
if ( vc == true)
//Pick();
bclineitem.SetFieldValue("Product Id",vId);
bclineitem.SetFieldValue("Action Code","-");
WriteRecord();
}
for(var x = 0; x < vPrdarr.length; x++)
{
bclineitem.NewRecord(1);
bcProduct.ClearToQuery();
bcProduct.SetViewMode(AllView);
bcProduct.SetSearchSpec("Name",vPrdarr[x]);
var vtest = vPrdarr[0];
bcProduct.ExecuteQuery();
var vc = bcProduct.FirstRecord();
var vId = bcProduct.GetFieldValue("Id")
if ( vc == true)
//Pick();
bclineitem.SetFieldValue("Product Id",vId);
bclineitem.SetFieldValue("Parent Order Item Id",vOrderitemId);
bclineitem.SetFieldValue("Parent Order Item Id",vOrderitemId);
bclineitem.SetFieldValue("Action Code","-");
bclineitem.WriteRecord();

with(bcorder)
{
ClearToQuery();
SetSearchSpec("Id",vOrderId);
SetSearchSpec("Order Type",'Service Order');
ExecuteQuery();
}
TheApplication().GotoView("Order Entry - Line Item Actions View",boOrder);
//return (ContinueOperation);

bclineitem = null;
bcProduct = null;
bcorder = null;
Service Request return (ContinueOperation);
List Applet CreateOrder }

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)


{
if (MethodName == "ServiceOrder")
{
CanInvoke ="TRUE";
return (CancelOperation);
WebApplet_Pr }
Service Request eCanInvokeMe return (ContinueOperation);
List Applet thod }
SetSearchSpec("Asset Number",vAssetId);
ExecuteQuery();
}

var vRecas = bcasset.FirstRecord();


if (vRecas == true)
{
var vSubsc = bcasset.GetFieldValue("Product Name");
var vSrvpt = bcasset.GetFieldValue("Service Point Id");
var vId = bcasset.GetFieldValue("Id");
with(bcasset)
{
ClearToQuery();
SetViewMode(AllView);
SetSearchSpec("Parent Asset Id",vId);
ExecuteQuery();
}
var vRecachild = bcasset.FirstRecord();
while(vRecachild)
{
vPrdarr[i] = bcasset.GetFieldValue("Product Name");
i = i + 1;
vRecachild = bcasset.NextRecord();
}
}

CreateOrder(vPrdarr,vAccountId,vSubsc,vSrvpt);
return (CancelOperation);
}
}
catch(e)
{
TheApplication().RaiseErrorText("Asset Id is Required,Pls enter a Value");
return (CancelOperation);
}

finally
{
bcService = null;
bcasset = null;
boAsset = null;
bcaccount = null;
return (CancelOperation);
}

return (CancelOperation);
}
WebApplet_Pr
Service Request eInvokeMetho
List Applet d }

function WebApplet_PreInvokeMethod (MethodName)


{
//BEGIN
if (MethodName == "ModifyProdSvc")
{
TheApplication().SetProfileAttr("ModifyButton",'Y');
}
SIS OM Products & WebApplet_Pr //END
Services Root List eInvokeMetho return (ContinueOperation);
Applet (Service) d }
Parent Applet Procedure Script

function Applet_ChangeFieldValue (field, value)


{
//HAF1.0:HLD.QOM.2.2.N.5. e:Script added by SVENKATA on 30-Jan-2006
//To raise Alert When Primary Address for account is updated and type is not residential
//Begin
if(field == "SSA Primary Field")
{
var profile = TheApplication().GetProfileAttr("PrimaryAddrUpdated");

if(profile == "Y")
{
TheApplication().SetProfileAttr("PrimaryAddrUpdated", "N");
TheApplication().SWEAlert("Change Bill To Address if Required");

}
}
Account Address Applet_Chang //END
List Applet (SCW) eFieldValue }
function Applet_ChangeRecord ()
{
Account Address Applet_Chang
List Applet (SCW) eRecord }

function Applet_PreInvokeMethod (name, inputPropSet)


{
//HAF1.0:HLD.QOM.2.2.N.5. e:Script added by SVENKATA on 30-Jan-2006
//To raise Alert When Primary Address for account is updated and type is not residential
//Begin
try
{
var profile;
if (name == "CloseApplet" || name == "PickRecord")
{
profile = TheApplication().GetProfileAttr("PrimaryAddrUpdated");
if(profile == "Y")
{
TheApplication().SetProfileAttr("PrimaryAddrUpdated", "N");
TheApplication().SWEAlert("Change Bill To Address if Required");
return("CancelOperation");
}
}
}
catch (e)
{
throw(e);
}
finally
{
profile = null;
}
//End
Account Address Applet_PreIn return ("ContinueOperation");
Mvg Applet vokeMethod }

function Applet_ChangeFieldValue (FieldName, Value)// Added by DIPANJAN for


HLD.QOM.2.6.12.a on 23-01-06.//
{
if( FieldName == "Status")
{
if (Value == "Scheduled")
{
TheApplication().SWEAlert("Update Order status to Submitted");
Field Service }
Activity List Applet_Chang }
Applet eFieldValue }
function Applet_PreInvokeMethod (name, inputPropSet)
{
// HAF 1.0: Added By VIKUMAR On 16-02-06
if (MethodName == "NewRecord")
{

var ctlDueDate = this.FindControl("Duedate");


ctlDueDate.SetProperty("Visible",'FALSE');
ctlDueDate.SetLabelProperty("Visible", "hidden");
}
else
{
ctlDueDate.SetProperty("Visible",'TRUE');
this.FindActiveXControl("Duedate").style.visibility = "visible";
ctlDueDate.SetLabelProperty("Visible", "visible");
HAF Invoice }
Header Form Applet_PreIn return ("ContinueOperation");
Applet vokeMethod }

function Applet_ChangeRecord ()
{
/****************************************************************************
Created By:<KISHORE>
Created On:<09/02/2006>
Method Name:Applet ChangeRecord
Functionality:<(HLD SR 1.2.1.N.1)(HLD SR 1.2.1.N.2)>Hiding The Controls At Runtime
Based on the User Responsibility and The Value of that Field
******************************************************************************/
var oBCHAFsubscirptionAccount = this.BusComp();
var ctlAlarmPasswordControl = this.FindControl("HAFAlarmPassword");
if(oBCHAFsubscirptionAccount.GetFieldValue("HAF Alarm PasswordFlag")=="Y")
{
ctlAlarmPasswordControl.SetProperty("Visible",'FALSE');
ctlAlarmPasswordControl.SetLabelProperty("Visible", "hidden");
}
else
{
ctlAlarmPasswordControl.SetProperty("Visible",'TRUE');
this.FindActiveXControl("HAFAlarmPassword").style.visibility = "visible";
ctlAlarmPasswordControl.SetLabelProperty("Visible", "visible");
}

var ctlCustomerPIN = this.FindControl("HAFCustomerPIN");


if(oBCHAFsubscirptionAccount.GetFieldValue("HAF Customer PINFLAG")=="Y")
{
ctlCustomerPIN.SetProperty("Visible",'FALSE');
ctlCustomerPIN.SetLabelProperty("Visible", "hidden");
}
else
{
ctlCustomerPIN.SetProperty("Visible",'TRUE');
this.FindActiveXControl("HAFCustomerPIN").style.visibility = "visible";
HAF Subscription ctlCustomerPIN.SetLabelProperty("Visible", "visible");
Account Form Applet_Chang }
Applet eRecord }
function Applet_Load ()
{
/****************************************************************************
Created By:<KISHORE>
Created On:<09/02/2006>
Method Name:Applet Load
Functionality:<(HLD SR 1.2.1.N.1)(HLD SR 1.2.1.N.2)>Hiding The Controls At Runtime
Based on the User Responsibility and The Value of that Field
*******************************************************************************/
var oBCHAFsubscirptionAccount = this.BusComp();
var ctlAlarmPasswordControl = this.FindControl("HAFAlarmPassword");
if(oBCHAFsubscirptionAccount.GetFieldValue("HAF Alarm PasswordFlag")=="Y")
{
ctlAlarmPasswordControl.SetProperty("Visible",'FALSE');
ctlAlarmPasswordControl.SetLabelProperty("Visible", "hidden");
}
else
{
ctlAlarmPasswordControl.SetProperty("Visible",'TRUE');
this.FindActiveXControl("HAFAlarmPassword").style.visibility = "visible";
ctlAlarmPasswordControl.SetLabelProperty("Visible", "visible");
}

var ctlCustomerPIN = this.FindControl("HAFCustomerPIN");


if(oBCHAFsubscirptionAccount.GetFieldValue("HAF Customer PINFLAG")=="Y")
{
ctlCustomerPIN.SetProperty("Visible",'FALSE');
ctlCustomerPIN.SetLabelProperty("Visible", "hidden");
}
else
{
ctlCustomerPIN.SetProperty("Visible",'TRUE');
this.FindActiveXControl("HAFCustomerPIN").style.visibility = "visible";
ctlCustomerPIN.SetLabelProperty("Visible", "visible");
HAF Subscription }
Account Form
Applet Applet_Load }

function Applet_PreInvokeMethod (name, inputPropSet)


HAF Subscription {
Account Form Applet_PreIn return ("CancelOperation");
Applet vokeMethod }

function Applet_Load ()
{
/* ***************************************************
Created By:SSRIDHAR
Created On:14-02-2006
Method Name:Applet_Load
Functionality:HLD.SR.1.2.3.4.a To Change the Color and Font of
the Conrol.
*************************************************** */

var ctlPendingInvoices =this.FindControl("HAFPendingInvoices")


ctlPendingInvoices.SetProperty("FontColor","Red");
ctlPendingInvoices.SetProperty("FontSize","12pt");
ctlPendingInvoices.SetProperty("FontWeight","600");
SIS Account Entry
Applet Applet_Load }
Business
Component Name Script
////HAF1.0:HLD.QOM.2.1.B2:Script added by VASHOK on 15-Feb-2006

Account (declarations) var AccountUpd = "N";

function BusComp_PreSetFieldValue (FieldName, FieldValue)


{
////HAF1.0:HLD.QOM.2.1.B2:Script added by VASHOK on 15-Feb-2006

if (FieldName == "Name")
{
AccountUpd = "Y";
}
BusComp_PreS return (ContinueOperation);
Account etFieldValue }
try
{

var BO = TheApplication().GetBusObject("Account");
var BC = BO.GetBusComp("Account");

var RowId = this.GetFieldValue("Id");


var PrmAddrId = this.GetFieldValue("Primary Address Id");
var NAME = this.GetFieldValue("Name");

var AddrBO = TheApplication().GetBusObject("CUT Address");


var AddrBC = AddrBO.GetBusComp("CUT Address");
AddrBC.ClearToQuery();
AddrBC.SetSearchSpec("Id", PrmAddrId);
AddrBC.ExecuteQuery();
if (AddrBC.FirstRecord())
{
var STADD1 = AddrBC.GetFieldValue("Street Address");
var POST = AddrBC.GetFieldValue("Postal Code");
var sSearchExpr = "[Id] <> '" + RowId + "' AND [Name] = '" + NAME +
"' AND [Primary Account Street Address] = '" + STADD1 + "' AND [Primary Account Postal Code] = '" +
POST + "'";
BC.ClearToQuery();
BC.SetSearchExpr(sSearchExpr);
BC.ExecuteQuery();
if( BC.FirstRecord () )
{
this.UndoRecord ();
TheApplication().RaiseError("HAF_ACCT_Err_Msg_3");
}
}
}

catch(e)
{
throw(e);
}
finally
{

AccountUpd = "";
BC = "";
BO = ""; +C2
}

return (ContinueOperation);
}

BusComp_Pre
Account WriteRecord }
var BCPriceList = this.GetPicklistBusComp("Price List");
with(BCPriceList)
{
ClearToQuery();
ActivateField("Name");
SetSearchSpec("Name","Standard Price List");
ExecuteQuery(ForwardOnly);
if (FirstRecord())
Pick();
}
}
//*************************************************************************************
//HAF1.0:HLD.QOM.2.2.N.8 e:Script added by SUVENKATA on 15-Feb-2006
// To Default Billable Flag For Activities created under Sales Order
if ( sBCName =="Order Entry - Line Items")
{
this.SetFieldValue("Billable Flag","Y");
}
}
else
{
var BCPriceList = this.GetPicklistBusComp("Price List");
with(BCPriceList)
{
ClearToQuery();
ActivateField("Name");
SetSearchSpec("Name","Standard Price List");
ExecuteQuery(ForwardOnly);
if (FirstRecord())
Pick();
}
}
}
catch(e)
{
var sErrMsg = TheApplication().LookupMessage("User Defined Errors",
"HAF_Err_Msg_PriceList");
TheApplication().RaiseErrorText(sErrMsg);
}
finally
{
BCPriceList = null;
BCParent = null;
}

return(ContinueOperation);

BusComp_New
Action Record }
iAccount = GparentBC.GetFieldValue("Account Id");
AccountPick.ClearToQuery();
AccountPick.SetSearchSpec("Id",iAccount);
AccountPick.ExecuteQuery();
if(AccountPick.FirstRecord())
{
MPhone = AccountPick.GetFieldValue("Main Phone Number");
iPhone = AccountPick.GetFieldValue("Phone Number");
}

Pcount = AccountPick.CountRecords();
if (Pcount >=1 )
{
if( (ServiceType == val && ServiceType!="") && (iPhone == "" &&
MPhone == ""))
{
var Err = TheApplication().LookupMessage("User Defined
Errors", "HAF_Err_Msg_2");
TheApplication().RaiseErrorText(Err);
return (CancelOperation);
}
else
return(ContinueOperation);
}
}
}
}
catch (e)
{
throw(e);
}
finally
{
BO = null;
ViewName =null;
GparentBC = null;
ParentBC = null;
AccountPick = null;
ServiceType = null;
iAccount = null;
iPhone = null;
MPhone = null;
Pcount = null;
val = null;
}
//End

//
BusComp_PreN return (ContinueOperation);
Action ewRecord }
function BusComp_PreWriteRecord ()
{

/**************************************************************************************************
Created By:RNAGOJI
Created On:17-02-2006
Method Name: PreWriteRecord
Functionality:<HLD.QOM.2.5.N.4> To Cascade Contact Last and First Name from Parent BC
**************************************************************************************************/
//Begin
try
{
var ActiveBO = TheApplication().ActiveBusObject();
if (ActiveBO.Name() == "Order Entry" || ActiveBO.Name() == "Order Entry (Sales)" )
{
var ActionBC = ActiveBO.GetBusComp("Action");
var sPrmContactId = ActionBC.GetFieldValue("Primary Contact Id");
var ContactMVGBC = ActionBC.GetMVGBusComp("Contact Last Name");
var ContactAssocBC = ContactMVGBC.GetAssocBusComp();
ContactAssocBC.ClearToQuery();
ContactAssocBC.SetSearchSpec("Id", sPrmContactId);
ContactAssocBC.ExecuteQuery();

if(ContactAssocBC.FirstRecord())
{
ContactAssocBC.Associate(NewAfter);
ContactAssocBC.WriteRecord();
}

}
}
catch(e)
{
throw (e);
}
finally
{
ActiveBO = null;
}
//End

BusComp_Pre return (ContinueOperation);


Action WriteRecord }
function BusComp_NewRecord ()
{
//HAF1.0:HLD.QOM.2.2.N.8 e:Script added by SUVENKATA on 15-Feb-2006
// To Default Billable Flag For Sales Order
//Begin

try
{

var BCParent = this.ParentBusComp();


var sBCName = BCParent.Name();

if ( sBCName =="Order Entry - Orders")

{
this.SetFieldValue("Billable Flag","Y");

return(ContinueOperation);
}

catch (e)
{
throw(e);

finally
{
BCParent = null;
sBCName = null;
Action }
(Quote BusComp_New
Order) Record }
Pcount = AccountPick.CountRecords();
if (Pcount >=1 )
{
AccountPick.ClearToQuery();
AccountPick.SetSearchSpec("Id",iAccount);
AccountPick.ExecuteQuery();
var RecordExists = AccountPick.FirstRecord();
if(RecordExists)
{
MPhone =
AccountPick.GetFieldValue("Main Phone Number");
iPhone =
AccountPick.GetFieldValue("Phone Number");
}

if( (ServiceType == val && ServiceType!="") &&


(iPhone == "" && MPhone == ""))
{
var Err =
TheApplication().LookupMessage("User Defined Errors", "HAF_Err_Msg_2");
TheApplication().RaiseErrorText(Err);
return (CancelOperation);
}
else
return(ContinueOperation);
}
}
}
}
catch (e)
{
throw(e);
}
finally
{
BO = null;
ViewName =null;
GparentBC = null;
ParentBC = null;
AccountPick = null;
ServiceType = null;
iAccount = null;
iPhone = null;
MPhone = null;
Pcount = null;
val = null;
}
//End
Activity Plan BusComp_PreN return (ContinueOperation);
Action ewRecord }
function BusComp_PreWriteRecord ()
{
/**************************************************************************************************
Created By:RNAGOJI
Created On:17-02-2006
Method Name: PreWriteRecord
Functionality:<HLD.QOM.2.5.N.4> To Cascade Contact Last and First Name from Parent BC
**************************************************************************************************/
//Begin

var ActiveBO = TheApplication().ActiveBusObject();


if (ActiveBO.Name() == "Order Entry")
{
var ActionBC = ActiveBO.GetBusComp("Activity Plan Action");
var sPrmContactId = ActionBC.GetFieldValue("Primary Contact Id");
var ContactMVGBC = ActionBC.GetMVGBusComp("Contact Last Name");
var ContactAssocBC = ContactMVGBC.GetAssocBusComp();
ContactAssocBC.ClearToQuery();
ContactAssocBC.SetSearchSpec("Id", sPrmContactId);
ContactAssocBC.ExecuteQuery();
if(ContactAssocBC.FirstRecord())
{
ContactAssocBC.Associate(NewAfter);
ContactAssocBC.WriteRecord();
}
ActionBC.WriteRecord();
}
//End
return (ContinueOperation);
Activity Plan BusComp_Pre
Action WriteRecord }

////HAF1.0:HLD.QOM.2.1.B2 DeDuplication:Script added by VASHOK on 15-Feb-2006

var AddrUpdated = "N";


var POST = "";
CUT Address (declarations) var STADD1 = "";
var ParentBC;
var type;
if ( FieldName =="SSA Primary Field")
{
ParentBC = this.ParentBusComp().Name();
if ((ParentBC != null && ParentBC != "CUT Address")&& ParentBC == "Account")
{
type = this.ParentBusComp().GetFieldValue("Type");
var val =
TheApplication().InvokeMethod("LookupValue","ACCOUNT_TYPE","Residential");
if ( type!= val )
{
TheApplication().SetProfileAttr("PrimaryAddrUpdated", 'Y');
return(ContinueOperation);
}
}
}

////HAF1.0:HLD.QOM.2.1.B2 DeDuplication:Script added by VASHOK on 15-Feb-2006

if (FieldName == "Street Address")


{
ParentBC = this.ParentBusComp().Name();
if ((ParentBC != null && ParentBC != "CUT Address")&& ParentBC == "Account")
{
AddrUpdated = "Y";
STADD1 = FieldValue;
}
}
if (FieldName == "Postal Code")
{
ParentBC = this.ParentBusComp().Name();
if ((ParentBC != null && ParentBC != "CUT Address")&& ParentBC == "Account")
{
AddrUpdated = "Y";
POST = FieldValue;
}
}
}
catch (e)
{
throw (e);
}
finally
{
}
//End

BusComp_PreS return(ContinueOperation);
CUT Address etFieldValue }
try
{
if (AddrUpdated == "Y")
{
var RowId = this.GetFieldValue("Id");
var AccountId = this.ParentBusComp().GetFieldValue("Id");
var AcntPrmAddrId = this.ParentBusComp().GetFieldValue("Primary Address Id");
if (RowId == AcntPrmAddrId)
{
var NAME = this.ParentBusComp().GetFieldValue("Name");
if (STADD1 == "")
{
STADD1 = this.GetFieldValue("Street Address");
}
if (POST == "")
{
POST = this.GetFieldValue("Postal Code");
}
var sSearchExpr = "[Id] <> '" + AccountId + "'AND [Name] = '" + NAME + "'AND
[Primary Account Street Address] = '" + STADD1 + "' AND [Primary Account Postal Code] = '" + POST +
"'";

var AccountBO = TheApplication().GetBusObject("Account");


var AccountBC = AccountBO.GetBusComp("Account");

AccountBC.ClearToQuery();
AccountBC.SetSearchExpr(sSearchExpr);
AccountBC.ExecuteQuery();

if( AccountBC.FirstRecord () )
{
this.UndoRecord ();
TheApplication().RaiseError("HAF_ACCT_Err_Msg_3");
}

}
}
}
catch(e)
{
throw(e);
}
finally
{
AccountBC = "";
AccountBO = "";
}

BusComp_Pre return(ContinueOperation);
CUT Address WriteRecord }

function BusComp_PreQuery ()
{
/* Created by KHAJA for Contact Verification Interface on 17 FEB 06 */
// Set User Property. The routine will query repository BC to get the custom user properties
for the VBC and set it so that it can be used to set search spec.
fsetUserProperty();
//Set Workflow profile attribute – This workflow will be called to call the WS.
TheApplication().SetProfileAttr("WorkflowName", "HAF Contact Verification WF");
//Set Search spec for the fields
var n = 1;
var sSearchField = this.GetUserProperty("QueryField"+n);
while (sSearchField != '')
{

this.SetSearchSpec(this.GetUserProperty("QueryField"+n),this.ParentBusComp().GetFieldValue(this
.GetUserProperty("QueryField"+n)));
n++;
var sSearchField = this.GetUserProperty("QueryField"+n);
}
HAF Contact BusComp_PreQ return (ContinueOperation);
Verification uery }
try
{
/* Created by KHAJA for Contact Verification Interface on 17 FEB 06 */
// Instantiate the Repository BO and BC for Bus Component object.

var oRBO = TheApplication().GetBusObject("Repository Business Component");


var oRBC = oRBO.GetBusComp("Repository Business Component");
with (oRBC)
{
// Query Repository Bus Comp BC for VBC
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Name", this.Name());
ExecuteQuery(ForwardOnly);
var isRecord = FirstRecord();
if (isRecord)
{
// Instantiate the Repository Bus Comp for User Properties
var oRUPBC = oRBO.GetBusComp("Repository Business Component User
Prop");
with (oRUPBC)
{
SetViewMode (AllView);
ActivateField("Name");
ActivateField("Value");
ExecuteQuery(ForwardOnly);
isRecord = FirstRecord();
while (isRecord)
{
// Set User property

this.SetUserProperty(GetFieldValue("Name"),GetFieldValue("Value"));
isRecord = NextRecord();
}
}
}
}
}
catch(e)
{
TheApplication().RaiseErrorText("The Error is : " + e.toString());
}
finally
{
oRUPBC = null;
oRBC = null;
oRBO = null;
HAF Contact fsetUserProper }
Verification ty }

function BusComp_PreQuery ()
{
// Set User Property. The routine will query repository BC to get the custom user properties for
the VBC and set it so that it can be used to set search spec.
fsetUserProperty();
//Set Workflow profile attribute – This workflow will be called to call the WS.
TheApplication().SetProfileAttr("WorkflowName", "HAF Hummingbird Lookup");
//Set Search spec for the fields
var n = 1;
var sSearchField = this.GetUserProperty("QueryField"+n);
while (sSearchField != '')
{

this.SetSearchSpec(this.GetUserProperty("QueryField"+n),this.ParentBusComp().GetFieldValue(this
.GetUserProperty("QueryField"+n)));
n++
var sSearchField = this.GetUserProperty("QueryField"+n);
HAF }
HummingBir BusComp_PreQ return (ContinueOperation);
d Document uery }
function fsetUserProperty()
{
try
{
// Instantiate the Repository BO and BC for Bus Component object.
var oRBO = TheApplication().GetBusObject("Repository Business Component");
var oRBC = oRBO.GetBusComp("Repository Business Component");
with (oRBC)
{
// Query Repository Bus Comp BC for VBC
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Name", this.Name());
ExecuteQuery(ForwardOnly);
var isRecord = FirstRecord();
if (isRecord)
{
// Instantiate the Repository Bus Comp for User Properties
var oRUPBC = oRBO.GetBusComp("Repository Business Component User
Prop");
with (oRUPBC)
{
SetViewMode (AllView);
ActivateField("Name");
ActivateField("Value");
ExecuteQuery(ForwardOnly);
isRecord = FirstRecord();
while (isRecord)
{
// Set User property
this.SetUserProperty(GetFieldValue("Name"),GetFieldValue("Value"));
isRecord = NextRecord();
}
}
}
}
}
catch(e)
{
TheApplication().RaiseErrorText("The Error is : " + e.toString());
}
finally
{
oRUPBC = null;
oRBC = null;
HAF oRBO = null;
HummingBir fsetUserProper }
d Document ty }

function BusComp_PreQuery ()
{
// Set User Property. The routine will query repository BC to get the custom user properties for
the VBC and set it so that it can be used to set search spec.
fsetUserProperty();
//Set Workflow profile attribute – This workflow will be called to call the WS.
TheApplication().SetProfileAttr("WorkflowName", "HAF InvoiceHeader Lookup");
//Set Search spec for the fields
var n = 1;
var sSearchField = this.GetUserProperty("QueryField"+n);
while (sSearchField != '')
{

this.SetSearchSpec(this.GetUserProperty("QueryField"+n),this.ParentBusComp().GetFieldValue(this
.GetUserProperty("QueryField"+n)));
n++
var sSearchField = this.GetUserProperty("QueryField"+n);
}
HAF Invoice BusComp_PreQ return (ContinueOperation);
Header uery }
function fsetUserProperty()
{
try
{
// Instantiate the Repository BO and BC for Bus Component object.
var oRBO = TheApplication().GetBusObject("Repository Business Component");
var oRBC = oRBO.GetBusComp("Repository Business Component");
with (oRBC)
{
// Query Repository Bus Comp BC for VBC
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Name", this.Name());
ExecuteQuery(ForwardOnly);
var isRecord = FirstRecord();
if (isRecord)
{
// Instantiate the Repository Bus Comp for User Properties
var oRUPBC = oRBO.GetBusComp("Repository Business Component User
Prop");
with (oRUPBC)
{
SetViewMode (AllView);
ActivateField("Name");
ActivateField("Value");
ExecuteQuery(ForwardOnly);
isRecord = FirstRecord();
while (isRecord)
{
// Set User property
this.SetUserProperty(GetFieldValue("Name"),GetFieldValue("Value"));
isRecord = NextRecord();
}
}
}
}
}
catch(e)
{
TheApplication().RaiseErrorText("The Error is : " + e.toString());
}
finally
{
oRUPBC = null;
oRBC = null;
oRBO = null;
HAF Invoice fsetUserProper }
Header ty }

function BusComp_PreQuery ()
{
/* Added by KHAJA for Tip Compensation Interface on 17 FEB 06 */
// Set User Property. The routine will query repository BC to get the custom user properties
for the VBC and set it so that it can be used to set search spec.
fsetUserProperty();
//Set Workflow profile attribute – This workflow will be called to call the WS.
TheApplication().SetProfileAttr("WorkflowName", "HAF Meter Lookup WF");
//Set Search spec for the fields
var n = 1;
var sSearchField = this.GetUserProperty("QueryField"+n);
while (sSearchField != '')
{

this.SetSearchSpec(this.GetUserProperty("QueryField"+n),this.ParentBusComp().GetFieldValue(this
.GetUserProperty("QueryField"+n)));
n++;
var sSearchField = this.GetUserProperty("QueryField"+n);
HAF IXMAL }
Tip
Compensatio BusComp_PreQ return (ContinueOperation);
n uery }
function fsetUserProperty()
{
try
{
// Instantiate the Repository BO and BC for Bus Component object.
var oRBO = TheApplication().GetBusObject("Repository Business Component");
var oRBC = oRBO.GetBusComp("Repository Business Component");
with (oRBC)
{
// Query Repository Bus Comp BC for VBC
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Name", this.Name());
ExecuteQuery(ForwardOnly);
var isRecord = FirstRecord();
if (isRecord)
{
// Instantiate the Repository Bus Comp for User Properties
var oRUPBC = oRBO.GetBusComp("Repository Business Component User
Prop");
with (oRUPBC)
{
SetViewMode (AllView);
ActivateField("Name");
ActivateField("Value");
ExecuteQuery(ForwardOnly);
isRecord = FirstRecord();
while (isRecord)
{
// Set User property
this.SetUserProperty(GetFieldValue("Name"),GetFieldValue("Value"));
isRecord = NextRecord();
}
}
}
}
}
catch(e)
{
TheApplication().RaiseErrorText("The Error is : " + e.toString());
}
finally
{
oRUPBC = null;
HAF IXMAL oRBC = null;
Tip oRBO = null;
Compensatio fsetUserProper }
n ty }

HAF
Subscription //HAF1.0::Script added by VSAKARAY on 15-Feb-2006
Account (declarations) var sUpdated = "N";
function BusComp_PreWriteRecord ()
{

// Added By VIKUMAR On 07-02-2006


// Verifies that Duplicate IXMAL Accounts are not created for same Service Point
var sErrMsg = "";
try
{
if(sUpdated = "Y") //Updated by VSkaray On 16-Feb-06 to execute the script only
{ //when the Service Point field is updated.
var SubsAcntId = this.GetFieldValue("Id");
var ParentAcntId = this.GetFieldValue("HAF Parent Account Id");
var SrvPointId = this.GetFieldValue("HAF Service Point Id");

var SubsAcntBO = TheApplication().GetBusObject("Account");


var SubsAcntBC = SubsAcntBO.GetBusComp("HAF Subscription Account");

SubsAcntBC.ClearToQuery();
var sSearchExpr = "[HAF Parent Account Id] = '" + ParentAcntId + "' AND [HAF
Service Point Id] = '" + SrvPointId + "'";
SubsAcntBC.SetSearchExpr(sSearchExpr);
SubsAcntBC.ExecuteQuery();
var SubsRec = SubsAcntBC.FirstRecord();
while (SubsRec)
{
var SubsAcntRowId = SubsAcntBC.GetFieldValue("Id");
if (SubsAcntId != SubsAcntRowId)
{
sErrMsg = "HAF_Err_Msg_IXMAL_1";
TheApplication().RaiseError(sErrMsg);
break;
}
else
SubsRec = SubsAcntBC.NextRecord();

}
}
}
catch (e)
{
throw(e);
}
finally
{
SubsAcntBC = null;
SubsAcntBO = null;
HAF }
Subscription BusComp_Pre return (ContinueOperation);
Account WriteRecord }
}
var sViewName = TheApplication().ActiveViewName();
if(FieldName == "HAF Key Returned Flag" && sViewName == "HAF Account Detail -
Subscription Accounts View")
{
var sVal = this.GetFieldValue("HAF Key Returned Flag");
if(sVal == "Y")
{
var sKeyId = this.GetFieldValue("HAF Key Id");
//if(sKeyId != "")
{
var boBusObj = TheApplication().GetBusObject("HAF Generic");
var bcBusComp = boBusObj.GetBusComp("HAF Generic");
with (bcBusComp)
{
NewRecord(1);
SetFieldValue("Name","Released");
SetFieldValue("Type","HAF Key Id");
SetFieldValue("HAF Key Id",sKeyId);
var sNumber = sKeyId.substring(5);
var sPrefix = sKeyId.substring(0,5);
SetFieldValue("Serial Number",sNumber);
SetFieldValue("Prefix",sPrefix);
SetFieldValue("Region Code","R01");
//SetFieldValue("Region Code",this.GetFieldValue("HAF
RYCK Region"));
WriteRecord();
}
this.SetFieldValue("HAF Key Id","");
this.SetFieldValue("HAF Key Returned Flag","N");
var sDate = new Date();
var sToday = (sDate.getMonth() + 1) + "/" + sDate.getDate() + "/" +
sDate.getFullYear();
this.SetFieldValue("HAF Key Returned Date",sToday);
this.WriteRecord();
}
}
}
}
catch(e)
{
throw(e);
}
finally
{
boBusObj = null;
bcBusComp = null;
HAF }
Subscription BusComp_SetFi return(ContinueOperation);
Account eldValue }

Order Entry
- Line Items (declarations) var ValidateSrvPnt = "N";

function BusComp_PreSetFieldValue (FieldName, FieldValue)


{
if (FieldName == "Service Point")
{
ValidateSrvPnt = "Y";
}
Order Entry BusComp_PreS return (ContinueOperation);
- Line Items etFieldValue }
function BusComp_PreWriteRecord ()
{
// HAF 1.0 SE.3.1.C1 - Added By SSRIVANI On 15-02-2006
try
{
if (ValidateSrvPnt == "Y")
{
var SrvPntId = this.GetFieldValue("Asset Id");
var IPS = TheApplication().NewPropertySet();
var OPS = TheApplication().NewPropertySet();
IPS.SetProperty("Service Point Id", SrvPntId);
IPS.SetProperty("Input Type", "Service Point Id");
var ValidateBS = TheApplication().GetService("HAF Service Point Validation BS");
ValidateBS.InvokeMethod("ValidateSP", IPS, OPS);
var RetVal = OPS.GetProperty("Validated");
if (RetVal != "Y")
{
TheApplication().RaiseError("HAF_SRV_PNT_ERR_MSG_1");
return(CancelOperation);
}
}
}
catch (e)
{
throw (e);
}
finally
{
ValidateSrvPnt = null;
}
Order Entry BusComp_Pre return (ContinueOperation);
- Line Items WriteRecord }
var dateForm = currentDate.getDate() + "." + (currentDate.getMonth() + 1) + "." +
currentDate.getFullYear();

var dt1 = dateForm + " " + currentDate.getHours() + ":" + currentDate.getMinutes() + ":" +


currentDate.getSeconds();

if(ActiveBO == "Order Entry" || ActiveBO == "Order Entry (Sales)")


{
this.ActivateField("HAF Product Class");
this.ActivateField("HAF Regret Period Start Date");
this.ActivateField("Status");
this.ActivateField("Action Code");

iProductClass = this.GetFieldValue("HAF Product Class");


iStatus = this.GetFieldValue("Status");
iAction = this.GetFieldValue("Action Code");
iStatusVal =
TheApplication().InvokeMethod("LookupValue","FS_ORDER_STATUS","Complete");
iActionVal =
TheApplication().InvokeMethod("LookupValue","DELTA_ACTION_CODE","New");

if(iProductClass =="Infinite Subscription" || iProductClass =="Kablet Subscription")

{
if (iStatus == iStatusVal && iAction == iActionVal)
{
this.SetFormattedFieldValue("HAF Regret Period Start Date" , dt1);
}
}
}

catch(e)
{
throw(e);
}
finally
{
iActionVal = null;
iStatusVal = null;
currentDate = null;
iAction = null;
iStatus = null;
iStatus = null;
ActiveBO = null;
}
//End
Order Entry BusComp_Writ
- Line Items eRecord }

Order Entry
- Orders (declarations) var bSalesRepUpd = "N";
function BusComp_NewRecord ()
{
// Added by RNAGOJI on 17 Feb 2006 for HAF01.HLD.QOM.2.6.S1.

if (this.GetFieldValue("Price List") == "")

var oBCPick = this.GetPicklistBusComp("Price List");

with (oBCPick)

ClearToQuery();

SetSearchSpec("Name", "Standard Price List");

ExecuteQuery(ForwardOnly);

if(FirstRecord())

Pick();

oBCPick = null;

Order Entry BusComp_New


- Orders Record }

function BusComp_PreSetFieldValue (FieldName, FieldValue)


{
//Added By SSRIVANI On 10-02-06 for HLD.Gen.N.57
try
{
if (FieldName == "HAF Sales Rep Id")
{
bSalesRepUpd = "Y";
}
}
catch(e)
{
throw(e);
}
Order Entry BusComp_PreS return (ContinueOperation);
- Orders etFieldValue }
function BusComp_PreWriteRecord ()
{
//Added By SSRIVANI On 10-02-06 for HLD.Gen.N.57
try
{
if (bSalesRepUpd == "Y")
{
var sSalesRepRegion = this.GetFieldValue("HAF Sales Rep Region");
var sSalesRepRegionName = this.GetFieldValue("HAF Sales Rep Region Name");
this.SetFieldValue("HAF Sales Region", sSalesRepRegion);
this.SetFieldValue("HAF Sales Region Name", sSalesRepRegionName);
}
//Added By SVENKATA For Requirement HLD.QOM.2.6.N.16
//Begin
var val;
if(TheApplication().GetProfileAttr("ModifyButton") == "Y")
{
TheApplication().SetProfileAttr("ModifyButton",'N');
val =
TheApplication().InvokeMethod("LookupValue","HAF_ORDER_SUB_TYPE","Upgrade");
this.SetFieldValue("HAF Sub Type", val);
}
//END

}
catch(e)
{
throw(e);
}
finally
{
bSalesRepUpd = null;
val = null;
}

Order Entry BusComp_Pre return (ContinueOperation);


- Orders WriteRecord }
var intMil = Date.parse(InitialDate);
var count = 8;
var sDate = "";
var sMonth = "";
var sYear = "";
while(count!=0)
{
intMil = intMil + (24*60*60*1000);
var dateLater = new Date(intMil);
var dayLater = dateLater.getDay();
if (dayLater != 0 && dayLater != 6)
{
count = count - 1;
}
}
sDate = dateLater.getDate();
sMonth = dateLater.getMonth() + 1;
sYear = dateLater.getFullYear();
if (sDate < 10)
{
sDate = "0" + sDate;
}
if (sMonth < 10)
{
sMonth = "0" + sMonth;
}
var ExpiryDate = sMonth + "/" + sDate + "/" + sYear;
this.SetFieldValue("End Date",ExpiryDate);
return (ContinueOperation);
}

catch(e)
{
TheApplication().RaiseErrorText(e.toString());
throw(e)
}
finally
{
InitialDate = null;
intDate = null;
intDay = null;
intMil = null;
count = null;
sDate = null;
sMonth = null;
sYear = null;
dateLater = null;
ExpiryDate = null;
BusComp_New }
Quote Record }
//**HAF1.0:HLD.SE.4.1.N.13:*Code added by ASANJAY on 02-Feb-2006.*
var ServicePointUpdate = 'N';
Quote Item (declarations) var ValidateSrvPnt = "N";
function BusComp_PreWriteRecord ()
{
// HAF 1.0 SE.3.1.C1 - Added By SSRIVANI On 15-02-2006
try
{
if (ValidateSrvPnt == "Y")
{
var SrvPntId = this.GetFieldValue("Usage Asset Id");
var IPS = TheApplication().NewPropertySet();
var OPS = TheApplication().NewPropertySet();
IPS.SetProperty("Service Point Id", SrvPntId);
IPS.SetProperty("Input Type", "Service Point Id");
var ValidateBS = TheApplication().GetService("HAF Service Point Validation BS");
ValidateBS.InvokeMethod("ValidateSP", IPS, OPS);
var RetVal = OPS.GetProperty("Validated");
if (RetVal != "Y")
{
TheApplication().RaiseError("HAF_SRV_PNT_ERR_MSG_1");
return(CancelOperation);
}
}
}
catch (e)
{
throw (e);
}
finally
{
ValidateSrvPnt = null;
}
BusComp_Pre return (ContinueOperation);
Quote Item WriteRecord }

function BusComp_SetFieldValue (FieldName)


{
//**HAF1.0:HLD.SE.4.1.N.13:*Code added by ASANJAY on 02-Feb-2006.*
if (FieldName == "Service Point")
{
ServicePointUpdate = 'Y';
ValidateSrvPnt = "Y"; //HAF 1.0 SE.3.1.C1 - Added By SSRIVANI On 15-02-2006
BusComp_SetFi }
Quote Item eldValue }
function BusComp_WriteRecord ()
{
try //<Begin>**HAF1.0:HLD.SE.4.1.N.13:*Code added by ASANJAY on 02-Feb-2006.*
{
var oBO = TheApplication().GetBusObject("Quote");
var oBC = oBO.GetBusComp("Quote Item");
if (ServicePointUpdate == 'Y')
{
this.ActivateField("Root Quote Item Id");
this.ActivateField("Parent Quote Item Id");
this.ActivateField("Service Point");
this.ActivateField("Usage Asset Id");
var RootId = this.GetFieldValue("Root Quote Item Id");
var ParentId = this.GetFieldValue("Parent Quote Item Id");
var ServicePoint = GetFieldValue("Service Point");
if (ParentId == null || ParentId == "")
{
oBC.SetViewMode(AllView);
oBC.ClearToQuery();
oBC.SetSearchSpec("Root Quote Item Id", RootId);
oBC.ExecuteQuery(ForwardBackward);
var isRecord = oBC.FirstRecord();
if(isRecord)
{
while (isRecord)
{
oBC.SetFieldValue("Usage Asset Id", ServicePoint);
oBC.WriteRecord();
isRecord = oBC.NextRecord();
}
}
}

}//<End>**HAF1.0:HLD.SE.4.1.N.13:*Code added by ASANJAY on 02-Feb-2006.*


return (ContinueOperation);
}catch(e)
{
TheApplication().RaiseErrorText(e.errText);
}
finally
{
oBC = null;
oBO = null;
ServicePointUpdate = 'N';
}
BusComp_Writ
Quote Item eRecord }
bcAcc.SetSearchSpec("Id",sAccId);
bcAcc.ExecuteQuery();
if(bcCon.FirstRecord())
{
bcAcc.SetFieldValue("Main Phone Number", sWrkPhn);
bcAcc.SetFieldValue("Main Fax Number", sFaxPhn);
var
sLOVType=TheApplication().InvokeMethod("LookupValue","ACCOUNT_TYPE","Residential
");
bcAcc.SetFieldValue("Type", sLOVType);
Business bcAcc.GetMVGBusComp("Street Address");
Service Name Script var bcCUTAddr = bcAcc.GetMVGBusComp("Street Address");
function Maximum(FieldName1,FieldName2,Field3,Field4,Field5,FieldName6)
{ var bcAddrAssocBC = bcCUTAddr.GetAssocBusComp();
//HAF1.0::Script added bcAddrAssocBC.ClearToQuery();
by VSAKARAY on 15-Feb-2006
//to get the maximum bcAddrAssocBC.SetSearchSpec("Id",
value of Connection Numbers orsPrmAddrId);
Key Ids.
var ErrMsg = ""; bcAddrAssocBC.ExecuteQuery();
try if(bcAddrAssocBC.FirstRecord())
{ {
bcAddrAssocBC.Associate(NewAfter);
var boGeneric = TheApplication().GetBusObject("HAF Generic");
bcAddrAssocBC.WriteRecord();
var bcGeneric = boGeneric.GetBusComp("HAF Generic");
var iMax = null; }
bcAcc.SetFieldValue("Primary Address Id", sPrmAddrId);
var sField = FieldName1;
bcAcc.WriteRecord();
var sType = FieldName2;
var sStart} = Field3;
var sEnd return(CancelOperation);
= Field4;
}var sPrefix = Field5;
catch(e)
with (bcGeneric)
{{
throw(e);
ClearToQuery();
} if(FieldName2 == "Infinite")
finally {
{ var sSearchExpr = "[Type]= '" + sField + "' AND [Alarm Type]= '"
+ sType + "' AND [Name]= boBusObj = null; AND [Prefix] = '" + sPrefix + "'";
'Maximum'
bcCon
} = null;
bcAcc = null; == "Non-Infinite")
if(FieldName2
} {
} var sSearchExpr = "[Type]= '" + sField + "' AND [Alarm Type]= '"
+ sType return(ContinueOperation);
+ "' AND [Name]= 'Maximum' AND [Region Code] = '" + FieldName6 + "' AND
HAF }[Prefix] = '" + sPrefix + "'";
BusinessToC Service_PreInvokeM }
ustomer ethod //End. SetSearchExpr(sSearchExpr);
ExecuteQuery();
var isRecord = bcGeneric.FirstRecord();
if(isRecord)
iMax = bcGeneric.GetFieldValue("Serial Number");
else
{
NewRecord(1);
SetFieldValue("Name","Maximum");
SetFieldValue("Type",sField);
SetFieldValue("Alarm Type",sType);
SetFieldValue("Serial Number",sStart);
SetFieldValue("Prefix",sPrefix);
if(FieldName2 == "Non-Infinite")
SetFieldValue("Region Code",FieldName6);
WriteRecord();
}
}
}
catch(e)
{
throw(e)
}
finally
{
boGeneric = null;
bcGeneric = null;
}
HAF Code return(iMax);
Generation Maximum }
try }
{}
var boBusObj
if(MethodName = TheApplication().GetBusObject("HAF Generic");
== "GenerateIXMALId")
{ var bcBusComp = boBusObj.GetBusComp("HAF Generic");
with
try (bcBusComp)
{{
ClearToQuery();
var boGeneric = TheApplication().GetBusObject("HAF Generic");
var
var sSearchExpr = "[Type] ='" + FieldName + "' AND
bcGeneric = boGeneric.GetBusComp("HAF [Region Code] = '"
Generic");
+ FieldValue + "' AND var [Name]
boBusObj= 'Released'";
= TheApplication().GetBusObject("Account");
SetSearchExpr(sSearchExpr);
var bcBusComp = boBusObj.GetBusComp("HAF Subscription
Account"); ExecuteQuery();
var
var isRecord
sSerNum;;
isRecord = bcBusComp.FirstRecord();
if(isRecord)
with (bcBusComp)
{{
SetSortSpec("Serial Number(ASCENDING)");
ClearToQuery();
ExecuteQuery();
SetSearchSpec ("HAF IXMAL Id", "is not NULL");
var sVal = bcBusComp.GetFieldValue("HAF Key Id");
ExecuteQuery();
var sRowId = bcBusComp.GetFieldValue("Id");
if(FirstRecord( ))
} {
ClearToQuery(); with (bcGeneric)
SetSearchSpec("Id",sRowId);
{
ExecuteQuery(); ClearToQuery();
if(bcBusComp.FirstRecord())
var sVal = "HAF IXMAL Id"
DeleteRecord();
SetSearchSpec ("Type",sVal);
return(sVal);
} ExecuteQuery();
} sSerNum = bcGeneric.GetFieldValue("Serial
catch(e)
Number");
{ var iSerNum = ToNumber(sSerNum);
throw(e); iSerNum = (iSerNum + 1);
} sSerNum = ToString(iSerNum);
finally if(sSerNum.length < 4)
{ while(sSerNum.length != 4)
bcBusComp = null; sSerNum = "0" + sSerNum;
boBusObj = null; SetFieldValue("Serial Number",sSerNum);
HAF Code } WriteRecord();
Generation Minimum } }
}
else
{
sSerNum = "0001";
with (bcGeneric)
{
NewRecord(1);
SetFieldValue("Name","Maximum");
SetFieldValue("Type","HAF IXMAL Id");
SetFieldValue("Serial Number",sSerNum);
WriteRecord();
}
}
}
Outputs.SetProperty("Serial Number",sSerNum);
return(CancelOperation);
}
catch(e)
{
throw(e);
}
finally
{
boBusObj = null;
bcBusComp = null;
}
}
HAF Code Service_PreInvokeM return (ContinueOperation);
Generation ethod }
{
SetFieldValue("Serial Number",FieldValue1);
if(sField == "HAF Key Id")
{
ActivateField("HAF Key Id");
SetFieldValue("HAF Key Id",FieldValue3);
}
WriteRecord();
}
else
{
NewRecord(1);
SetFieldValue("Name","Maximum");
SetFieldValue("Type",sField);
if(sField == "HAF Key Id")
{
ActivateField("HAF Key Id");
SetFieldValue("HAF Key Id",FieldValue3);
}
SetFieldValue("Alarm Type",sType);
SetFieldValue("Serial Number",FieldValue1);
SetFieldValue("Prefix",FieldValue2);
if(FieldName2 == "Non-Infinite")
SetFieldValue("Region Code",FieldName3);
WriteRecord();
}
}
}
catch(e)
{
throw(e)
}
finally
{
boGeneric = null;
bcGeneric = null;
HAF Code }
Generation UpdateField }

HAF
Exception
Handler (declarations) var srowid;
with (bcError)
{
SetViewMode(AllView);
ActivateField("HAF Log Level");
ActivateField("HAF Error Code");
ActivateField("HAF Error Desc");
ActivateField("HAF Object Type");
ActivateField("HAF Object Name");
ActivateField("HAF Object Id");
ActivateField("HAF Global Event Name");
ActivateField("HAF Login Name");
ActivateField("HAF Process Type");
NewRecord(1);
SetFieldValue("HAF Log Level",strLogLevel);
SetFieldValue("HAF Error Code",Inputs.GetProperty("Error Code"));
SetFieldValue("HAF Error Desc",strErrMsg);
SetFieldValue("HAF Object Type",Inputs.GetProperty("Object
Type"));
SetFieldValue("HAF Object Name",Inputs.GetProperty("Object
Name"));
SetFieldValue("HAF Object Id",Inputs.GetProperty("Object Id"));
SetFieldValue("HAF Global Event Name",Inputs.GetProperty("Global Event
Name"));
function RouteErrorHandling(Inputs)
{ SetFieldValue("HAF Login Name",strLogName);
SetFieldValue("HAF Process Type","BATCH");
var psMessage;
Parrowid = GetFieldValue("Id");
psMessage = Inputs.GetProperty("HAF Global Event Name");
WriteRecord();
}
/*To Control the error files logged into error table based on following LOV type
*/
bcError = null;
var strLogLevel;
boError
strLogLevel = null;
= Inputs.GetProperty("HAF Log Level");
return(ContinueOperation);
//var strLovVal = TheApplication().InvokeMethod ("LookupValue",
HAF "HAF_LOGLEVEL", "HAF Loglevel");
//var strLovVal = TheApplication().InvokeMethod ("LookupValue",
Exception "HAF_LOGLEVEL", "5");
Handler BatchHandling } var getLookup = TheApplication().GetService("HAF Generic Lookup BS");
var strLovVal = getLookup.InvokeMethod ("LookupVal", "HAF_LOGLEVEL", "HAF
Loglevel");

if (strLogLevel > strLovVal)


{
return(CancelOperation);
}

switch (psMessage){

case "Synchronous Call":


WriteError(Inputs);
XMsgDisplay(Inputs);
break;
case "A-Synchronous Call":
WriteError(Inputs);
break;
case "Internal Siebel WF":
WriteError(Inputs);
break;
case "Business Service":
WriteError(Inputs);
break;
default:
WriteError(Inputs);
break;
HAF }
Exception
Handler RouteErrorHandling }
}

strLogName = TheApplication().LoginName();
strLogLevel = Inputs.GetProperty("Log Level");

if (strLogLevel == "1") {
strLogLevel = "Critical";
}
else if (strLogLevel == "2"){
strLogLevel = "Medium";
}
function Service_PreInvokeMethod
else if (strLogLevel == (MethodName,
"3"){ Inputs, Outputs)
{ strLogLevel = "Minor";
/* }
Author : HAFSLUND
else if (strLogLevel == "4"){
Date : 30th Jan - 2006= "Info";
strLogLevel
Description: }This Business Service is used to capture the exceptions
which may occur
else from Interface ==
if (strLogLevel Workflow
"5"){ processes,business services and
any scripting strLogLevel
events/methods.The
= "Debug";property sets which gets the error details
will be stored} in Error tables to show in Error Admin screen.
*/
with (BcError)
var retval = ContinueOperation;
{
SetViewMode(AllView);
switch (MethodName) {
ActivateField("HAF Log Level");
case "HAFLogException":
ActivateField("HAF Error Code");
RouteErrorHandling(Inputs);
ActivateField("HAF Error Desc");
retval=CancelOperation;
ActivateField("HAF Object Type");
break; ActivateField("HAF Object Name");
ActivateField("HAF Object Id");
case "HAFBatchException":
ActivateField("HAF Global Event Name");
BatchHandling(Inputs);
ActivateField("HAF Login Name");
retval NewRecord(1);
= CancelOperation;
break; SetFieldValue("HAF Log Level",strLogLevel);
} SetFieldValue("HAF Error Code",Inputs.GetProperty("HAF Error
HAF
Code"));
Exception Service_PreInvokeM return(retval);
SetFieldValue("HAF Error Desc",strErrMsg);
Handler ethod } SetFieldValue("HAF Object Type",Inputs.GetProperty("HAF Object
Type"));
SetFieldValue("HAF Object Name",Inputs.GetProperty("HAF Object
Name"));
SetFieldValue("HAF Object Id",Inputs.GetProperty("HAF Object Id"));
SetFieldValue("HAF Global Event Name",Inputs.GetProperty("HAF
Global Event Name"));
SetFieldValue("HAF Login Name",strLogName);
srowid = GetFieldValue("Id");
WriteRecord();
}

// }
/* catch(e){
// var sText = e.errText;
// var nCode = e.errCode;

//TheApplication().Trace(e.toString());
//throw e;

goto CleanUp;
}

*/
CleanUp:
BcError = null;
BoAccount = null;
HAF
Exception return(ContinueOperation);
Handler WriteError }
function XMsgDisplay(Inputs)
{
var InMessage;

InMessage = Inputs.GetProperty("HAF Error Message");

if(InMessage != ""){
TheApplication().RaiseErrorText(InMessage);
}
HAF
Exception return(ContinueOperation);
Handler XMsgDisplay }

function LookupMsg (Inputps, Outputps)


{
try
{
var sErrorMessage = "";
var strCategory = Inputps.GetProperty("Category");
var strKey = Inputps.GetProperty("Key");
var strRetMsg = TheApplication().LookupMessage(strCategory, strKey);
Outputps.SetProperty("ErrorMessage",strRetMsg);
}
catch(e)
{
throw e;
HAF }
Generic return(CancelOperation);
Lookup BS LookupMsg }
function LookupVal (Inputps, Outputps)
{
try
{
var strType = Inputps.GetProperty("Type");
var strName = Inputps.GetProperty("LIC");
var strRetVal = TheApplication().InvokeMethod("LookupValue",strType, strName);
Outputps.SetProperty("LOV Value",strRetVal);
}
catch(e)
{
throw e;
HAF }
Generic return(CancelOperation);
Lookup BS LookupVal }

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)


{
try
{
var sErrorMessage = "";
if (MethodName == "LookupMsg")
{
LookupMsg(Inputs, Outputs);
return(CancelOperation);
}
if (MethodName == "LookupVal")
{
LookupVal(Inputs, Outputs);
return(CancelOperation);
}

}
catch(e)
{
TheApplication().RaiseErrorText();
HAF }
Generic Service_PreInvokeM return (ContinueOperation);
Lookup BS ethod }
Outputs.SetProperty("MDBLetterType", sLetterType);

Outputs.SetProperty("MDBLetterCode", "Disconnect Letter");


}
} // end of else loop of if(vSubType == "Install")
else
{
if(vSubType == "Disconnect" || vSubType
== "Moving")
{
sLetterType = "D2";

Outputs.SetProperty("MDBLetterType", sLetterType);

Outputs.SetProperty("MDBLetterCode", "Disconnect Letter");


}
} // end of else
} //end of if(Assetthere)
} //end of if(IPproper1)
}
catch(e) {
TheApplication().Trace("The Error is : " + e);
}
finally
{
vOrderBO = null;
vAccntBO = null;
vOrderBC = null;
isvOrderBC = null;
vAccntBC = null;
isvAccntBC = null;
vAssetBC = null;
vOrderLineItemBC = null;
return (CancelOperation);
HAF MDB }
Message Service_PreInvokeM } //end of if (MethodName == "LetterGenerate")
Update ethod }

function LogPropSet(Inputs, FileName)


{
// Write Propsets to File
var fileSvc = TheApplication().GetService("EAI XML Write to File");
var outps = TheApplication().NewPropertySet();
var fileloc = "C:\\temp\\"+ FileName;
var tmpProp = Inputs.Copy();
tmpProp.SetProperty("FileName",fileloc);
fileSvc.InvokeMethod("WritePropSet", tmpProp, outps);
HAF MDB- outps = null;
Safecon tmpProp = null;
Batch fileSvc = null;
Service LogPropSet }
continue;
}
}
isRecord = NextRecord();
}
}
}
SetFieldValue("Value", sysdatestring);
SetFieldValue("Name", sysdatestring);
WriteRecord();
}
}
var schildcount = Outputs.GetChildCount();
if(schildcount > 0)
bAccountFound = 'Y';
Outputs.SetProperty("AccountFound", bAccountFound);
}
}
catch (e)
{
}
finally
{
oLOVBC = null;
oLOVBO = null;
oOrderBC = null;
oSrvReqBC = null;
oActionBC = null;
oAssetBC = null;
oAddressBC = null;
oAccountBC = null;
oAccountBO = null;
EaiSiebAdapPS = null;
EAISiebAdapBS = null;
HAF MDB- return (CancelOperation);
Safecon }
Batch Service_PreInvokeM return (ContinueOperation);
Service ethod }

function LogPropSet(Inputs, FileName)


{
// Write Propsets to File
var fileSvc = TheApplication().GetService("EAI XML Write to File");
var outps = TheApplication().NewPropertySet();
var fileloc = "C:\\temp\\"+ FileName;
var tmpProp = Inputs.Copy();
tmpProp.SetProperty("FileName",fileloc);
fileSvc.InvokeMethod("WritePropSet", tmpProp, outps);
outps = null;
HAF Order tmpProp = null;
Search Spec fileSvc = null;
Service LogPropSet }
} = 'Delete')) OR ([Status] = 'Existing' AND [Action Code] = '-' ))";
Code]
else
{ SetSearchExpr(sSearchExpr);
TheApplication().RaiseErrorText("Id Not Found");
ExecuteQuery(ForwardOnly);
} var isRecord = FirstRecord();
}
} }
else if (MethodName == 'GetCount')
{ // Loop through for all the Line Items that were selected to transfer to the
LogPropSet(Inputs,
Part tracker "GetCountInput.xml");
var SiebelMessagePS = Inputs.GetChild(0);
while (isRecord)
LogPropSet(SiebelMessagePS,
{ "SiebelMessagePSInput.xml");
TheApplication().Trace(" after get siebel message ");
with(oActivityPT)
var sIxmalno = Inputs.GetProperty("Account
{ Id");
var iLineCount = ActivateField("Order Item Id");
SiebelMessagePS.GetChild(0).GetChild(0).GetChild(0).GetChildCount();
ActivateField("Product Id");
TheApplication().Trace("ActivateField("Product
after get count "); Name");
TheApplication().Trace("//oActivityPT.ActivateField("Part
Child Count : " + iLineCount); Number");
SiebelMessagePS.GetChild(0).GetChild(0).SetProperty("City",
ActivateField("Asset Id"); sIxmalno);
TheApplication().Trace("ActivateField("Asset
after set ixmal "); Number");
//Outputs = Inputs.Copy();
//oActivityPT.ActivateField("Part Cost");
TheApplication().Trace("//ActivateField("HAF
after output copy"); Fulfillment");
Outputs.SetProperty("LineCount", iLineCount);
ActivateField("HAF Reason for not Billing");
Outputs.AddChild(SiebelMessagePS);
LogPropSet(Outputs, "Outputs.xml");
NewRecord(NewAfter);
} SetFieldValue("Order Item Id",
}
oOrderLIBC.GetFieldValue("Id"));
catch(e) SetFieldValue("Product Id",
{
oOrderLIBC.GetFieldValue("Product Id"));
} SetFieldValue("Product Name",
finally
oOrderLIBC.GetFieldValue("Product"));
{ //oActivityPT.SetFieldValue("Part Number",
oOrderLineBC = null;
oOrderLIBC.GetFieldValue("Part Number"))
oOrderBO = null; //SetFieldValue("Asset Id", oOrderLIBC.GetFieldValue("Asset
return(CancelOperation);
Id"))
HAF Order } // SetFieldValue("Asset Number",
Search Spec Service_PreInvokeM oOrderLIBC.GetFieldValue("Asset
return (ContinueOperation); Number"))
Service ethod } SetFieldValue("Part Cost", oOrderLIBC.GetFieldValue("Cost"))
//SetFieldValue("HAF Fulfillment",
oOrderLIBC.GetFieldValue("Status"))
//GetFieldValue("HAF Reason for not Billing");
SetFieldValue("HAF Reason for not Billing","Deviation");

if( oOrderLIBC.GetFieldValue("Action Code") == "Add" )


{
SetFieldValue("Status", "Good");
SetFieldValue("Source", "Trunk");
SetFieldValue("Destination", "Customer");
}
else if( oOrderLIBC.GetFieldValue("Action Code") == "Delete" )
{
SetFieldValue("Status", "Good-Used");
SetFieldValue("Source", "Customer");
SetFieldValue("Destination", "Trunk");
}

if(oOrderLIBC.GetFieldValue("Product") != "*Service*Charge*")
{
SetFieldValue("Billable Flag", 'Y')
}
WriteRecord();

isRecord = oOrderLIBC.NextRecord();
HAF Part }
Tracker }
Movement }
BS MovetoPartTracker }
function Service_PreCanInvokeMethod (MethodName, &CanInvoke)
{
if( MethodName == "MovetoPartTracker" )
{
CanInvoke = "TRUE";
HAF Part return( CancelOperation );
Tracker }
Movement Service_PreCanInvo return (ContinueOperation);
BS keMethod }

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)


{
if( MethodName == "MovetoPartTracker" )
{
var activityId = Inputs.GetProperty("Activity Id")
MovetoPartTracker(activityId);
HAF Part return(CancelOperation);
Tracker }
Movement Service_PreInvokeM return (ContinueOperation);
BS ethod }
//SetFieldValue("Asset Id",sAssetId);

SetFieldValue("Action Code","Add");

//SetFieldValue("Part Number",sPartNo);

if (bBillable ==
'N')
{

SetFieldValue("Unit Price - Display","0");


//Set
Discount to 100%
}
//Update Qty
also
//Update
Service Start Date

SetFieldValue("Product",sProdName);

SetFieldValue("Service Point",sAssetId);
WriteRecord();

SetFieldValue("Status",sFulfillment);
WriteRecord();

}//22
}//end with//21
}//end if//20
HAF Part
Tracker }
OrderLineIt var parentOrderItemId; }
em BS (declarations) var rootOrderItemId; }
//Go To next Activity Part Tracker record and continue
isRecord = NextRecord();
}//end with
//Update Order Status to 'Complete' if all Order Line Items
have status Complete/Done
}//end if bMoveParts == true

//set Order Update in Action to True


//oActionBC.SetFieldValue("HAF Order Updated", "Y");
//WriteRecord();

updateOrderStatus(sOrderId);

}//5
}
catch (e)
{
throw(e);
}
finally
{
oOrderLIBC = null;
oOrderBC= null;
oOrderBO= null;
oActivityPTBC= null;
HAF Part oActionBC= null;
Tracker oActionBO= null;
OrderLineIt MovePartsToOrderL }
em BS ineItem }//1
function Service_PreCanInvokeMethod (MethodName, &CanInvoke)
{
if( MethodName == "MovePartsToOrderLineItem" )
{
CanInvoke = "TRUE";
HAF Part return( CancelOperation );
Tracker }
OrderLineIt Service_PreCanInvo return (ContinueOperation);
em BS keMethod }

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)


{
if( MethodName == "MovePartsToOrderLineItem" )
{
var activityId = Inputs.GetProperty("Activity Id");
MovePartsToOrderLineItem(activityId);
HAF Part return(CancelOperation);
Tracker }
OrderLineIt Service_PreInvokeM return (ContinueOperation);
em BS ethod }
{
oOrderBC = oOrderBO.GetBusComp("Order Entry - Orders");
sProdName
oOrderLIBC = sProdNm;
= oOrderBO.GetBusComp("Order Entry - Line Items");
}
oOrderBO = TheApplication().GetBusObject("Order Entry (Sales)");
with (oOrderLIBC)
oOrderLIBC
{//10 = oOrderBO.GetBusComp("Order Entry - Line Items");
with (oOrderLIBC)
ActivateField("Status");
{//19 ActivateField("Action Code");
ActivateField("Service
ClearToQuery(); Point");
ActivateField("Product");
sSearchExpr = "(([Action Code] = 'Add' OR [Action Code] = 'Delete' OR
ActivateField("Parent
[Action Code] = 'Update') AND ([Status] <>Order Item Id");
'Complete' AND [Status] <> 'Abandoned'))";
ActivateField("Root Order Item Id");
SetSearchExpr(sSearchExpr);
ClearToQuery();
ExecuteQuery(ForwardOnly);
SetSearchSpec("Service
isRecord = FirstRecord();Point", sAssetId );
SetSearchSpec("Product",
bUpdateOrderStatus = true; sProdName );
ExecuteQuery(ForwardOnly)
if (isRecord)
{isRecord = FirstRecord();
if (isRecord)
bUpdateOrderStatus = false;
{}
} orderItemId = GetFieldValue("Id");
parentOrderItemId = GetFieldValue("Parent Order Item Id");
//Update therootOrderItemId = GetFieldValue("Root
status of the order line items with actionOrder Item
code Id");
of ‘–‘ to
Complete and Order} ‘Status’ = ‘Complete’
}if (bUpdateOrderStatus == true)
return
{ (orderItemId);
} with (oOrderBC)
catch(e) {//10
{ ActivateField("Status");
throw (e) ClearToQuery();
} SetSearchSpec("Id",sOrderId);
finally ExecuteQuery(ForwardOnly);
{ isRecord = FirstRecord();
oOrderLIBC =ifnull;(isRecord)
oOrderBO = null;{
orderItemId = null; SetFieldValue("Status","Complete");
HAF Part oActivityPTBC = null;
Tracker WriteRecord();
oActionBO = null;
}
OrderLineIt } }
em BS getOrderLineItemId } with (oOrderLIBC)
{//10
ActivateField("Status");
ActivateField("Action Code");
ClearToQuery();
SetSearchSpec("Action Code","-");
ExecuteQuery(ForwardOnly);
isRecord = FirstRecord();
while (isRecord)
{
SetFieldValue("Status","Complete");
WriteRecord();
isRecord = NextRecord();
}
}

}
}
catch (e)
{
throw(e);
}
finally
{

oOrderBC = null;
HAF Part oOrderLIBC = null;
Tracker oOrderBO = null;
OrderLineIt }
em BS updateOrderStatus }
{
if (IPType == "Service Point Address Id")
{
var SrvPntAddrBO = TheApplication().GetBusObject("CUT
Address");
var SrvPntAddrBC = SrvPntAddrBO.GetBusComp("CUT
Address");

SrvPntAddrBC.ClearToQuery();
SrvPntAddrBC.SetSearchSpec("Id", ServPointId);
SrvPntAddrBC.ExecuteQuery();
if (SrvPntAddrBC.FirstRecord())
{
ServPntZip = SrvPntAddrBC.GetFieldValue("Postal
Code");
}
else
{
ValidateFlag = "N";
}
}
else
{
ServPntZip = ServPointId;
}
}
if ((ServPntZip != "") && (ServPntZip != null))
{
function Service_PreInvokeMethod
var SrvRegZipBO(MethodName, Inputs, Outputs)
= TheApplication().GetBusObject("Abs Admin
{Service Region");
// HAF 1.0 SE.3.1.C1 - Added By SSRIVANI & VIKUMAR On
var ZipBC = SrvRegZipBO.GetBusComp("Zip Code"); 15-02-2006
if (MethodName == "ValidateSP")
ZipBC.ClearToQuery();
{ ZipBC.ActivateField("HAF RYCK Region");
ValidateSP(Inputs, Outputs);
var sSearchExpr = "[Zip Code] = '" + ServPntZip + "' AND [HAF RYCK
HAF Service return (CancelOperation);
Point Region] IS NOT NULL";
} ZipBC.SetSearchExpr(sSearchExpr);
Validation Service_PreInvokeM return (ContinueOperation);
ZipBC.ExecuteQuery();
BS ethod } if (ZipBC.FirstRecord())
{
ValidateFlag = "Y";
}
else
{
ValidateFlag = "N";
}
}
else
{
ValidateFlag = "N";
}
Outputs.SetProperty("Validated", ValidateFlag);
}
catch (e)
{
throw (e);
}
finally
{
ZipBC = null;
SrvRegZipBO = null;
SrvPntAddrBC = null;
SrvPntAddrBO = null;
ServPntBC = null;
HAF Service ServPntBO = null;
Point }
Validation return(CancelOperation);
BS ValidateSP }
HAF VBC
Service (declarations) var sIntCompName;

function ChangeType(Inputs, Outputs)


{
//Function : This script will change the type of the propertyset to the type passed by
the workflow process property “TypeString”.
if (Inputs.GetProperty("TypeString") == "")
{
Inputs.GetChild(0).SetType("SiebelMessage");
}
else
{
Inputs.GetChild(0).SetType(Inputs.GetProperty("TypeString"));
}
// Outputs = Inputs.Copy();
Outputs.AddChild(Inputs.GetChild(0));
LogPropSet(Outputs, "ChangeTypeOutputs.xml");
HAF VBC return(CancelOperation);
Service ChangeType }
for (i = 0; i<childcount ; i++)
{
var spropertyName =
fileoutPS.GetChild(0).GetChild(0).GetChild(0).GetChild(i).GetFirstProperty();
while (spropertyName != "")
{
if
(fileoutPS.GetChild(0).GetChild(0).GetChild(0).GetChild(i).GetProperty(spropertyName
) != propPS.GetChild(0).GetProperty(spropertyName))
sfoundflag = 'N';
var spropertyName =
fileoutPS.GetChild(0).GetChild(0).GetChild(0).GetChild(i).GetNextProperty();
function Init (Inputs, Outputs)
{ }
//Function : This functionifqueries
(sfoundflag == 'Y')
the repository components to get the VBC fields and
initializes the fields. Continue;
try }
{ fileoutPS.GetChild(0).GetChild(0).GetChild(0).GetChild(i-
1).SetProperty(“Type”, “Deleted”);
var oRepBusCompBO = TheApplication().GetBusObject("Repository Business
Component"); var oWriteBS = TheApplication().GetService("EAI XML Write to File");
fileoutPS.SetProperty("FileName",
var oRepBusCompBC sfileName);
= oRepBusCompBO.GetBusComp("Repository Business
Component"); var filePS = TheApplication().NewPropertySet();
oWriteBS.InvokeMethod("WritePropSet",fileoutPS, filePS);
with (oRepBusCompBC)
}{
} SetViewMode (AllView);
catch(e) ClearToQuery();
{ SetSearchSpec("Name", Inputs.GetProperty("Business Component
Name")); TheApplication().RaiseErrorText("The Error is : " + e.toString());
} SetSearchSpec("Repository Name", "Siebel Repository");
finally ExecuteQuery("ForwardOnly");
{ var isRecord = FirstRecord();
propPSif=(isRecord)
null;
fileinPS=
{ null;
fileoutPS = null;
var oRepFieldBC = oRepBusCompBO.GetBusComp("Repository
Field"); filePS = null;
readBS = null;with (oRepFieldBC)
oWriteBS = null;
{
HAF VBC } SetViewMode (AllView);
Service CreateProp } SetSearchSpec("Repository Name", "Siebel Repository");
ExecuteQuery("ForwardOnly");
isRecord = FirstRecord();
while (isRecord)
{
var fieldname = GetFieldValue("Name");
if (GetFieldValue("Name") != "")
{

Outputs.SetProperty(GetFieldValue("Name"),"");
}
isRecord = NextRecord();
}
}
}
}
}
catch(e)
{
TheApplication().RaiseErrorText("The Error is : " + e.toString());
}
finally
{
oRepFieldBC = null;
oRepBusCompBC = null;
oRepBusCompBO = null;
LogPropSet(Outputs, "InitOutput.xml");
return (CancelOperation);
HAF VBC }
Service Init }
Try
{
var fileinputPS = Inputs.Copy();
fileinputPS.SetProperty("MethodName","Insert");
fileinputPS.SetProperty("bsBusComp",Inputs.GetProperty("Business
Component Name"));
if (Inputs.GetProperty("Business Component Name") == 'HAF Invoice
Lineitem VBC')
{
CreateProp(fileinputPS);
}
Else
{
//Call workflow process
var wfInputPS = TheApplication().NewPropertySet();
var sworkflowName =
TheApplication.GetProfileAttribute("WorkflowName");
var wfOutputPS = TheApplication().NewPropertySet();
var queryPS = TheApplication.NewPropertySet();
queryPS.SetType("QueryInputs");
queryPS.AddChild(Inputs);
wfInputPS.AddChild(queryPS);
wfInputPS.SetProperty(“ProcessName”, sworkflowName);
var wfBS = TheApplication().GetService("Workflow Process
Manager");
TheApplication().SetProfileAttr(“Insert”,”Y”);
wfBS.InvokeMethod("RunProcess", wfInputPS, wfOutputPS);
}
}
Catch (e)
{
//Show error.
}
Finally
{
//Destroy objects
HAF VBC }
Service Insert }

function LogPropSet(Inputs, FileName)


{
//Function : Write the propertysets to files. The files will be used for and
troubleshooting.
// Write Propsets to File
var fileSvc = TheApplication().GetService("EAI XML Write to File");
var outps = TheApplication().NewPropertySet();
var fileloc = "C:\\temp\\"+ FileName;
var tmpProp = Inputs.Copy();
tmpProp.SetProperty("FileName",fileloc);
fileSvc.InvokeMethod("WritePropSet", tmpProp, outps);
outps = null;
tmpProp = null;
HAF VBC fileSvc = null;
Service LogPropSet }
}
if (ChildPS.GetProperty("node-type") == 'Constant')
{
sChildValue = ChildPS.GetValue();
// Remove * from the value.
if (sChildValue.charAt(sChildValue.length-1) == '*')
{
sChildValue =
sChildValue.substring(0,sChildValue.length-1);
}
oPrasedPS.SetProperty(oPrasedPS.GetProperty("Identifier"),
sChildValue);
}
//For Update
if (ChildPS.PropertyExists("Field Name"))
{
oPrasedPS.SetProperty(pChild.GetProperty("Field Name"),
ChildPS.GetProperty("Field Value"));
}
if (ChildPS.GetChildCount() > 0)
{
//Make recursive call to get to all childs of child propertyset.
ParseInputs (ChildPS, oPrasedPS);
}
}
}
catch(e)
{
TheApplication().RaiseErrorText("The Error is : " + e.toString());
}
finally
{
ChildPS = null;
iChildCount = null;
sChildValue = null;
iCount = null;
HAF VBC }
Service ParseInputs }

function ParseOutput (Inputs, Outputs)


{
//Parse return - Look for errormessage property
LogPropSet(Outputs, "ParseOutputOutputs.xml");
HAF VBC return(CancelOperation);
Service ParseOutput }
var oSearchSpecPS = TheApplication().NewPropertySet();
if (TheApplication().GetProfileAttr("Insert") == 'Y')
{
oSearchSpecPS = TempPS.GetChild(0);
}
else
{
ParseInputs(TempPS, oSearchSpecPS);
LogPropSet(oSearchSpecPS, "oSearchSpecPS.xml");
}
var oHeaderPS = TheApplication().NewPropertySet();
var oListOfPS = TheApplication().NewPropertySet();
//Remove Identifier property as it is not part of IO or VBC.
oSearchSpecPS.RemoveProperty("Identifier");
//Prepare input for data mapping
oHeaderPS.SetType("SiebelMessage");
oHeaderPS.SetProperty("MessageId","");
oHeaderPS.SetProperty("MessageType","Integration Object");
oHeaderPS.SetProperty("IntObjectFormat","Siebel Hierarchical");
oHeaderPS.SetProperty("IntObjectName",sIntCompName);
oListOfPS.SetType("ListOf"+sIntCompName);
oSearchSpecPS.SetType(sIntCompName);
oListOfPS.AddChild(oSearchSpecPS);
oHeaderPS.AddChild(oListOfPS);
oSiebelPS.AddChild(oHeaderPS);
}
catch(e)
{
TheApplication().RaiseErrorText("The Error is : " + e.toString());
}
finally
{
TempPS = null;
oSearchSpecPS = null;
oListOfPS = null;
oHeaderPS = null;
HAF VBC }
Service PrepareIOStructure }

function PrepareWSInput (Inputs, Outputs)


{
//Function: Structure the Propertyset into IO hierarchy. Map the propertyset to
External IO and Change type of the DataMap service output to External IO type. This
method will be invoked from Workflow.
try
{
// var siebelPS = TheApplication().NewPropertySet();
//Get the Type of the external IO from the propertyset. This will be passed as input
argument in Workflow
// var sType = Inputs.GetProperty("TypeString");
//Call the routine to Structure the propertyset into Siebel IO.
PrepareIOStructure(Inputs, Outputs);
LogPropSet(Outputs, "Outputs.xml");
}
catch(e)
{
}
finally
{
// siebelPS = null;
LogPropSet(Outputs, "PrepareWSInputOutput.xml");
return(CancelOperation);
HAF VBC }
Service PrepareWSInput }
var ProcessOutputPS = wfOutputPS.GetChild(i).GetChild(0).GetChild(0);
break;
}
}
LogPropSet(ProcessOutputPS, "ProcessOutputPS.xml");
for (var i=0; i < ProcessOutputPS.GetChildCount();i++)
{
Outputs.AddChild(ProcessOutputPS.GetChild(i));
}

}
// for Payment adjustment
var fileinputPS = Outputs.Copy();
fileinputPS.SetProperty("MethodName","Query");
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{ fileinputPS.SetProperty("bsBusComp", sIntCompName);
// Payment
{ adjustment will be done from Line Item VBC only hence this the file should
be created for Line item
if (MethodName ==V"Init")
BC only
{if (Inputs.GetProperty("Business Component Name") == 'HAF Invoice Lineitem
VBC') LogPropSet(Inputs, "InitInput.xml");
CreateProp(fileinputPS);
return (Init(Inputs, Outputs));
}}
catch(e)
else if (MethodName == "Query")
{{
TheApplication().RaiseErrorText("The
LogPropSet(Inputs, "QueryInput.xml");Error is : " + e.toString());
} return (Query(Inputs, Outputs));
finally
}
{else if (MethodName == "PrepareWSInput")
{ queryPS = null;
parsedPS = null;
LogPropSet(Inputs, "PrepareWSInputInputs.xml");
SerachspecPS = null;
return (PrepareWSInput (Inputs, Outputs));
} fileinputPS = null;
wfInputPS = null;
else if (MethodName == "ParseOutput")
{ wfOutputPS = null;
ProcessOutputPS
LogPropSet(Inputs, = null;
"ParseOutputInputs.xml");
LogPropSet(Outputs, "QueryOutput.xml");
return (ParseOutput (Inputs, Outputs));
} return (CancelOperation);
HAF VBC }else if (MethodName == "ChangeType")
Service Query } {
LogPropSet(Inputs, "ChangeTypeInputs.xml");
return (ChangeType (Inputs, Outputs));
}
else if (MethodName == "Update")
{
LogPropSet(Inputs, "UpdateInputs.xml");
return (Update (Inputs, Outputs));
}
else if (MethodName == "PreInsert")
{
return (CancelOperation);
}
else if (MethodName == "Insert")
{
LogPropSet(Inputs, "InsertInputs.xml");
return (Insert (Inputs, Outputs));
}
else if (MethodName == "Delete")
{
LogPropSet(Inputs, "DeleteInputs.xml");
return (Delete (Inputs, Outputs));
}
else
{
return (ContinueOperation);
}
}
HAF VBC Service_PreInvokeM
Service ethod }
Name"), Inputs.GetChild(i).GetProperty("Field Value"));
}
var fileinputPS = tempPS.Copy();
fileinputPS.SetProperty("MethodName","Update");
fileinputPS.SetProperty("bsBusComp",Inputs.GetProperty("Business
Component Name"));
if (Inputs.GetProperty("Business Component Name") == 'HAF Invoice
Lineitem VBC')
{
CreateProp(fileinputPS);
}
Else
{
//Call workflow process
var wfInputPS = TheApplication().NewPropertySet();
var sworkflowName =
TheApplication.GetProfileAttribute("WorkflowName");
var wfOutputPS = TheApplication().NewPropertySet();
var queryPS = TheApplication.NewPropertySet();
//ProcessInput is the name of the process property in Workflow
queryPS.SetType("ProcessInputs");
queryPS.AddChild(Inputs);
wfInputPS.AddChild(queryPS);
wfInputPS.SetProperty(“ProcessName”, sworkflowName);
var wfBS = TheApplication().GetService("Workflow Process
Manager");
wfBS.InvokeMethod("RunProcess", wfInputs, wfOutputPS);
}
}
Catch (e)
{
//Show error.
}
Finally
{
//Destroy objects
HAF VBC }
Service Update }

function LogPropSet(Inputs, FileName)


{
/***************************************************************************
Function : Write the propertysets to files. The files will be used for
and troubleshooting.

----------------------------------------------------------------------------
Change Date Changed By Change Tag Description
----------------------------------------------------------------------------

***************************************************************************/
// Write Propsets to File
var fileSvc = TheApplication().GetService("EAI XML Write to File");
var outps = TheApplication().NewPropertySet();
var fileloc = "C:\\temp\\"+ FileName;
var tmpProp = Inputs.Copy();
tmpProp.SetProperty("FileName",fileloc);
fileSvc.InvokeMethod("WritePropSet", tmpProp, outps);
outps = null;
tmpProp = null;
fileSvc = null;
Humm Test LogPropSet }
var IPproper7 = Inputs.GetProperty("Main Phone Number");
//TheApplication().Trace("in Main Phone No" + IPproper7);
//TheApplication().Trace("in First Name" + IPproper3);
//TheApplication().Trace("in Last name" + IPproper4);
//TheApplication().Trace("Street Ad" + IPproper5);
//TheApplication().Trace("Post code" + IPproper6);
//var var2 = "[Account.Name]LIKE \"\*"+IPproper1+"\*\"";
var var3 = "[Account.CUT First Name]LIKE \"\*"+IPproper3+"\*\"";
var var4 = "[Account.CUT Last Name]LIKE \"\*"+IPproper4+"\*\"";
var var6 = "[Account.Primary Account Street Address]LIKE \"\*"+IPproper5+"\*\"";
var var7 = "[Account.Primary Account Postal Code]LIKE \"\*"+IPproper6+"\*\"OR
[Account.Primary Account Postal Code]IS NULL";
var var8 = "[Account.Main Phone Number]LIKE \"\*"+IPproper7+"\*\"
OR[Account.Main Phone Number]IS NULL";
var var5 = ""+var3+"AND"+var4+"AND"+var6+"AND ("+var7+")AND("+var8+")";
//comments '[Account.Name] = "*Chandan"'
//TheApplication().Trace("in var2" +var5);
//TheApplication().Trace("in var3" +var3);
//TheApplication().Trace("in var4" +var4);
//TheApplication().Trace("Full string" + var5);
var oBS = TheApplication().GetService("EAI Siebel Adapter");
var inpPS = TheApplication().NewPropertySet();
var outPS = TheApplication().NewPropertySet();
var SiebelMsg = TheApplication().NewPropertySet();
inpPS.SetProperty("OutputIntObjectName", "Internal Account
Interface Horizontal");
inpPS.SetProperty("SearchSpec", var5);
oBS.InvokeMethod("Query", inpPS, outPS);
//SiebelMsg = outPS.GetProperty("SiebelMessage");
LogPropSet(outPS, "OutPS.xml");

Outputs.AddChild(outPS.GetChild(0));
//var var2 = Inputs.GetProperty("Processproperty2");
//var var3 = Inputs.GetProperty("Processproperty3");

}
Service_PreInvokeM return (CancelOperation);
Humm Test ethod }

function LogPropSet(Inputs, FileName)


{
/***************************************************************************
Function : Write the propertysets to files. The files will be used for
and troubleshooting.

----------------------------------------------------------------------------
Change Date Changed By Change Tag Description
----------------------------------------------------------------------------

***************************************************************************/
// Write Propsets to File
var fileSvc = TheApplication().GetService("EAI XML Write to File");
var outps = TheApplication().NewPropertySet();
var fileloc = "C:\\temp\\"+ FileName;
var tmpProp = Inputs.Copy();
Hummingbir tmpProp.SetProperty("FileName",fileloc);
fileSvc.InvokeMethod("WritePropSet", tmpProp, outps);
d Search outps = null;
Exp Serv tmpProp = null;
Exposed as fileSvc = null;
WSDL LogPropSet }
var IPproper3 = Inputs.GetProperty("Processproperty3");
var IPproper4 = Inputs.GetProperty("Processproperty4");
var IPproper5 = Inputs.GetProperty("Processproperty5");
var IPproper6 = Inputs.GetProperty("Processproperty6");
var IPproper7 = Inputs.GetProperty("Processproperty7");
//TheApplication().Trace("in Processproperty1" + IPproper1);
//TheApplication().Trace("in Processproperty2" + IPproper3);
//TheApplication().Trace("in Processproperty3" + IPproper4);
//var var2 = "[Account.Name]LIKE \"\*"+IPproper1+"\*\"";
var var3 = "[Account.CUT First Name]LIKE \"\*"+IPproper3+"\*\"";
var var4 = "[Account.CUT Last Name]LIKE \"\*"+IPproper4+"\*\"";
var var6 = "[Business Address.Street Address]LIKE \"\*"+IPproper5+"\*\"";
var var7 = "[Business Address.Postal Code]LIKE \"\*"+IPproper6+"\*\"";
var var8 = "[Account.Main Phone Number]LIKE \"\*"+IPproper7+"\*\"";
var var5 = ""+var3+"AND"+var4+"";
//comments '[Account.Name] = "*Chandan"'
//TheApplication().Trace("in var2" +var2);
//TheApplication().Trace("in var3" +var3);
//TheApplication().Trace("in var4" +var4);
//TheApplication().Trace("Full string" + var5);
var oBS = TheApplication().GetService("EAI Siebel Adapter");
var inpPS = TheApplication().NewPropertySet();
var outPS = TheApplication().NewPropertySet();
var SiebelMsg = TheApplication().NewPropertySet();
inpPS.SetProperty("OutputIntObjectName", "Internal Account
Interface Horizontal");
inpPS.SetProperty("SearchSpec", var5);
oBS.InvokeMethod("Query", inpPS, outPS);
//SiebelMsg = outPS.GetProperty("SiebelMessage");
LogPropSet(outPS, "OutPS.xml");
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
Outputs.SetProperty("Siebel Message", outPS.GetProperty("SiebelMessage"));
//var var2 = Inputs.GetProperty("Processproperty2");
Hummingbir
if //var var3
(MethodName ==="CreateSearchExp")
Inputs.GetProperty("Processproperty3");
d Search
Exp Serv {
} //TheApplication().TraceOn("c:\\tracehumming.txt","SQL","");
Exposed as Service_PreInvokeM return (CancelOperation);
WSDL ethod } //TheApplication().Trace("in method 1" + vOrderId);
// This will be passed into the Process by the Workflow Action
//var IPproper1 = Inputs.GetProperty("Processproperty1");
var IPproper3 = Inputs.GetProperty("Processproperty3");
var IPproper4 = Inputs.GetProperty("Processproperty4");
var IPproper5 = Inputs.GetProperty("Processproperty5");
var IPproper6 = Inputs.GetProperty("Processproperty6");
var IPproper7 = Inputs.GetProperty("Processproperty7");
//TheApplication().Trace("in Processproperty1" + IPproper1);
//TheApplication().Trace("in Processproperty2" + IPproper3);
//TheApplication().Trace("in Processproperty3" + IPproper4);
//var var2 = "[Account.Name]LIKE \"\*"+IPproper1+"\*\"";
var var3 = "[Account.CUT First Name]LIKE \"\*"+IPproper3+"\*\"";
var var4 = "[Account.CUT Last Name]LIKE \"\*"+IPproper4+"\*\"";
var var6 = "[Business Address.Street Address]LIKE \"\*"+IPproper5+"\*\"";
var var7 = "[Business Address.Postal Code]LIKE \"\*"+IPproper6+"\*\"";
var var8 = "[Account.Main Phone Number]LIKE \"\*"+IPproper7+"\*\"";
var var5 = ""+var3+"AND"+var4+"AND"+var6+"AND"+var7+"AND"+var8+""
//comments '[Account.Name] = "*Chandan"'
//TheApplication().Trace("in var2" +var2);
//TheApplication().Trace("in var3" +var3);
//TheApplication().Trace("in var4" +var4);
//TheApplication().Trace("Full string" + var5);
Outputs.SetProperty("Processproperty2", var5);
//var var2 = Inputs.GetProperty("Processproperty2");
//var var3 = Inputs.GetProperty("Processproperty3");
Hummingbir }
d Search Service_PreInvokeM return (CancelOperation);
Exp Service ethod }
http://www.xvideos.com/video460157/india_web_tease

Вам также может понравиться