Parent Applet Name Script: Account List Applet - Child Webapplet - PR Einvokemetho D
Parent Applet Name Script: Account List Applet - Child Webapplet - PR Einvokemetho D
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.
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 }
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 }
if (MethodName == 'NewRecord')
{
TheApplication().SetProfileAttr("WorkflowName", "HAF UAN Tip-Compensation Insert WF");
}
HAF IXMAL Tip WebApplet_Pr
Compensation List eCanInvokeMe return (ContinueOperation);
Applet thod }
}
catch(e)
{
throw(e);
}
finally
{
bsBusSer = null;
bcCurBC = null;
sErrMsg = null;
}
HAF Subscription WebApplet_Pr }
Account List eInvokeMetho return (ContinueOperation);
Applet d }
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 }
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 }
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_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");
}
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.
*************************************************** */
if (FieldName == "Name")
{
AccountUpd = "Y";
}
BusComp_PreS return (ContinueOperation);
Account etFieldValue }
try
{
var BO = TheApplication().GetBusObject("Account");
var BC = BO.GetBusComp("Account");
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
try
{
{
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");
}
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 +
"'";
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.
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 ()
{
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";
{
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.
with (oBCPick)
ClearToQuery();
ExecuteQuery(ForwardOnly);
if(FirstRecord())
Pick();
oBCPick = null;
}
catch(e)
{
throw(e);
}
finally
{
bSalesRepUpd = null;
val = null;
}
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 }
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");
switch (psMessage){
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;
if(InMessage != ""){
TheApplication().RaiseErrorText(InMessage);
}
HAF
Exception return(ContinueOperation);
Handler XMsgDisplay }
}
catch(e)
{
TheApplication().RaiseErrorText();
HAF }
Generic Service_PreInvokeM return (ContinueOperation);
Lookup BS ethod }
Outputs.SetProperty("MDBLetterType", sLetterType);
Outputs.SetProperty("MDBLetterType", sLetterType);
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 }
SetFieldValue("Action Code","Add");
//SetFieldValue("Part Number",sPartNo);
if (bBillable ==
'N')
{
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
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 }
}
}
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;
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 }
}
// 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 }
----------------------------------------------------------------------------
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 }
----------------------------------------------------------------------------
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