Monday, October 1, 2007

Siebel Login password unencrypted



If you want to get the password you just need to query the VALUE column of the parameter table and you will find the password in next row where SADMIN or SIEBEL user name is stored.

select VALUE from SIEBEL.S_SRM_REQ_PARAM

Friday, March 23, 2007

Symphony Server

Thursday, March 22, 2007

Quick analyse Siebel Log files

 

 

https://web.archive.org/web/20170327081851/http://jsfiddle.net/Yajneshp/3owvw7qv/embedded/result/

Symphony Browser

 

 

 

ABO Offer Config Template Parameter VBC BS SCM
Init
function Init(Inputs, Outputs) { /***************************************************************** * Function: Init() in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : Initialization of VBC "ABO Offer Config Template Parameter VBC SCM" fields. * Date : 2016-07-18 *-------------------------------------------------------------------------------------------------* ** *****************************************************************/ var oAPP:Application; try{ oAPP = TheApplication(); Outputs.SetProperty("Description",""); Outputs.SetProperty("Name", ""); Outputs.SetProperty("Id", ""); } catch(e){ if(oAPP.isTraceON) oAPP.Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ oAPP = null; } }

ABO Offer Config Template Parameter VBC BS SCM
Query
function Query(Inputs, Outputs) { /***************************************************************** * Function: Query() in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : Fetches "Bulk Template Id" from instance of Active Bus Comp "ABO Offer Catalog SCM" * Date : 2016-07-18 *-------------------------------------------------------------------------------------------------* ** Update : 2016.07.25 TAAEDSU1 :- Added code for Applet level search. *****************************************************************/ //Variable Declarations var oAttrBO:BusObject; var oAttrValBC:BusComp; var sBulkTemplateId:chars; var oAPP:Application; var sSearch:chars; try { oAPP = TheApplication(); sSearch = Inputs.GetProperty("search-string"); oAttrBO = oAPP.ActiveBusObject(); if(oAttrBO.Name() == "ABO Bulk Request") { oAttrValBC = oAttrBO.GetBusComp("ABO Offer Catalog SCM"); sBulkTemplateId = oAttrValBC.GetFieldValue("Bulk Template Id SCM"); fnAddTempParam( sBulkTemplateId , Outputs ,sSearch); } /*Query Order Template Parameter BC */ } catch(e){ if(oAPP.isTraceON) oAPP.Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ oAttrValBC = null; oAttrBO = null; oAPP = null; } }

ABO Offer Config Template Parameter VBC BS SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /***************************************************************** * Function: Service_PreInvokeMethod in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : BS for VBC "ABO Offer Config Template Parameter VBC SCM". It will load Offer Configuration Pick Applet. * Date : 2016-07-18 *-------------------------------------------------------------------------------------------------* ** *****************************************************************/ switch (MethodName) { case "Init": Init(Inputs, Outputs); break; case "Query": Query(Inputs, Outputs); break; default: break; } return (CancelOperation); }

ABO Offer Config Template Parameter VBC BS SCM
fnAddTempParam
function fnAddTempParam(sBulkTemplateId , Outputs , sSearch ) { /***************************************************************** * Function: Query() in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : Query BC "ABO Order Template Parameter SCM" for input Template id for non default values Prepare Outputs PS. * Date : 2016-07-18 *-------------------------------------------------------------------------------------------------* ** 2016.08.05 SBL51621 :- Added values for 2 fields in PS. ** 2016.11.17 Defect #16411:2016.11.17 :- TAAEDSU1 *****************************************************************/ // Variable Declaration var oAttrBO:BusObject; var oAttrValBC:BusComp; var psRow:PropertySet; var bRecExist:bool; var oAPP:Application; var sexpr1:chars; try { oAPP = TheApplication(); psRow = oAPP.NewPropertySet(); oAttrBO = oAPP.GetBusObject("ABO Bulk Request"); oAttrValBC = oAttrBO.GetBusComp("ABO Order Template Parameter SCM"); if(sBulkTemplateId != "" || sBulkTemplateId != null ) { oAttrValBC.SetViewMode(AllView); oAttrValBC.ActivateField("Name"); oAttrValBC.ActivateField("Description"); oAttrValBC.ClearToQuery(); sexpr1 = "[Template Id] = '" + sBulkTemplateId + "' AND [Default] <> 'Y'" if(sSearch == "" || sSearch == null) { oAttrValBC.SetSearchExpr(sexpr1); } else { oAttrValBC.SetSearchExpr(sexpr1 + " AND " + sSearch); } oAttrValBC.ExecuteQuery(ForwardOnly); bRecExist = oAttrValBC.FirstRecord(); while(bRecExist) { psRow.SetProperty("Description" , oAttrValBC.GetFieldValue("Description")); psRow.SetProperty("Name" , oAttrValBC.GetFieldValue("Name")); psRow.SetProperty("Id" , oAttrValBC.GetFieldValue("Id")); Outputs.AddChild(psRow.Copy()); psRow.Reset(); bRecExist = oAttrValBC.NextRecord(); } } } catch(e) { if(oAPP.isTraceON) oAPP.Trace(this.Name() + " Error: " + e.message); throw(e); } finally { psRow = null; oAttrValBC = null; oAttrBO = null; oAPP = null; } }

ABO Selection Parameters VBC BS SCM
(declarations)
//Your public declarations go here...

ABO Selection Parameters VBC BS SCM
Init
function Init(Inputs, Outputs) { /***************************************************************** * Function: Init() in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : Initialization of VBC "ABO Offer Config Template Parameter VBC SCM" fields. * Date : 2016-07-18 *-------------------------------------------------------------------------------------------------* ** *****************************************************************/ var oAPP:Application; try{ oAPP = TheApplication(); Outputs.SetProperty("Parameter Name",""); } catch(e){ if(oAPP.isTraceON) oAPP.Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ oAPP = null; } }

ABO Selection Parameters VBC BS SCM
Query
function Query(Inputs, Outputs) { /***************************************************************** * Function: Query() in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : Fetches "Bulk Template Id" from instance of Active Bus Comp "ABO Offer Catalog SCM" * Date : 2016-07-18 *-------------------------------------------------------------------------------------------------* ** Update TAAEDSU1 2016.08.17: Removed GetFieldValues of Template Id and Parameter Name. *****************************************************************/ //Variable Declarations var oAttrBO:BusObject; var oAttrValBC:BusComp; var oAPP:Application; var sSearch:chars; var sSelection:chars; try { oAPP = TheApplication(); sSearch = QueryCheck(Inputs); oAttrBO = oAPP.ActiveBusObject(); if(oAttrBO.Name() == "ABO Bulk Request") { oAttrValBC = oAttrBO.GetBusComp("ABO Offer Configuration SCM"); sSelection = oAttrValBC.GetFieldValue("Selection SCM"); fngetSelectionParam( sSearch ,sSelection, Outputs); } } catch(e){ if(oAPP.isTraceON) oAPP.Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ oAttrValBC = null; oAttrBO = null; oAPP = null; } }

ABO Selection Parameters VBC BS SCM
QueryCheck
function QueryCheck(oInputs) { /***************************************************************** * Function: QueryCheck() in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : Finds out search-string executed from Applet. * Date : 2016-07-18 *-------------------------------------------------------------------------------------------------* ** *****************************************************************/ var sSearch = ""; if (oInputs.PropertyExists("search-string")) { sSearch = oInputs.GetProperty("search-string"); sSearch = sSearch.substring(sSearch.indexOf('"')+1); var iPos = sSearch.indexOf("*"); if (iPos == 0) { sSearch = sSearch.substring(1); } sSearch = sSearch.substring(0, sSearch.indexOf("*")); } return (sSearch); }

ABO Selection Parameters VBC BS SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /***************************************************************** * Function: Service_PreInvokeMethod in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : BS for VBC "ABO Selections Parameters VBC SCM". It will load Offer Configuration Pick Applet. * Date : 2016-07-20 *-------------------------------------------------------------------------------------------------* ** *****************************************************************/ switch (MethodName) { case "Init": Init(Inputs, Outputs); break; case "Query": Query(Inputs, Outputs); break; default: break; } return (CancelOperation); }

ABO Selection Parameters VBC BS SCM
fngetSelectionParam
function fngetSelectionParam(sSearch, sSelection , Outputs) { /***************************************************************** * Function: Query() in BusService "ABO Offer Config Template Parameter VBC BS SCM" * Author : Sushant Edlabadkar (TAAEDSU1) * Purpose : Query BC "ABO Order Template Parameter SCM" for input Template id and Parameter Name. Prepare Outputs PS. * Date : 2016-07-18 *-------------------------------------------------------------------------------------------------* ** Update TAAEDSU1 2016.08.17: Removed BC Query as its not required now. *****************************************************************/ // Variable Declaration var psRow:PropertySet; var bRecExist:bool; var oAPP:Application; var sParamArr:Array; var sSelectParam:chars; try { oAPP = TheApplication(); psRow = oAPP.NewPropertySet(); sParamArr = new Array; sParamArr = sSelection.split(";"); if(sSearch == "" || sSearch == null) { for (var i = 0; i < sParamArr.length; i++) { sSelectParam = sParamArr[i] psRow.SetProperty("Parameter Name" , sSelectParam); Outputs.AddChild(psRow.Copy()); psRow.Reset(); } } else { for (var i = 0; i < sParamArr.length; i++) { sSelectParam = sParamArr[i] if( sSelectParam.indexOf(sSearch) >= 0) { psRow.SetProperty("Parameter Name" , sSelectParam); Outputs.AddChild(psRow.Copy()); psRow.Reset(); } } } } catch(e) { if(oAPP.isTraceON) oAPP.Trace(this.Name() + " Error: " + e.message); throw(e); } finally { psRow = null; oAPP = null; sParamArr = null; } }

ADRIA Validations BS SCM
(declarations)
var oApp:Application; var bIsTraceOn:bool;

ADRIA Validations BS SCM
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

ADRIA Validations BS SCM
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

ADRIA Validations BS SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs){ /***************************************************************************** ** Name: Preinvoke ** Description: This BS has all script necessary SO 3121 - Validations to know ** when to invoke Adria or not *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ---------------------------------------------------- * 2016-07-22 TGDCOMAB created * *****************************************************************************/ try{ oApp = TheApplication(); // enable tracing bIsTraceOn = oApp.isTraceON; // enable tracing if (bIsTraceOn) oApp.Trace(this.Name() + " START --> "+ MethodName); switch (MethodName){ case "ValidateSCM": ValidateSCM(Inputs,Outputs); break; default: break; }//End Case }//End try catch(e){ //Trace and rise error if(bIsTraceOn) TheApplication().Trace(this.Name() + ".Service_PreInvokeMethod Error : " + e.message); throw(e); } finally{ oApp = null; } return (CancelOperation); }

ADRIA Validations BS SCM
ValidateSCM
/******************************************************* ** Name: ValidateSCM ** Created: 22.07.2016 ** Created By: TGDCOMAB, Mario Costa ** Description: This function is called from applet Browser scripts. ** It validates if the ADRIA application should be called or not. ** The following validations are checked: ** - If Segment = CBU -> stay in Symphony ** - If Segment = SME -> check if the agent has the correct responsibility ** - If so, check if there are only contracts which correspond to useCases ** where Symphony is the only master of the Address information ** - If so, jump to Adria ** - If Segment = RES -> check if there are only contracts which correspond to useCases ** where Symphony is the only master of the Address information ** - If so, jump to Adria -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function ValidateSCM(Inputs, Outputs) { try { Outputs.SetProperty("InvokeAdria", "Error"); //Get the Account Segment using the input sent from the applet var strAccountId = Inputs.GetProperty("AccountId"); var strSubType = Inputs.GetProperty("SubType"); //Sub Type SCM var strCMAId = Inputs.GetProperty("CMAId"); //Calculated CMA Account Id SCM var oBOAsset; var oBCAsset // If it is an SA, get the CMA to search for the segment if (strSubType == TheApplication().InvokeMethod("LookupValue","ACCOUNT_SUB_TYPE_SCM","SA")) strAccountId = strCMAId; var oBOAccount = TheApplication().GetBusObject("Account"); var oBCAccount = oBOAccount.GetBusComp("Account"); oBCAccount.ClearToQuery(); oBCAccount.SetViewMode(AllView); oBCAccount.ActivateField("Grobsegment SCM"); oBCAccount.ActivateField("Account Status GUI SCM"); oBCAccount.SetSearchSpec("Id", strAccountId); oBCAccount.ExecuteQuery(ForwardOnly); if (oBCAccount.FirstRecord()) { var strSegment = oBCAccount.GetFieldValue("Grobsegment SCM"); var strStatus = oBCAccount.GetFieldValue("Account Status GUI SCM"); // If the customer is in status Prospect or New, always stay in Symphony if (strStatus == TheApplication().InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect") || strStatus == TheApplication().InvokeMethod("LookupValue","ACCOUNT_STATUS","New")) { Outputs.SetProperty("InvokeAdria", "N"); return; } var oBS = TheApplication().GetService("FE Call External Programs Support SCM"); var oInputsAux = TheApplication().NewPropertySet(); var oOutputsAux = TheApplication().NewPropertySet(); oInputsAux.SetProperty("Responsibility", "SCM Allow Symphony Addres Mgmt"); oInputsAux.SetProperty("EmployeeId", TheApplication().LoginId()); var LoginId = TheApplication().LoginId(); oBS.InvokeMethod("validateUserResponsibility", oInputsAux, oOutputsAux); if (oOutputsAux.GetProperty("Exists") == "true") // user has the correct responsibility - stay in Symphony { Outputs.SetProperty("InvokeAdria", "N"); return; } // If it is CBU - continue in Symphony if (strSegment == TheApplication().InvokeMethod("LookupValue","CUSTOMER_SEGMENT_SCM","CBU")) { Outputs.SetProperty("InvokeAdria", "N"); return; } else if (strSegment == TheApplication().InvokeMethod("LookupValue","CUSTOMER_SEGMENT_SCM","SME")) { var strACVAdria4SME = TheApplication().utils.SCM_RetrieveACV("ADRIA_FOR_SME"); if (strACVAdria4SME == "N") // if it is SME and Adria for SME ACV is set to "N" continue in Symphony { Outputs.SetProperty("InvokeAdria", "N"); return; } else { // if the customer has NO contracts - jump to Adria oBOAsset = TheApplication().GetBusObject("Asset Mgmt - Asset (Order Mgmt) Lite2 BC SCM"); oBCAsset = oBOAsset.GetBusComp("Asset Mgmt - Asset (Order Mgmt) Lite2

AEC Auto Fix Tools SCM
(declarations)
//Your public declarations go here... var oApp:Application;

AEC Auto Fix Tools SCM
(declarations)
//Your public declarations go here... var oApp:Application;

AEC Auto Fix Tools SCM
AECAddComponentToActualInstance
function AECAddComponentToActualInstance (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is adding component products to the actual Complex Product instance // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release //************************************************************************** // Variable Declaration var s2; var psInp1; var psInp2; var psListOfPorts; var psFlatPortList; var psListOfPortItems; var lnPortItems:Number; var lnPortItemsMax:Number; var lnDeltaProductQty:Number; var lnChecksum:Number; try { s2 = oApp.GetService("Remote Complex Object Instance Service"); psInp1 = oApp.NewPropertySet(); psInp2 = oApp.NewPropertySet(); psListOfPorts = oApp.NewPropertySet(); psFlatPortList = oApp.NewPropertySet(); psListOfPortItems = oApp.NewPropertySet(); // Get Input Values lnDeltaProductQty = Inputs.GetProperty("DeltaProductQty"); // Get All Ports psInp1.SetProperty("GetPortDomain","Y"); psInp1.SetProperty("Product Id", Inputs.GetProperty("CxProdId")); s2.InvokeMethod("GetAllPorts",psInp1,psListOfPorts); // Prepare Flat Port List AECPrepareFlatPortList(psListOfPorts,psFlatPortList); // Get Port Id for Delta Product psInp2.AddChild(psFlatPortList); psInp2.SetProperty("lsDeltaProductId",Inputs.GetProperty("DeltaProductId")); AECGetPortId(psInp2,Outputs); lnPortItemsMax = Outputs.GetProperty("PortMaxQty"); // Get Selected Items psInp1.SetProperty("ObjId",Inputs.GetProperty("ObjectId")); psInp1.SetProperty("Parent Path",Inputs.GetProperty("ParentPath")); psInp1.SetProperty("Port Item Id",Outputs.GetProperty("lsPortId")); psInp1.SetProperty("IntObjName", Inputs.GetProperty("IntObjName")); psInp1.SetProperty("RootId",Inputs.GetProperty("RootId")); s2.InvokeMethod("EnumObjects",psInp1,psListOfPortItems); // Count port Items AECCountPortItems(psListOfPortItems,Outputs); lnPortItems = Outputs.GetProperty("PortItems"); lnChecksum = lnPortItemsMax - lnPortItems - lnDeltaProductQty; // Set Properties if action is possible if (lnChecksum >= -1) { // Setup Property Set for Add Item/Replace Item psInp1.SetProperty("Name",Outputs.GetProperty("lsProdName")); psInp1.SetProperty("Integration Id",Inputs.GetProperty("IntegrationId")); psInp1.SetProperty("Prod Item Id",Outputs.GetProperty("lsProdItemId")); psInp1.SetProperty("Product Id",Inputs.GetProperty("DeltaProductId")); psInp1.SetProperty("Quantity","1"); psInp1.SetProperty("SetTypeQty","Y"); psInp1.SetProperty("AutoFix","Y"); } // Add Item if possible if (lnChecksum >= 0) { s2.InvokeMethod("AddItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } // Replace Item if necessary else if (lnChecksum == -1 && lnPortItemsMax == 1) { psInp1.SetProperty("Path",psListOfPortItems.GetChild(0).GetProperty("Path")); s2.InvokeMethod("ReplaceItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } else { Outputs.SetProperty("AEC Operation Success", "N"); } } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects psListOfPortItems = null; psFlatPortList = null; psListOfPorts = null; psInp2 = null; psInp1 = null; s2 = null; } }

AEC Auto Fix Tools SCM
AECAddComponentToActualInstance
function AECAddComponentToActualInstance (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is adding component products to the actual Complex Product instance // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release //************************************************************************** // Variable Declaration var s2; var psInp1; var psInp2; var psListOfPorts; var psFlatPortList; var psListOfPortItems; var lnPortItems:Number; var lnPortItemsMax:Number; var lnDeltaProductQty:Number; var lnChecksum:Number; try { s2 = oApp.GetService("Remote Complex Object Instance Service"); psInp1 = oApp.NewPropertySet(); psInp2 = oApp.NewPropertySet(); psListOfPorts = oApp.NewPropertySet(); psFlatPortList = oApp.NewPropertySet(); psListOfPortItems = oApp.NewPropertySet(); // Get Input Values lnDeltaProductQty = Inputs.GetProperty("DeltaProductQty"); // Get All Ports psInp1.SetProperty("GetPortDomain","Y"); psInp1.SetProperty("Product Id", Inputs.GetProperty("CxProdId")); s2.InvokeMethod("GetAllPorts",psInp1,psListOfPorts); // Prepare Flat Port List AECPrepareFlatPortList(psListOfPorts,psFlatPortList); // Get Port Id for Delta Product psInp2.AddChild(psFlatPortList); psInp2.SetProperty("lsDeltaProductId",Inputs.GetProperty("DeltaProductId")); AECGetPortId(psInp2,Outputs); lnPortItemsMax = Outputs.GetProperty("PortMaxQty"); // Get Selected Items psInp1.SetProperty("ObjId",Inputs.GetProperty("ObjectId")); psInp1.SetProperty("Parent Path",Inputs.GetProperty("ParentPath")); psInp1.SetProperty("Port Item Id",Outputs.GetProperty("lsPortId")); psInp1.SetProperty("IntObjName", Inputs.GetProperty("IntObjName")); psInp1.SetProperty("RootId",Inputs.GetProperty("RootId")); s2.InvokeMethod("EnumObjects",psInp1,psListOfPortItems); // Count port Items AECCountPortItems(psListOfPortItems,Outputs); lnPortItems = Outputs.GetProperty("PortItems"); lnChecksum = lnPortItemsMax - lnPortItems - lnDeltaProductQty; // Set Properties if action is possible if (lnChecksum >= -1) { // Setup Property Set for Add Item/Replace Item psInp1.SetProperty("Name",Outputs.GetProperty("lsProdName")); psInp1.SetProperty("Integration Id",Inputs.GetProperty("IntegrationId")); psInp1.SetProperty("Prod Item Id",Outputs.GetProperty("lsProdItemId")); psInp1.SetProperty("Product Id",Inputs.GetProperty("DeltaProductId")); psInp1.SetProperty("Quantity","1"); psInp1.SetProperty("SetTypeQty","Y"); psInp1.SetProperty("AutoFix","Y"); } // Add Item if possible if (lnChecksum >= 0) { s2.InvokeMethod("AddItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } // Replace Item if necessary else if (lnChecksum == -1 && lnPortItemsMax == 1) { psInp1.SetProperty("Path",psListOfPortItems.GetChild(0).GetProperty("Path")); s2.InvokeMethod("ReplaceItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } else { Outputs.SetProperty("AEC Operation Success", "N"); } } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects psListOfPortItems = null; psFlatPortList = null; psListOfPorts = null; psInp2 = null; psInp1 = null; s2 = null; } }

AEC Auto Fix Tools SCM
AECAddComponentToInstance
function AECAddComponentToInstance (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is instanciating a new Complex Product instance and adds the specified product // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 24/10/2011 Initial Release //************************************************************************** var s1; var s2; var psInp1; var psInp2; var psLoadedInstance; var psListOfPorts; var psFlatPortList; var psListOfPortItems; var lsObjectId; var lnDeltaProductQty:Number; var lsRootId; var lsPortId; var lnChecksum:Number; var lnPortItems:Number; var lnPortItemsMax:Number; try { s1 = oApp.GetService("ISS Copy Service"); s2 = oApp.GetService("Remote Complex Object Instance Service"); psInp1 = oApp.NewPropertySet(); psInp2 = oApp.NewPropertySet(); psLoadedInstance = oApp.NewPropertySet(); psListOfPorts = oApp.NewPropertySet(); psFlatPortList = oApp.NewPropertySet(); psListOfPortItems = oApp.NewPropertySet(); // Get Input Values lnDeltaProductQty = Inputs.GetProperty("DeltaProductQty"); //benötigt lsObjectId = Inputs.GetProperty("ObjectId"); //benötigt lsRootId = Inputs.GetProperty("RootId"); // benötigt // Load EAI psInp1.SetProperty("ParentObjectId",lsObjectId); psInp1.SetProperty("IntegrationObjectName",Inputs.GetProperty("IntObjName")); psInp1.SetProperty("RootId",lsRootId); psInp1.SetProperty("SearchSpec","[Header.Id]='" + lsObjectId + "' AND [Line Item.Root Id]='" + lsRootId + "'"); s1.InvokeMethod("LoadEAI",psInp1,Outputs); // Load Instance psInp1.SetProperty("ObjId",lsObjectId); psInp1.SetProperty("IntObjName", Inputs.GetProperty("IntObjName")); psInp1.SetProperty("Product Id", Inputs.GetProperty("CxProdId")); psInp1.SetProperty("TriggerEvent","Y"); s2.InvokeMethod("LoadInstance",psInp1,Outputs); // Get Instance s2.InvokeMethod("GetInstance",psInp1,psLoadedInstance); // Get All Ports psInp1.SetProperty("GetPortDomain","Y"); s2.InvokeMethod("GetAllPorts",psInp1,psListOfPorts); // Prepare Flat Port List AECPrepareFlatPortList(psListOfPorts,psFlatPortList); // Get Port Id for Delta Product psInp2.AddChild(psFlatPortList); psInp2.SetProperty("lsDeltaProductId",Inputs.GetProperty("DeltaProductId")); AECGetPortId(psInp2,Outputs); lnPortItemsMax = Outputs.GetProperty("PortMaxQty"); // Get Selected Items psInp1.SetProperty("Parent Path",Inputs.GetProperty("IntegrationId")); psInp1.SetProperty("Port Item Id",Outputs.GetProperty("lsPortId")); s2.InvokeMethod("EnumObjects",psInp1,psListOfPortItems); // Count port Items AECCountPortItems(psListOfPortItems,Outputs); lnPortItems = Outputs.GetProperty("PortItems"); lnChecksum = lnPortItemsMax - lnPortItems - lnDeltaProductQty; // Set Properties if action is possible if (lnChecksum >= -1) { // Setup Property Set for Add Item/Replace Item psInp1.SetProperty("Name",Outputs.GetProperty("lsProdName")); psInp1.SetProperty("Integration Id",Inputs.GetProperty("IntegrationId")); psInp1.SetProperty("Prod Item Id",Outputs.GetProperty("lsProdItemId")); psInp1.SetProperty("Product Id",Inputs.GetProperty("DeltaProductId")); psInp1.SetProperty("Quantity","1"); psInp1.SetProperty("SetTypeQty","Y"); } // Add Item if possible if (lnChecksum >= 0) { s2.InvokeMethod("AddItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } // Replace Item if necessary else if (lnChecksum == -1 && lnPortItemsMax == 1) { psInp1.SetProperty("Path",psListOfPortItems.GetChild(0).GetProperty("Path")); s2.InvokeMethod("

AEC Auto Fix Tools SCM
AECAddComponentToInstance
function AECAddComponentToInstance (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is instanciating a new Complex Product instance and adds the specified product // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 24/10/2011 Initial Release //************************************************************************** var s1; var s2; var psInp1; var psInp2; var psLoadedInstance; var psListOfPorts; var psFlatPortList; var psListOfPortItems; var lsObjectId; var lnDeltaProductQty:Number; var lsRootId; var lsPortId; var lnChecksum:Number; var lnPortItems:Number; var lnPortItemsMax:Number; try { s1 = oApp.GetService("ISS Copy Service"); s2 = oApp.GetService("Remote Complex Object Instance Service"); psInp1 = oApp.NewPropertySet(); psInp2 = oApp.NewPropertySet(); psLoadedInstance = oApp.NewPropertySet(); psListOfPorts = oApp.NewPropertySet(); psFlatPortList = oApp.NewPropertySet(); psListOfPortItems = oApp.NewPropertySet(); // Get Input Values lnDeltaProductQty = Inputs.GetProperty("DeltaProductQty"); //benötigt lsObjectId = Inputs.GetProperty("ObjectId"); //benötigt lsRootId = Inputs.GetProperty("RootId"); // benötigt // Load EAI psInp1.SetProperty("ParentObjectId",lsObjectId); psInp1.SetProperty("IntegrationObjectName",Inputs.GetProperty("IntObjName")); psInp1.SetProperty("RootId",lsRootId); psInp1.SetProperty("SearchSpec","[Header.Id]='" + lsObjectId + "' AND [Line Item.Root Id]='" + lsRootId + "'"); s1.InvokeMethod("LoadEAI",psInp1,Outputs); // Load Instance psInp1.SetProperty("ObjId",lsObjectId); psInp1.SetProperty("IntObjName", Inputs.GetProperty("IntObjName")); psInp1.SetProperty("Product Id", Inputs.GetProperty("CxProdId")); psInp1.SetProperty("TriggerEvent","Y"); s2.InvokeMethod("LoadInstance",psInp1,Outputs); // Get Instance s2.InvokeMethod("GetInstance",psInp1,psLoadedInstance); // Get All Ports psInp1.SetProperty("GetPortDomain","Y"); s2.InvokeMethod("GetAllPorts",psInp1,psListOfPorts); // Prepare Flat Port List AECPrepareFlatPortList(psListOfPorts,psFlatPortList); // Get Port Id for Delta Product psInp2.AddChild(psFlatPortList); psInp2.SetProperty("lsDeltaProductId",Inputs.GetProperty("DeltaProductId")); AECGetPortId(psInp2,Outputs); lnPortItemsMax = Outputs.GetProperty("PortMaxQty"); // Get Selected Items psInp1.SetProperty("Parent Path",Inputs.GetProperty("IntegrationId")); psInp1.SetProperty("Port Item Id",Outputs.GetProperty("lsPortId")); s2.InvokeMethod("EnumObjects",psInp1,psListOfPortItems); // Count port Items AECCountPortItems(psListOfPortItems,Outputs); lnPortItems = Outputs.GetProperty("PortItems"); lnChecksum = lnPortItemsMax - lnPortItems - lnDeltaProductQty; // Set Properties if action is possible if (lnChecksum >= -1) { // Setup Property Set for Add Item/Replace Item psInp1.SetProperty("Name",Outputs.GetProperty("lsProdName")); psInp1.SetProperty("Integration Id",Inputs.GetProperty("IntegrationId")); psInp1.SetProperty("Prod Item Id",Outputs.GetProperty("lsProdItemId")); psInp1.SetProperty("Product Id",Inputs.GetProperty("DeltaProductId")); psInp1.SetProperty("Quantity","1"); psInp1.SetProperty("SetTypeQty","Y"); } // Add Item if possible if (lnChecksum >= 0) { s2.InvokeMethod("AddItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } // Replace Item if necessary else if (lnChecksum == -1 && lnPortItemsMax == 1) { psInp1.SetProperty("Path",psListOfPortItems.GetChild(0).GetProperty("Path")); s2.InvokeMethod("

AEC Auto Fix Tools SCM
AECAddItem
function AECAddItem (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 01.11.20011 // Purpose: Used for adding items // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // Thomas Trenkler 01.11.11 Initial Release //************************************************************************** //Initialize var lbcBusObject:BusObject; var lbcBusObject2:BusObject; var lbcMainBusComp:BusComp; var lbcBusComp:BusComp; var lbcPickListBC:BusComp; var lbcPromoBusComp:BusComp; var lsHeaderId; var lsProductId; var lsProductName; var lsPromotionId; var lsPromInstId; var lsPromItemId; var sSearchExpr; var lsBAccId; var lsSAccId; var lsBPId; var lsAECServiceId; var lsId:chars; try { lbcBusObject = oApp.GetBusObject(Inputs.GetProperty ("Object Name")); lbcBusComp = lbcBusObject.GetBusComp (Inputs.GetProperty ("Line Item Component Name")); lbcMainBusComp = lbcBusObject.GetBusComp (Inputs.GetProperty ("Header Component Name")); lsHeaderId = Inputs.GetProperty ("Header Id"); lsProductId = Inputs.GetProperty ("Product Id"); lsProductName = Inputs.GetProperty ("Product Name"); lsPromotionId = Inputs.GetProperty ("Promotion Id"); lsPromInstId = Inputs.GetProperty ("Promotion Instance Id"); lsBAccId = Inputs.GetProperty ("BAccId"); lsSAccId = Inputs.GetProperty ("SAccId"); lsBPId = Inputs.GetProperty ("BPId"); lsAECServiceId = Inputs.GetProperty ("AECServiceId"); with (lbcMainBusComp) { SetViewMode(AllView); ClearToQuery(); SetSearchSpec ("Id", lsHeaderId); ExecuteQuery (ForwardOnly); if (FirstRecord() ) { with (lbcBusComp) { InvokeMethod ("EnableCopyExtAttr"); InvokeMethod ("EnableConfigCxProd"); SetProperty ("Skip Loading Default Cfg Instance", "N"); NewRecord (NewAfter); lbcPickListBC = GetPicklistBusComp("Product");//PickList Internal Orderable Product with (lbcPickListBC) { SetViewMode(AllView); ClearToQuery(); if (lsProductName !="") { SetSearchSpec( "Name", "'" + lsProductName + "'"); } else { SetSearchSpec( "Id", "'" + lsProductId + "'"); } ExecuteQuery(ForwardOnly); if (FirstRecord()) { Pick(); } } // ActivateField("AEC Service Id"); ActivateField("Billing Profile Id"); // SetFieldValue("AEC Service Id", lsAECServiceId); SetFieldValue("Billing Account Id", lsBAccId); SetFieldValue("Service Account Id", lsSAccId); SetFieldValue("Billing Profile Id", lsBPId); // Add Item to Promotion if (lsPromotionId !="-" && lsPromInstId !="-") { /* lbcBusObject2 = oApp.GetBusObject(Inputs.GetProperty ("Object Name")); lbcPromoBusComp = lbcBusObject2.GetBusComp ("ISS Promotion Related Product VBC"); // Get Promotion Item Id for the product to be added with (lbcPromoBusComp) { ActivateField("Prom Comp Rule Id"); sSearchExpr = "[Active Promotion Id]='" + lsPromotionId + "' AND [Product Id]='" + lsProductId + "'"; SetSearchExpr(sSearchExpr); ExecuteQuery (ForwardOnly); lsPromItemId = lbcPromoBusComp.GetFieldValue("Prom Comp Rule Id"); } */ ActivateField("Prod Prom Id"); ActivateField("Prod Prom Instance Id"); ActivateField("Prod Prom Rule Id"); SetFieldValue("Prod Prom Id", lsPromotionId); SetFieldValue("Prod Prom Instance Id", lsPromInstId); // SetFieldValue("Prod Prom Rule Id", lsPromItemId); } WriteRecord(); lsId=GetFieldValue("Id"); ClearToQuery() ExecuteQuery(ForwardBackward); } } } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Obje

AEC Auto Fix Tools SCM
AECAddItem
function AECAddItem (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 01.11.20011 // Purpose: Used for adding items // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // Thomas Trenkler 01.11.11 Initial Release //************************************************************************** //Initialize var lbcBusObject:BusObject; var lbcBusObject2:BusObject; var lbcMainBusComp:BusComp; var lbcBusComp:BusComp; var lbcPickListBC:BusComp; var lbcPromoBusComp:BusComp; var lsHeaderId; var lsProductId; var lsProductName; var lsPromotionId; var lsPromInstId; var lsPromItemId; var sSearchExpr; var lsBAccId; var lsSAccId; var lsBPId; var lsAECServiceId; try { lbcBusObject = oApp.GetBusObject(Inputs.GetProperty ("Object Name")); lbcBusComp = lbcBusObject.GetBusComp (Inputs.GetProperty ("Line Item Component Name")); lbcMainBusComp = lbcBusObject.GetBusComp (Inputs.GetProperty ("Header Component Name")); lsHeaderId = Inputs.GetProperty ("Header Id"); lsProductId = Inputs.GetProperty ("Product Id"); lsProductName = Inputs.GetProperty ("Product Name"); lsPromotionId = Inputs.GetProperty ("Promotion Id"); lsPromInstId = Inputs.GetProperty ("Promotion Instance Id"); lsBAccId = Inputs.GetProperty ("BAccId"); lsSAccId = Inputs.GetProperty ("SAccId"); lsBPId = Inputs.GetProperty ("BPId"); lsAECServiceId = Inputs.GetProperty ("AECServiceId"); with (lbcMainBusComp) { SetViewMode(AllView); ClearToQuery(); SetSearchSpec ("Id", lsHeaderId); ExecuteQuery (ForwardOnly); if (FirstRecord() ) { with (lbcBusComp) { InvokeMethod ("EnableCopyExtAttr"); InvokeMethod ("EnableConfigCxProd"); SetProperty ("Skip Loading Default Cfg Instance", "N"); NewRecord (NewAfter); lbcPickListBC = GetPicklistBusComp("Product");//PickList Internal Orderable Product with (lbcPickListBC) { SetViewMode(AllView); ClearToQuery(); if (lsProductName !="") { SetSearchSpec( "Name", "'" + lsProductName + "'"); } else { SetSearchSpec( "Id", "'" + lsProductId + "'"); } ExecuteQuery(ForwardOnly); if (FirstRecord()) { Pick(); } } // ActivateField("AEC Service Id"); ActivateField("Billing Profile Id"); // SetFieldValue("AEC Service Id", lsAECServiceId); SetFieldValue("Billing Account Id", lsBAccId); SetFieldValue("Service Account Id", lsSAccId); SetFieldValue("Billing Profile Id", lsBPId); // Add Item to Promotion if (lsPromotionId !="-" && lsPromInstId !="-") { /* lbcBusObject2 = oApp.GetBusObject(Inputs.GetProperty ("Object Name")); lbcPromoBusComp = lbcBusObject2.GetBusComp ("ISS Promotion Related Product VBC"); // Get Promotion Item Id for the product to be added with (lbcPromoBusComp) { ActivateField("Prom Comp Rule Id"); sSearchExpr = "[Active Promotion Id]='" + lsPromotionId + "' AND [Product Id]='" + lsProductId + "'"; SetSearchExpr(sSearchExpr); ExecuteQuery (ForwardOnly); lsPromItemId = lbcPromoBusComp.GetFieldValue("Prom Comp Rule Id"); } */ ActivateField("Prod Prom Id"); ActivateField("Prod Prom Instance Id"); ActivateField("Prod Prom Rule Id"); SetFieldValue("Prod Prom Id", lsPromotionId); SetFieldValue("Prod Prom Instance Id", lsPromInstId); // SetFieldValue("Prod Prom Rule Id", lsPromItemId); } WriteRecord(); ClearToQuery() ExecuteQuery(ForwardBackward); } } } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects lbcPickListBC = null; lbcBusComp = nul

AEC Auto Fix Tools SCM
AECAddToList
function AECAddToList (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 01.11.20011 // Purpose: Used for setting up the ProjectedAssetInput for setting up the PAC when inside eCfg Session // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // Thomas Trenkler 01.11.11 Initial Release //************************************************************************** //Initialize var psTempRowSet; try { psTempRowSet = oApp.NewPropertySet(); psTempRowSet.SetType("ProjectedAssetInput"); psTempRowSet.SetProperty("Product Id",""); psTempRowSet.SetProperty("Product XA Class Id",""); psTempRowSet.SetProperty("Product Primary Product Line Id",""); psTempRowSet.SetProperty("Service Account Id",""); psTempRowSet.SetProperty("Billing Account Id",""); psTempRowSet.SetProperty("Billing Profile Id",""); psTempRowSet.SetProperty("Prod Prom Id",""); psTempRowSet.SetProperty("AEC Root Prod Prom Instance Id",""); // psTempRowSet.SetProperty("AEC Service Id",""); psTempRowSet.SetProperty("Root Asset Id",""); psTempRowSet.SetProperty("Root Product Id",""); psTempRowSet.SetProperty("AEC Root Prod Prom Id",""); psTempRowSet.SetProperty("Quote Id",""); psTempRowSet.SetProperty("Order Header Id",""); psTempRowSet.SetProperty("Asset Integration Id",""); psTempRowSet.SetProperty("Root Integration Id",""); // Defect 58292 Outputs.AddChild(psTempRowSet); } catch (e) { oApp.Trace(e.toString()); throw e; } finally { //Release Objects psTempRowSet = null; } }

AEC Auto Fix Tools SCM
AECAddToList
function AECAddToList (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 01.11.20011 // Purpose: Used for setting up the ProjectedAssetInput for setting up the PAC when inside eCfg Session // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // Thomas Trenkler 01.11.11 Initial Release //************************************************************************** //Initialize var psTempRowSet; try { psTempRowSet = oApp.NewPropertySet(); psTempRowSet.SetType("ProjectedAssetInput"); psTempRowSet.SetProperty("Product Id",""); psTempRowSet.SetProperty("Product XA Class Id",""); psTempRowSet.SetProperty("Product Primary Product Line Id",""); psTempRowSet.SetProperty("Service Account Id",""); psTempRowSet.SetProperty("Billing Account Id",""); psTempRowSet.SetProperty("Billing Profile Id",""); psTempRowSet.SetProperty("Prod Prom Id",""); psTempRowSet.SetProperty("AEC Root Prod Prom Instance Id",""); // psTempRowSet.SetProperty("AEC Service Id",""); psTempRowSet.SetProperty("Root Asset Id",""); psTempRowSet.SetProperty("Root Product Id",""); psTempRowSet.SetProperty("AEC Root Prod Prom Id",""); psTempRowSet.SetProperty("Quote Id",""); psTempRowSet.SetProperty("Order Header Id",""); psTempRowSet.SetProperty("Asset Integration Id",""); psTempRowSet.SetProperty("Root Integration Id",""); // Defect 58292 Outputs.AddChild(psTempRowSet); } catch (e) { oApp.Trace(e.toString()); throw e; } finally { //Release Objects psTempRowSet = null; } }

AEC Auto Fix Tools SCM
AECCountPortItems
function AECCountPortItems (psListOfPortItems, psResult) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 03.11.2011 // Purpose: Subfunction - counts how many items are currently assigned to a port, the result is used to decide if it is possible to add (x<MaxQty) or delete (x>Min Qty) // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 12/01/2012 Initial release //************************************************************************** var z:Number; var Result; var x; var xMax; try { Result= 0; xMax = psListOfPortItems.GetChildCount(); for (x=0; x < xMax; x++) { if(psListOfPortItems.GetChild(x).GetType() == "Instance") { z = psListOfPortItems.GetChild(x).GetProperty("Quantity"); Result = Result + z; } } psResult.SetProperty("PortItems",Result); } catch (e) { oApp.Trace(e.toString()); throw e; } finally { //Release Objects } }

AEC Auto Fix Tools SCM
AECCountPortItems
function AECCountPortItems (psListOfPortItems, psResult) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 03.11.2011 // Purpose: Subfunction - counts how many items are currently assigned to a port, the result is used to decide if it is possible to add (x<MaxQty) or delete (x>Min Qty) // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 12/01/2012 Initial release //************************************************************************** var z:Number; var Result; var x; var xMax; try { Result= 0; xMax = psListOfPortItems.GetChildCount(); for (x=0; x < xMax; x++) { if(psListOfPortItems.GetChild(x).GetType() == "Instance") { z = psListOfPortItems.GetChild(x).GetProperty("Quantity"); Result = Result + z; } } psResult.SetProperty("PortItems",Result); } catch (e) { oApp.Trace(e.toString()); throw e; } finally { //Release Objects } }

AEC Auto Fix Tools SCM
AECGetPortId
function AECGetPortId (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 17.11.2011 // Purpose: Function to select a specific Port Id from the flat list pf Ports // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 17/11/2011 Initial Release //************************************************************************** var ListOfPorts; var psOutput; var lsPortId; var lsProdItemId; var lsProdName; var lnPortMaxQty; var lsDeltaProductId; var i; var iMax; var z; try { ListOfPorts = oApp.NewPropertySet(); psOutput = oApp.NewPropertySet(); Outputs.SetProperty ("Field Value 1","#NA"); ListOfPorts = Inputs.GetChild(psOutput); lsDeltaProductId = Inputs.GetProperty("lsDeltaProductId"); iMax=ListOfPorts.GetChildCount(); for (i=0; i < iMax; i++) { z= ListOfPorts.GetChild(i).GetProperty("Product Id"); if (lsDeltaProductId == z) { lsPortId= ListOfPorts.GetChild(i).GetProperty("PortItemId"); Outputs.SetProperty ("lsPortId",lsPortId); lsProdItemId= ListOfPorts.GetChild(i).GetProperty("Prod Item Id"); Outputs.SetProperty ("lsProdItemId",lsProdItemId); lsProdName= ListOfPorts.GetChild(i).GetProperty("Name"); Outputs.SetProperty ("lsProdName",lsProdName); lnPortMaxQty= ListOfPorts.GetChild(i).GetProperty("PortMaxQty"); Outputs.SetProperty ("PortMaxQty",lnPortMaxQty); } } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects ListOfPorts = null; psOutput = null; } }

AEC Auto Fix Tools SCM
AECGetPortId
function AECGetPortId (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 17.11.2011 // Purpose: Function to select a specific Port Id from the flat list pf Ports // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 17/11/2011 Initial Release //************************************************************************** var ListOfPorts; var psOutput; var lsPortId; var lsProdItemId; var lsProdName; var lnPortMaxQty; var lsDeltaProductId; var i; var iMax; var z; try { ListOfPorts = oApp.NewPropertySet(); psOutput = oApp.NewPropertySet(); Outputs.SetProperty ("Field Value 1","#NA"); ListOfPorts = Inputs.GetChild(psOutput); lsDeltaProductId = Inputs.GetProperty("lsDeltaProductId"); iMax=ListOfPorts.GetChildCount(); for (i=0; i < iMax; i++) { z= ListOfPorts.GetChild(i).GetProperty("Product Id"); if (lsDeltaProductId == z) { lsPortId= ListOfPorts.GetChild(i).GetProperty("PortItemId"); Outputs.SetProperty ("lsPortId",lsPortId); lsProdItemId= ListOfPorts.GetChild(i).GetProperty("Prod Item Id"); Outputs.SetProperty ("lsProdItemId",lsProdItemId); lsProdName= ListOfPorts.GetChild(i).GetProperty("Name"); Outputs.SetProperty ("lsProdName",lsProdName); lnPortMaxQty= ListOfPorts.GetChild(i).GetProperty("PortMaxQty"); Outputs.SetProperty ("PortMaxQty",lnPortMaxQty); } } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects ListOfPorts = null; psOutput = null; } }

AEC Auto Fix Tools SCM
AECGetSubcomponents
function AECGetSubcomponents(Inputs, Outputs) { /* Method to generate flat child products for given Product Name Inputs : RootName ... string with product identifier Vendor ... Vendor name Org ... Organization name Output: Row Set ... Unique set of prodyuct names to be loaded */ var sRootName:chars=Inputs.GetProperty("RootName"); var sVendor:chars=Inputs.GetProperty("Vendor"); var sOrg:chars=Inputs.GetProperty("Org"); var psInp:PropertySet=oApp.NewPropertySet(); var psOut:PropertySet=oApp.NewPropertySet(); var bsCfgBroker:Service=oApp.GetService("Cfg Object Broker"); var iChildCount:float=0; var iChildTypesCount:float=0; var iSubObjCount:float=0; var iPortItemsCount:float=0; var psStruct:PropertySet; var psSubObj:PropertySet; var psPort:PropertySet; var psPortObj:PropertySet; var psRowSetFlat:PropertySet=oApp.NewPropertySet(); var psRowSet:PropertySet=oApp.NewPropertySet(); var psRow:PropertySet; var sChildTypePort:chars="Port"; var sChildTypeSo:chars="SubObject" var sPropName=""; try { with(psInp) { SetProperty("RootName",sRootName); SetProperty("Vendor", sVendor); SetProperty("Org", sOrg); SetProperty("Full","Y"); } bsCfgBroker.InvokeMethod("GetProdStruct",psInp, psOut); iChildCount=psOut.GetChildCount(); if(iChildCount>1) { psStruct=psOut; iSubObjCount=psStruct.GetChildCount(); for(var iSubObj:float=0;iSubObj<iSubObjCount;iSubObj++) { psSubObj=psStruct.GetChild(iSubObj); iChildTypesCount=psSubObj.GetChildCount(); if(iChildTypesCount>0) { for(var iChildType:float=0;iChildType<iChildTypesCount;iChildType++) { if(psSubObj.GetChild(iChildType).GetType()==sChildTypePort) { // found child type Port ( Attribvutes are skiped) psPort=psSubObj.GetChild(iChildType); iPortItemsCount=psPort.GetChildCount(); for(var iPortItem:float=0;iPortItem<iPortItemsCount;iPortItem++) { psPortObj=psPort.GetChild(iPortItem); psRowSetFlat.SetProperty(psPortObj.GetProperty("Id"),"Y"); } } } } } // now we convert found properties into Row Set Form sPropName=psRowSetFlat.GetFirstProperty(); while(sPropName!="") { psRow=oApp.NewPropertySet(); psRow.SetType("Product"); psRow.SetProperty("Id", sPropName); psRowSet.AddChild(psRow); sPropName=psRowSetFlat.GetNextProperty(); } } } catch (e) { oApp.Trace(e.toString()); throw e; } finally { psRowSet.SetType("Row Set"); Outputs.AddChild(psRowSet); psInp=null; psOut=null; bsCfgBroker=null; psStruct=null; psSubObj=null; psPort=null; psPortObj=null; psRowSetFlat=null; psRowSet=null; } }

AEC Auto Fix Tools SCM
AECGetSubcomponents
function AECGetSubcomponents(Inputs, Outputs) { /* Method to generate flat child products for given Product Name Inputs : RootName ... string with product identifier Vendor ... Vendor name Org ... Organization name Output: Row Set ... Unique set of prodyuct names to be loaded */ var sRootName:chars=Inputs.GetProperty("RootName"); var sVendor:chars=Inputs.GetProperty("Vendor"); var sOrg:chars=Inputs.GetProperty("Org"); var psInp:PropertySet=oApp.NewPropertySet(); var psOut:PropertySet=oApp.NewPropertySet(); var bsCfgBroker:Service=oApp.GetService("Cfg Object Broker"); var iChildCount:float=0; var iChildTypesCount:float=0; var iSubObjCount:float=0; var iPortItemsCount:float=0; var psStruct:PropertySet; var psSubObj:PropertySet; var psPort:PropertySet; var psPortObj:PropertySet; var psRowSetFlat:PropertySet=oApp.NewPropertySet(); var psRowSet:PropertySet=oApp.NewPropertySet(); var psRow:PropertySet; var sChildTypePort:chars="Port"; var sChildTypeSo:chars="SubObject" var sPropName=""; try { with(psInp) { SetProperty("RootName",sRootName); SetProperty("Vendor", sVendor); SetProperty("Org", sOrg); SetProperty("Full","Y"); } bsCfgBroker.InvokeMethod("GetProdStruct",psInp, psOut); iChildCount=psOut.GetChildCount(); if(iChildCount>1) { psStruct=psOut; iSubObjCount=psStruct.GetChildCount(); for(var iSubObj:float=0;iSubObj<iSubObjCount;iSubObj++) { psSubObj=psStruct.GetChild(iSubObj); iChildTypesCount=psSubObj.GetChildCount(); if(iChildTypesCount>0) { for(var iChildType:float=0;iChildType<iChildTypesCount;iChildType++) { if(psSubObj.GetChild(iChildType).GetType()==sChildTypePort) { // found child type Port ( Attribvutes are skiped) psPort=psSubObj.GetChild(iChildType); iPortItemsCount=psPort.GetChildCount(); for(var iPortItem:float=0;iPortItem<iPortItemsCount;iPortItem++) { psPortObj=psPort.GetChild(iPortItem); psRowSetFlat.SetProperty(psPortObj.GetProperty("Id"),"Y"); } } } } } // now we convert found properties into Row Set Form sPropName=psRowSetFlat.GetFirstProperty(); while(sPropName!="") { psRow=oApp.NewPropertySet(); psRow.SetType("Product"); psRow.SetProperty("Id", sPropName); psRowSet.AddChild(psRow); sPropName=psRowSetFlat.GetNextProperty(); } } } catch (e) { oApp.Trace(e.toString()); throw e; } finally { psRowSet.SetType("Row Set"); Outputs.AddChild(psRowSet); psInp=null; psOut=null; bsCfgBroker=null; psStruct=null; psSubObj=null; psPort=null; psPortObj=null; psRowSetFlat=null; psRowSet=null; } }

AEC Auto Fix Tools SCM
AECPrepareFlatPortList
function AECPrepareFlatPortList (psListOfPorts, psFlatListOfPorts) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 03.11.2011 // Purpose: Subfunction - converting hierarchy to flat // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 03/11/2011 Initial release //************************************************************************** var psTempRowSet; var lstype1; var lstPiId; var lstPQMax; var lstPQMin; var lstype2; var x; var xMax; var y; var yMax; var i; var iMax; try { psTempRowSet = null; xMax = psListOfPorts.GetChildCount(); for (x= 0; x < xMax; x++) { yMax = psListOfPorts.GetChild(x).GetChildCount(); for (y = 0; y < yMax; y++) { AECPrepareFlatPortList (psListOfPorts.GetChild(x), psFlatListOfPorts); } psTempRowSet = psListOfPorts.GetChild(x).Copy(); lstype1 = psListOfPorts.GetType(); lstPiId = psListOfPorts.GetProperty("Port Item Id"); lstPQMax = psListOfPorts.GetProperty("MaxCardinality"); lstPQMin = psListOfPorts.GetProperty("MinCardinality"); lstype2 = psTempRowSet.GetType(); if ((lstype1 == "Port") && (lstype2 == "PortObject")) { psTempRowSet.SetProperty("PortItemId",lstPiId); psTempRowSet.SetProperty("PortMaxQty",lstPQMax); psTempRowSet.SetProperty("PortMinQty",lstPQMin); psFlatListOfPorts.AddChild(psTempRowSet); } } iMax = psListOfPorts.GetChildCount(); for (i= 0; i < iMax; i++) { psListOfPorts.RemoveChild(0); } } catch (e) { oApp.Trace(e.toString()); throw e; } finally { //Release Objects psTempRowSet = null; } }

AEC Auto Fix Tools SCM
AECPrepareFlatPortList
function AECPrepareFlatPortList (psListOfPorts, psFlatListOfPorts) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 03.11.2011 // Purpose: Subfunction - converting hierarchy to flat // Global variables used: // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 03/11/2011 Initial release //************************************************************************** var psTempRowSet; var lstype1; var lstPiId; var lstPQMax; var lstPQMin; var lstype2; var x; var xMax; var y; var yMax; var i; var iMax; try { psTempRowSet = null; xMax = psListOfPorts.GetChildCount(); for (x= 0; x < xMax; x++) { yMax = psListOfPorts.GetChild(x).GetChildCount(); for (y = 0; y < yMax; y++) { AECPrepareFlatPortList (psListOfPorts.GetChild(x), psFlatListOfPorts); } psTempRowSet = psListOfPorts.GetChild(x).Copy(); lstype1 = psListOfPorts.GetType(); lstPiId = psListOfPorts.GetProperty("Port Item Id"); lstPQMax = psListOfPorts.GetProperty("MaxCardinality"); lstPQMin = psListOfPorts.GetProperty("MinCardinality"); lstype2 = psTempRowSet.GetType(); if ((lstype1 == "Port") && (lstype2 == "PortObject")) { psTempRowSet.SetProperty("PortItemId",lstPiId); psTempRowSet.SetProperty("PortMaxQty",lstPQMax); psTempRowSet.SetProperty("PortMinQty",lstPQMin); psFlatListOfPorts.AddChild(psTempRowSet); } } iMax = psListOfPorts.GetChildCount(); for (i= 0; i < iMax; i++) { psListOfPorts.RemoveChild(0); } } catch (e) { oApp.Trace(e.toString()); throw e; } finally { //Release Objects psTempRowSet = null; } }

AEC Auto Fix Tools SCM
AECPromptApply
function AECPromptApply (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is performing the Auto Fix after the User has pressed the "Apply" button on a Prompt message // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release //************************************************************************** var bsWPM; var psTempRowSet; var psContext; var psInp; var psOutp; var lstHeaderId; try { bsWPM = oApp.GetService("Workflow Process Manager"); psTempRowSet = oApp.NewPropertySet(); psContext = oApp.NewPropertySet(); psInp = oApp.NewPropertySet(); psOutp = oApp.NewPropertySet(); // Setup Context psContext.SetType("Context"); psTempRowSet.SetType("Header"); lstHeaderId = Inputs.GetProperty("Doc Id"); psTempRowSet.SetProperty("AEC RVA I Header Id",Inputs.GetProperty("Doc Id")); psTempRowSet.SetProperty("Header Id",Inputs.GetProperty("Doc Id")); psTempRowSet.SetProperty("AEC RVA AR Qty",Inputs.GetProperty("AEC AR Qty")); psTempRowSet.SetProperty("AEC RVA AR CP Id",Inputs.GetProperty("CP Id")); psTempRowSet.SetProperty("AEC RVA AR Promotion Id",Inputs.GetProperty("Promotion Id")); psTempRowSet.SetProperty("AEC RVA AR Product Id",Inputs.GetProperty("Product Id")); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id Undo","-"); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id Apply","-"); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id","-"); psTempRowSet.SetProperty("AEC RVA AR Undo Action","-"); psTempRowSet.SetProperty("AEC RVA AR Apply Action","-"); psTempRowSet.SetProperty("AEC RVA Skip AR","N"); psTempRowSet.SetProperty("AEC RVA AR Auto Action",Inputs.GetProperty("Apply Action")); psTempRowSet.SetProperty("AEC RVA AR Auto Fix Message",Inputs.GetProperty("Auto Fix Message")); psTempRowSet.SetProperty("AEC RVA AR Compatibility Rule Id",Inputs.GetProperty("Compatibility Rule Id")); psTempRowSet.SetProperty("AEC RVA AR Default Product Id",Inputs.GetProperty("Default Product Id")); psTempRowSet.SetProperty("AEC RVA AR Promotion Instance Id",Inputs.GetProperty("Promotion Instance Id")); psTempRowSet.SetProperty("AEC RVA AR I Root Product Id",Inputs.GetProperty("Root Product Id")); if (Inputs.GetProperty("Apply Action") == "Remove Item") { // Setup Property Set for Add Item/ psTempRowSet.SetProperty("AEC RVA AR Check Remove","Y"); psTempRowSet.SetProperty("AEC RVA AR Counter","0"); } psContext.AddChild(psTempRowSet); // Invoke Driver Workflow psInp.SetProperty("ProcessName", "AEC Rules Validation Driver SCM"); psInp.SetProperty("Perform RVE", "N"); psInp.SetProperty("Perform RVR", "Y"); psInp.SetProperty("AEC Cfg Context", "N"); psInp.AddChild(psContext); bsWPM.InvokeMethod("RunProcess", psInp, psOutp); } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects bsWPM = null; psTempRowSet = null; psContext = null; psInp = null; psOutp = null; } }

AEC Auto Fix Tools SCM
AECPromptApply
function AECPromptApply (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is performing the Auto Fix after the User has pressed the "Apply" button on a Prompt message // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release //************************************************************************** var bsWPM; var psTempRowSet; var psContext; var psInp; var psOutp; var lstHeaderId; try { bsWPM = oApp.GetService("Workflow Process Manager"); psTempRowSet = oApp.NewPropertySet(); psContext = oApp.NewPropertySet(); psInp = oApp.NewPropertySet(); psOutp = oApp.NewPropertySet(); // Setup Context psContext.SetType("Context"); psTempRowSet.SetType("Header"); lstHeaderId = Inputs.GetProperty("Doc Id"); psTempRowSet.SetProperty("AEC RVA I Header Id",Inputs.GetProperty("Doc Id")); psTempRowSet.SetProperty("Header Id",Inputs.GetProperty("Doc Id")); psTempRowSet.SetProperty("AEC RVA AR Qty",Inputs.GetProperty("AEC AR Qty")); psTempRowSet.SetProperty("AEC RVA AR CP Id",Inputs.GetProperty("CP Id")); psTempRowSet.SetProperty("AEC RVA AR Promotion Id",Inputs.GetProperty("Promotion Id")); psTempRowSet.SetProperty("AEC RVA AR Product Id",Inputs.GetProperty("Product Id")); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id Undo","-"); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id Apply","-"); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id","-"); psTempRowSet.SetProperty("AEC RVA AR Undo Action","-"); psTempRowSet.SetProperty("AEC RVA AR Apply Action","-"); psTempRowSet.SetProperty("AEC RVA Skip AR","N"); psTempRowSet.SetProperty("AEC RVA AR Auto Action",Inputs.GetProperty("Apply Action")); psTempRowSet.SetProperty("AEC RVA AR Auto Fix Message",Inputs.GetProperty("Auto Fix Message")); psTempRowSet.SetProperty("AEC RVA AR Compatibility Rule Id",Inputs.GetProperty("Compatibility Rule Id")); psTempRowSet.SetProperty("AEC RVA AR Default Product Id",Inputs.GetProperty("Default Product Id")); psTempRowSet.SetProperty("AEC RVA AR Promotion Instance Id",Inputs.GetProperty("Promotion Instance Id")); psTempRowSet.SetProperty("AEC RVA AR I Root Product Id",Inputs.GetProperty("Root Product Id")); if (Inputs.GetProperty("Apply Action") == "Remove Item") { // Setup Property Set for Add Item/ psTempRowSet.SetProperty("AEC RVA AR Check Remove","Y"); psTempRowSet.SetProperty("AEC RVA AR Counter","0"); } psContext.AddChild(psTempRowSet); // Invoke Driver Workflow psInp.SetProperty("ProcessName", "AEC Rules Validation Driver SCM"); psInp.SetProperty("Perform RVE", "N"); psInp.SetProperty("Perform RVR", "Y"); psInp.SetProperty("AEC Cfg Context", "N"); psInp.AddChild(psContext); bsWPM.InvokeMethod("RunProcess", psInp, psOutp); } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects bsWPM = null; psTempRowSet = null; psContext = null; psInp = null; psOutp = null; } }

AEC Auto Fix Tools SCM
AECPromptUndo
function AECPromptUndo (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is performing the Auto Fix after the User has pressed the "Undo" button on a Prompt message // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release //************************************************************************** var bsWPM; var psTempRowSet; var psContext; var psInp; var psOutp; var lstHeaderId; try { bsWPM = oApp.GetService("Workflow Process Manager"); psTempRowSet = oApp.NewPropertySet(); psContext = oApp.NewPropertySet(); psInp = oApp.NewPropertySet(); psOutp = oApp.NewPropertySet(); // Setup Context psContext.SetType("Context"); psTempRowSet.SetType("Header"); lstHeaderId = Inputs.GetProperty("Doc Id"); psTempRowSet.SetProperty("AEC RVA I Header Id",Inputs.GetProperty("Doc Id")); psTempRowSet.SetProperty("Header Id",Inputs.GetProperty("Doc Id")); psTempRowSet.SetProperty("AEC RVA AR Qty",Inputs.GetProperty("AEC AR Qty")); psTempRowSet.SetProperty("AEC RVA AR CP Id",Inputs.GetProperty("CP Id")); psTempRowSet.SetProperty("AEC RVA AR Promotion Id",Inputs.GetProperty("Promotion Id")); psTempRowSet.SetProperty("AEC RVA AR Product Id",Inputs.GetProperty("Product Id")); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id Undo","-"); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id Apply","-"); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id",Inputs.GetProperty("Remove Item Id Undo")); psTempRowSet.SetProperty("AEC RVA AR Undo Action","-"); psTempRowSet.SetProperty("AEC RVA AR Apply Action","-"); psTempRowSet.SetProperty("AEC RVA Skip AR","N"); psTempRowSet.SetProperty("AEC RVA AR Auto Action",Inputs.GetProperty("Undo Action")); psTempRowSet.SetProperty("AEC RVA AR Auto Fix Message",Inputs.GetProperty("Auto Fix Message")); psTempRowSet.SetProperty("AEC RVA AR Compatibility Rule Id",Inputs.GetProperty("Compatibility Rule Id")); psTempRowSet.SetProperty("AEC RVA AR Default Product Id",Inputs.GetProperty("Default Product Id")); psTempRowSet.SetProperty("AEC RVA AR Promotion Instance Id",Inputs.GetProperty("Promotion Instance Id")); psTempRowSet.SetProperty("AEC RVA AR I Root Product Id",Inputs.GetProperty("Root Product Id")); psContext.AddChild(psTempRowSet); // Invoke Driver Workflow psInp.SetProperty("ProcessName", "AEC Rules Validation Driver SCM"); psInp.SetProperty("Perform RVE", "N"); psInp.SetProperty("Perform RVR", "Y"); psInp.SetProperty("AEC Cfg Context", "N"); psInp.AddChild(psContext); bsWPM.InvokeMethod("RunProcess", psInp, psOutp); } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects bsWPM = null; psTempRowSet = null; psContext = null; psInp = null; psOutp = null; } }

AEC Auto Fix Tools SCM
AECPromptUndo
function AECPromptUndo (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is performing the Auto Fix after the User has pressed the "Undo" button on a Prompt message // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release //************************************************************************** var bsWPM; var psTempRowSet; var psContext; var psInp; var psOutp; var lstHeaderId; try { bsWPM = oApp.GetService("Workflow Process Manager"); psTempRowSet = oApp.NewPropertySet(); psContext = oApp.NewPropertySet(); psInp = oApp.NewPropertySet(); psOutp = oApp.NewPropertySet(); // Setup Context psContext.SetType("Context"); psTempRowSet.SetType("Header"); lstHeaderId = Inputs.GetProperty("Doc Id"); psTempRowSet.SetProperty("AEC RVA I Header Id",Inputs.GetProperty("Doc Id")); psTempRowSet.SetProperty("Header Id",Inputs.GetProperty("Doc Id")); psTempRowSet.SetProperty("AEC RVA AR Qty",Inputs.GetProperty("AEC AR Qty")); psTempRowSet.SetProperty("AEC RVA AR CP Id",Inputs.GetProperty("CP Id")); psTempRowSet.SetProperty("AEC RVA AR Promotion Id",Inputs.GetProperty("Promotion Id")); psTempRowSet.SetProperty("AEC RVA AR Product Id",Inputs.GetProperty("Product Id")); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id Undo","-"); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id Apply","-"); psTempRowSet.SetProperty("AEC RVA AR Remove Item Id",Inputs.GetProperty("Remove Item Id Undo")); psTempRowSet.SetProperty("AEC RVA AR Undo Action","-"); psTempRowSet.SetProperty("AEC RVA AR Apply Action","-"); psTempRowSet.SetProperty("AEC RVA Skip AR","N"); psTempRowSet.SetProperty("AEC RVA AR Auto Action",Inputs.GetProperty("Undo Action")); psTempRowSet.SetProperty("AEC RVA AR Auto Fix Message",Inputs.GetProperty("Auto Fix Message")); psTempRowSet.SetProperty("AEC RVA AR Compatibility Rule Id",Inputs.GetProperty("Compatibility Rule Id")); psTempRowSet.SetProperty("AEC RVA AR Default Product Id",Inputs.GetProperty("Default Product Id")); psTempRowSet.SetProperty("AEC RVA AR Promotion Instance Id",Inputs.GetProperty("Promotion Instance Id")); psTempRowSet.SetProperty("AEC RVA AR I Root Product Id",Inputs.GetProperty("Root Product Id")); psContext.AddChild(psTempRowSet); // Invoke Driver Workflow psInp.SetProperty("ProcessName", "AEC Rules Validation Driver SCM"); psInp.SetProperty("Perform RVE", "N"); psInp.SetProperty("Perform RVR", "Y"); psInp.SetProperty("AEC Cfg Context", "N"); psInp.AddChild(psContext); bsWPM.InvokeMethod("RunProcess", psInp, psOutp); } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects bsWPM = null; psTempRowSet = null; psContext = null; psInp = null; psOutp = null; } }

AEC Auto Fix Tools SCM
AECRemoveComponent
function AECRemoveComponent (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is instanciating a new Complex Product instance and removes the specified product // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 24/10/2011 Initial Release //************************************************************************** /* try { var s1 = TheApplication().GetService("ISS Copy Service"); var s2 = TheApplication().GetService("Remote Complex Object Instance Service"); var s3 = TheApplication().GetService("CXInstanceServiceSuppliment"); var inp1 = TheApplication().NewPropertySet(); var out1 = TheApplication().NewPropertySet(); var inp2 = TheApplication().NewPropertySet(); var inp3 = TheApplication().NewPropertySet(); var inp4 = TheApplication().NewPropertySet(); var inp5 = TheApplication().NewPropertySet(); var inp6 = TheApplication().NewPropertySet(); var inp7 = TheApplication().NewPropertySet(); var psOutput = TheApplication().NewPropertySet(); var Instance = TheApplication().NewPropertySet(); var ListOfPorts = TheApplication().NewPropertySet(); var lsIntegrationObjectName:String; var lsObjectId:String; var lsDeltaProductId:String; var lsDeltaProductQty:String; var lsDeltaProductAction:String; var lsDeltaProductItemId:String; var lsDeltaProductName:String; var lsMode:String; var lsRootId:String; var lsCxProdId:String; var lsSearchSpec:String; var lsPortId:String; var lsPath:String; lsIntegrationObjectName = Inputs.GetProperty("IntegrationObjectName"); lsObjectId = Inputs.GetProperty("ObjectId"); lsDeltaProductId = Inputs.GetProperty("DeltaProductId"); lsDeltaProductQty = Inputs.GetProperty("DeltaProductQty"); lsDeltaProductAction = Inputs.GetProperty("DeltaProductAction"); lsMode = Inputs.GetProperty("Mode"); lsRootId = Inputs.GetProperty("RootId"); lsCxProdId = Inputs.GetProperty("CxProdId"); lsSearchSpec = "[Header.Id]='" + lsObjectId + "' AND [Line Item.Root Id]='" + lsRootId + "'"; inp1.SetProperty("ParentObjectId",lsObjectId); inp1.SetProperty("IntegrationObjectName", lsIntegrationObjectName); inp1.SetProperty("RootId",lsRootId); inp1.SetProperty("SearchSpec","[Header.Id]='" + lsObjectId + "' AND [Line Item.Root Id]='" + lsRootId + "'"); s1.InvokeMethod("LoadEAI",inp1,out1); // Load Instance inp1.SetProperty("ObjId",lsObjectId); inp1.SetProperty("IntObjName", lsIntegrationObjectName); inp1.SetProperty("Product Id", lsCxProdId); inp1.SetProperty("RootId",lsRootId); inp1.SetProperty("TriggerEvent","Y"); s2.InvokeMethod("LoadInstance",inp1,out1); // Get Instance inp1.SetProperty("ObjId",lsObjectId); inp1.SetProperty("RootId",lsRootId); s2.InvokeMethod("GetInstance",inp1,Instance); lsPath = "8SIA-7IDSA"; // Remove Item inp3.SetProperty("ObjId",lsObjectId); inp3.SetProperty("RootId",lsRootId); inp3.SetProperty("Path",lsPath); s2.InvokeMethod("RemoveItem",inp3,Outputs); // Sync Item inp7.SetProperty("ObjId",lsObjectId); inp7.SetProperty("RootId",lsRootId); inp7.SetProperty("IntObjName",lsIntegrationObjectName); s2.InvokeMethod("SyncInstance",inp7,Outputs); var xc="1"; var xc1="2"; } catch(e) { TheApplication().Trace(e.toString()); throw e; } finally { } */ }

AEC Auto Fix Tools SCM
AECRemoveComponent
function AECRemoveComponent (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is instanciating a new Complex Product instance and removes the specified product // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 24/10/2011 Initial Release //************************************************************************** /* try { var s1 = TheApplication().GetService("ISS Copy Service"); var s2 = TheApplication().GetService("Remote Complex Object Instance Service"); var s3 = TheApplication().GetService("CXInstanceServiceSuppliment"); var inp1 = TheApplication().NewPropertySet(); var out1 = TheApplication().NewPropertySet(); var inp2 = TheApplication().NewPropertySet(); var inp3 = TheApplication().NewPropertySet(); var inp4 = TheApplication().NewPropertySet(); var inp5 = TheApplication().NewPropertySet(); var inp6 = TheApplication().NewPropertySet(); var inp7 = TheApplication().NewPropertySet(); var psOutput = TheApplication().NewPropertySet(); var Instance = TheApplication().NewPropertySet(); var ListOfPorts = TheApplication().NewPropertySet(); var lsIntegrationObjectName:String; var lsObjectId:String; var lsDeltaProductId:String; var lsDeltaProductQty:String; var lsDeltaProductAction:String; var lsDeltaProductItemId:String; var lsDeltaProductName:String; var lsMode:String; var lsRootId:String; var lsCxProdId:String; var lsSearchSpec:String; var lsPortId:String; var lsPath:String; lsIntegrationObjectName = Inputs.GetProperty("IntegrationObjectName"); lsObjectId = Inputs.GetProperty("ObjectId"); lsDeltaProductId = Inputs.GetProperty("DeltaProductId"); lsDeltaProductQty = Inputs.GetProperty("DeltaProductQty"); lsDeltaProductAction = Inputs.GetProperty("DeltaProductAction"); lsMode = Inputs.GetProperty("Mode"); lsRootId = Inputs.GetProperty("RootId"); lsCxProdId = Inputs.GetProperty("CxProdId"); lsSearchSpec = "[Header.Id]='" + lsObjectId + "' AND [Line Item.Root Id]='" + lsRootId + "'"; inp1.SetProperty("ParentObjectId",lsObjectId); inp1.SetProperty("IntegrationObjectName", lsIntegrationObjectName); inp1.SetProperty("RootId",lsRootId); inp1.SetProperty("SearchSpec","[Header.Id]='" + lsObjectId + "' AND [Line Item.Root Id]='" + lsRootId + "'"); s1.InvokeMethod("LoadEAI",inp1,out1); // Load Instance inp1.SetProperty("ObjId",lsObjectId); inp1.SetProperty("IntObjName", lsIntegrationObjectName); inp1.SetProperty("Product Id", lsCxProdId); inp1.SetProperty("RootId",lsRootId); inp1.SetProperty("TriggerEvent","Y"); s2.InvokeMethod("LoadInstance",inp1,out1); // Get Instance inp1.SetProperty("ObjId",lsObjectId); inp1.SetProperty("RootId",lsRootId); s2.InvokeMethod("GetInstance",inp1,Instance); lsPath = "8SIA-7IDSA"; // Remove Item inp3.SetProperty("ObjId",lsObjectId); inp3.SetProperty("RootId",lsRootId); inp3.SetProperty("Path",lsPath); s2.InvokeMethod("RemoveItem",inp3,Outputs); // Sync Item inp7.SetProperty("ObjId",lsObjectId); inp7.SetProperty("RootId",lsRootId); inp7.SetProperty("IntObjName",lsIntegrationObjectName); s2.InvokeMethod("SyncInstance",inp7,Outputs); var xc="1"; var xc1="2"; } catch(e) { TheApplication().Trace(e.toString()); throw e; } finally { } */ }

AEC Auto Fix Tools SCM
AECRemoveComponentFromActualInstance
function AECRemoveComponentFromActualInstance (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is removing a component products from the actual Complex Product instance // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release // TTrenkler 17/01/2012 Added functionality to replace by default product (for fallback support) // TAABAVI3 16/03/2017 defect 5262, added conditions about DefaultProdId with && !=null && !="", to prevent OSI // and other engine to submit wrong request ("-" was the only expected before) //************************************************************************** // Variable Declaration var s2; var psInp1; var psInp2; var psListOfPorts; var psFlatPortList; var psListOfPortItems; var lnPortItemsMax:Number; var lsDefaultProdId; try { s2 = oApp.GetService("Remote Complex Object Instance Service"); psInp1 = oApp.NewPropertySet(); psInp2 = oApp.NewPropertySet(); psListOfPorts = oApp.NewPropertySet(); psFlatPortList = oApp.NewPropertySet(); psListOfPortItems = oApp.NewPropertySet(); lsDefaultProdId = Inputs.GetProperty("DefaultProdId"); if(lsDefaultProdId !="-" && lsDefaultProdId !="" && lsDefaultProdId != null) { // Get All Ports psInp1.SetProperty("GetPortDomain","Y"); psInp1.SetProperty("Product Id", Inputs.GetProperty("CxProdId")); s2.InvokeMethod("GetAllPorts",psInp1,psListOfPorts); // Prepare Flat Port List AECPrepareFlatPortList(psListOfPorts,psFlatPortList); // Get Port Id for Default Product psInp2.AddChild(psFlatPortList); psInp2.SetProperty("lsDeltaProductId",lsDefaultProdId); AECGetPortId(psInp2,Outputs); lnPortItemsMax = Outputs.GetProperty("PortMaxQty"); // Get Selected Items psInp1.SetProperty("ObjId",Inputs.GetProperty("ObjectId")); psInp1.SetProperty("Parent Path",Inputs.GetProperty("ParentPath")); psInp1.SetProperty("Port Item Id",Outputs.GetProperty("lsPortId")); psInp1.SetProperty("IntObjName", Inputs.GetProperty("IntObjName")); psInp1.SetProperty("RootId",Inputs.GetProperty("RootId")); s2.InvokeMethod("EnumObjects",psInp1,psListOfPortItems); if (lnPortItemsMax == 1) { // Replace Item psInp1.SetProperty("Product Id",lsDefaultProdId); psInp1.SetProperty("Prod Item Id",Outputs.GetProperty("lsProdItemId")); psInp1.SetProperty("Integration Id",Inputs.GetProperty("IntegrationId")); psInp1.SetProperty("Path",psListOfPortItems.GetChild(0).GetProperty("Path")); psInp1.SetProperty("Name",Outputs.GetProperty("lsProdName")); psInp1.SetProperty("Quantity","1"); psInp1.SetProperty("AutoFix","Y"); s2.InvokeMethod("ReplaceItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } } else { // Remove Item psInp1.SetProperty("ObjId",Inputs.GetProperty("ObjectId")); psInp1.SetProperty("Path",Inputs.GetProperty("lsDeltaProductItemId")); psInp1.SetProperty("RootId",Inputs.GetProperty("RootId")); psInp1.SetProperty("AutoFix","Y"); s2.InvokeMethod("RemoveItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects psInp1 = null; psInp2 = null; psListOfPorts = null; psFlatPortList = null; psListOfPortItems = null; s2 = null; } }

AEC Auto Fix Tools SCM
AECRemoveComponentFromActualInstance
function AECRemoveComponentFromActualInstance (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is removing a component products from the actual Complex Product instance // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release // TTrenkler 17/01/2012 Added functionality to replace by default product (for fallback support) //************************************************************************** // Variable Declaration var s2; var psInp1; var psInp2; var psListOfPorts; var psFlatPortList; var psListOfPortItems; var lnPortItemsMax:Number; var lsDefaultProdId; try { s2 = oApp.GetService("Remote Complex Object Instance Service"); psInp1 = oApp.NewPropertySet(); psInp2 = oApp.NewPropertySet(); psListOfPorts = oApp.NewPropertySet(); psFlatPortList = oApp.NewPropertySet(); psListOfPortItems = oApp.NewPropertySet(); lsDefaultProdId = Inputs.GetProperty("DefaultProdId"); if(lsDefaultProdId !="-") { // Get All Ports psInp1.SetProperty("GetPortDomain","Y"); psInp1.SetProperty("Product Id", Inputs.GetProperty("CxProdId")); s2.InvokeMethod("GetAllPorts",psInp1,psListOfPorts); // Prepare Flat Port List AECPrepareFlatPortList(psListOfPorts,psFlatPortList); // Get Port Id for Default Product psInp2.AddChild(psFlatPortList); psInp2.SetProperty("lsDeltaProductId",lsDefaultProdId); AECGetPortId(psInp2,Outputs); lnPortItemsMax = Outputs.GetProperty("PortMaxQty"); // Get Selected Items psInp1.SetProperty("ObjId",Inputs.GetProperty("ObjectId")); psInp1.SetProperty("Parent Path",Inputs.GetProperty("ParentPath")); psInp1.SetProperty("Port Item Id",Outputs.GetProperty("lsPortId")); psInp1.SetProperty("IntObjName", Inputs.GetProperty("IntObjName")); psInp1.SetProperty("RootId",Inputs.GetProperty("RootId")); s2.InvokeMethod("EnumObjects",psInp1,psListOfPortItems); if (lnPortItemsMax == 1) { // Replace Item psInp1.SetProperty("Product Id",lsDefaultProdId); psInp1.SetProperty("Prod Item Id",Outputs.GetProperty("lsProdItemId")); psInp1.SetProperty("Integration Id",Inputs.GetProperty("IntegrationId")); psInp1.SetProperty("Path",psListOfPortItems.GetChild(0).GetProperty("Path")); psInp1.SetProperty("Name",Outputs.GetProperty("lsProdName")); psInp1.SetProperty("Quantity","1"); psInp1.SetProperty("AutoFix","Y"); s2.InvokeMethod("ReplaceItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } } else { // Remove Item psInp1.SetProperty("ObjId",Inputs.GetProperty("ObjectId")); psInp1.SetProperty("Path",Inputs.GetProperty("lsDeltaProductItemId")); psInp1.SetProperty("RootId",Inputs.GetProperty("RootId")); psInp1.SetProperty("AutoFix","Y"); s2.InvokeMethod("RemoveItem",psInp1, Outputs); Outputs.SetProperty("AEC Operation Success", "Y"); } } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects psInp1 = null; psInp2 = null; psListOfPorts = null; psFlatPortList = null; psListOfPortItems = null; s2 = null; } }

AEC Auto Fix Tools SCM
AECRemovePromotionItem
function AECRemovePromotionItem (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is removing Promotion Items when inside the EditPromotionUI // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 15/10/2013 Initial Release //************************************************************************** var s1; var inp1; try { s1 = oApp.GetService("ISS Promotion Edit UI Service"); inp1 = oApp.NewPropertySet(); inp1.SetType("Disconnect"); inp1.SetProperty("Item Id",Inputs.GetProperty("IID")); inp1.SetProperty("Promotion Rule Id",Inputs.GetProperty("PRID")); s1.InvokeMethod("UpdateStructure",inp1, Outputs); } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects inp1 = null; s1 = null; } }

AEC Auto Fix Tools SCM
AECRemovePromotionItem
function AECRemovePromotionItem (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is removing Promotion Items when inside the EditPromotionUI // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 15/10/2013 Initial Release //************************************************************************** var s1; var inp1; try { s1 = oApp.GetService("ISS Promotion Edit UI Service"); inp1 = oApp.NewPropertySet(); inp1.SetType("Disconnect"); inp1.SetProperty("Item Id",Inputs.GetProperty("IID")); inp1.SetProperty("Promotion Rule Id",Inputs.GetProperty("PRID")); s1.InvokeMethod("UpdateStructure",inp1, Outputs); } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects inp1 = null; s1 = null; } }

AEC Auto Fix Tools SCM
AECSetActiveJWS
function AECSetActiveJWS(Inputs,Outputs) { /* SPE Supporting method, for query of Joint Workspace and set this workspace as active Logic behind Write record on BC is not available as another business service call Inputs : JWS Id ... row id of Joint Workspace to be activated/deactivated Active Mode ... Y/N Value to be set for Activation or Deactivation of JWS History: ----------------------------------------------------------- TAABIVA1 2015/01/13 Script created */ var oBoJws:BusObject; var oBcJws=BusComp; try { oApp=TheApplication(); oBoJws=oApp.GetBusObject("Admin ISS Joint Workspace Definition"); oBcJws=oBoJws.GetBusComp("ISS Joint Workspace BusComp"); oBcJws.SetViewMode(AllView); oBcJws.ActivateField("Active Workspace Flag"); oBcJws.ActivateField("Tesing DateTime"); // field used by Background logic, not by this script !!!!! oBcJws.ClearToQuery(); oBcJws.SetSearchSpec("Id","'" + Inputs.GetProperty("JWS Id") +"'" ); oBcJws.ExecuteQuery(ForwardOnly); if(oBcJws.FirstRecord()) { oBcJws.SetFieldValue("Active Workspace Flag",Inputs.GetProperty("Active Mode")); oBcJws.WriteRecord(); } } catch(e) { } finally { oBcJws=null; oBoJws=null; oApp=null; } }

AEC Auto Fix Tools SCM
AECSetActiveJWS
function AECSetActiveJWS(Inputs,Outputs) { /* SPE Supporting method, for query of Joint Workspace and set this workspace as active Logic behind Write record on BC is not available as another business service call Inputs : JWS Id ... row id of Joint Workspace to be activated/deactivated Active Mode ... Y/N Value to be set for Activation or Deactivation of JWS History: ----------------------------------------------------------- TAABIVA1 2015/01/13 Script created */ var oBoJws:BusObject; var oBcJws=BusComp; try { oApp=TheApplication(); oBoJws=oApp.GetBusObject("Admin ISS Joint Workspace Definition"); oBcJws=oBoJws.GetBusComp("ISS Joint Workspace BusComp"); oBcJws.SetViewMode(AllView); oBcJws.ActivateField("Active Workspace Flag"); oBcJws.ActivateField("Tesing DateTime"); // field used by Background logic, not by this script !!!!! oBcJws.ClearToQuery(); oBcJws.SetSearchSpec("Id","'" + Inputs.GetProperty("JWS Id") +"'" ); oBcJws.ExecuteQuery(ForwardOnly); if(oBcJws.FirstRecord()) { oBcJws.SetFieldValue("Active Workspace Flag",Inputs.GetProperty("Active Mode")); oBcJws.WriteRecord(); } } catch(e) { } finally { oBcJws=null; oBoJws=null; oApp=null; } }

AEC Auto Fix Tools SCM
AECUpdateDefaultDiscountsSCMinIntance
//*************************************************************************** // Purpose: this function cycles trough and rowset containing actions from the scoring engine // and calls a setfield value to update the scoring engine flag. // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TGDLOHU1 17/13/2011 Initial Release //************************************************************************** function AECUpdateDefaultDiscountsSCMinIntance(Inputs, Outputs) { var psRowSet; var psRow; var bsRCOIS; var psInputs; var psOutputs; try { var intChildren = Inputs.GetChildCount(); for (var y = 0; y < intChildren; y++) { psRowSet = Inputs.GetChild(y); var sTypeOut = psRowSet.GetType(); if (sTypeOut == "Promotion") { var intRows = psRowSet.GetChildCount(); for (var z = 0; z < intRows; z++) { psRow = psRowSet.GetChild(z); psInputs = TheApplication().NewPropertySet(); psOutputs = TheApplication().NewPropertySet(); bsRCOIS = TheApplication().GetService("Remote Complex Object Instance Service"); var sObjId = TheApplication().GetProfileAttr("PMCCreateSessionObjId"); var sRootId = TheApplication().GetProfileAttr("PMCCreateSessionRootId"); var sAECId = psRow.GetProperty("AECID"); psInputs.SetProperty("ObjId", sObjId); psInputs.SetProperty("RootId", sRootId); psInputs.SetProperty("Path", sAECId); psInputs.SetProperty("FieldName", "Default Discounts SCM"); psInputs.SetProperty("Value", "Y"); bsRCOIS.InvokeMethod("SetFieldValue", psInputs, psOutputs); var breakPoint = "1"; } } } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects psRowSet = null; psOutputs = null; psInputs = null; bsRCOIS = null; psRow = null; } }

AEC Auto Fix Tools SCM
AECUpdateDefaultDiscountsSCMinIntance
//*************************************************************************** // Purpose: this function cycles trough and rowset containing actions from the scoring engine // and calls a setfield value to update the scoring engine flag. // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TGDLOHU1 17/13/2011 Initial Release //************************************************************************** function AECUpdateDefaultDiscountsSCMinIntance(Inputs, Outputs) { var psRowSet; var psRow; var bsRCOIS; var psInputs; var psOutputs; try { var intChildren = Inputs.GetChildCount(); for (var y = 0; y < intChildren; y++) { psRowSet = Inputs.GetChild(y); var sTypeOut = psRowSet.GetType(); if (sTypeOut == "Promotion") { var intRows = psRowSet.GetChildCount(); for (var z = 0; z < intRows; z++) { psRow = psRowSet.GetChild(z); psInputs = TheApplication().NewPropertySet(); psOutputs = TheApplication().NewPropertySet(); bsRCOIS = TheApplication().GetService("Remote Complex Object Instance Service"); var sObjId = TheApplication().GetProfileAttr("PMCCreateSessionObjId"); var sRootId = TheApplication().GetProfileAttr("PMCCreateSessionRootId"); var sAECId = psRow.GetProperty("AECID"); psInputs.SetProperty("ObjId", sObjId); psInputs.SetProperty("RootId", sRootId); psInputs.SetProperty("Path", sAECId); psInputs.SetProperty("FieldName", "Default Discounts SCM"); psInputs.SetProperty("Value", "Y"); bsRCOIS.InvokeMethod("SetFieldValue", psInputs, psOutputs); var breakPoint = "1"; } } } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects psRowSet = null; psOutputs = null; psInputs = null; bsRCOIS = null; psRow = null; } }

AEC Auto Fix Tools SCM
AECUpdateDefaultDiscountsSCMinIntance2
//*************************************************************************** // Purpose: this function cycles trough the Row Set Propertie set and updates the Default Discounts SCM flag in instance // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TGDTRTH6 24/10/2013 Initial Release //************************************************************************** function AECUpdateDefaultDiscountsSCMinIntance2(Inputs, Outputs) { var psRowSet; var psRow; var bsRCOIS; var psInputs; var psOutputs; try { var intChildren = Inputs.GetChildCount(); for (var y = 0; y < intChildren; y++) { psRowSet = Inputs.GetChild(y); var sTypeOut = psRowSet.GetType(); if (sTypeOut == "Promotion") { var intRows = psRowSet.GetChildCount(); for (var z = 0; z < intRows; z++) { psRow = psRowSet.GetChild(z); if (psRow.GetProperty("UpdDefDisc") =="Y") { psInputs = TheApplication().NewPropertySet(); psOutputs = TheApplication().NewPropertySet(); bsRCOIS = TheApplication().GetService("Remote Complex Object Instance Service"); var sObjId = TheApplication().GetProfileAttr("PMCCreateSessionObjId"); var sRootId = TheApplication().GetProfileAttr("PMCCreateSessionRootId"); var sAECId = psRow.GetProperty("Id"); psInputs.SetProperty("ObjId", sObjId); psInputs.SetProperty("RootId", sRootId); psInputs.SetProperty("Path", sAECId); psInputs.SetProperty("FieldName", "Default Discounts SCM"); psInputs.SetProperty("Value", "Y"); bsRCOIS.InvokeMethod("SetFieldValue", psInputs, psOutputs); var breakPoint = "1"; } } } } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects psRowSet = null; psOutputs = null; psInputs = null; bsRCOIS = null; psRow = null; } }

AEC Auto Fix Tools SCM
AECUpdateDefaultDiscountsSCMinIntance2
//*************************************************************************** // Purpose: this function cycles trough the Row Set Propertie set and updates the Default Discounts SCM flag in instance // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TGDTRTH6 24/10/2013 Initial Release //************************************************************************** function AECUpdateDefaultDiscountsSCMinIntance2(Inputs, Outputs) { var psRowSet; var psRow; var bsRCOIS; var psInputs; var psOutputs; try { var intChildren = Inputs.GetChildCount(); for (var y = 0; y < intChildren; y++) { psRowSet = Inputs.GetChild(y); var sTypeOut = psRowSet.GetType(); if (sTypeOut == "Promotion") { var intRows = psRowSet.GetChildCount(); for (var z = 0; z < intRows; z++) { psRow = psRowSet.GetChild(z); if (psRow.GetProperty("UpdDefDisc") =="Y") { psInputs = TheApplication().NewPropertySet(); psOutputs = TheApplication().NewPropertySet(); bsRCOIS = TheApplication().GetService("Remote Complex Object Instance Service"); var sObjId = TheApplication().GetProfileAttr("PMCCreateSessionObjId"); var sRootId = TheApplication().GetProfileAttr("PMCCreateSessionRootId"); var sAECId = psRow.GetProperty("Id"); psInputs.SetProperty("ObjId", sObjId); psInputs.SetProperty("RootId", sRootId); psInputs.SetProperty("Path", sAECId); psInputs.SetProperty("FieldName", "Default Discounts SCM"); psInputs.SetProperty("Value", "Y"); bsRCOIS.InvokeMethod("SetFieldValue", psInputs, psOutputs); var breakPoint = "1"; } } } } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects psRowSet = null; psOutputs = null; psInputs = null; bsRCOIS = null; psRow = null; } }

AEC Auto Fix Tools SCM
AECValidateActualInstance
function AECValidateActualInstance (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is validating the actual Complex Product instance after an AutoFix Action has been done // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release //************************************************************************** var s1; var inp1; try { s1 = oApp.GetService("Cfg Web UI Service (JS)"); inp1 = oApp.NewPropertySet(); inp1.SetProperty("ObjId",Inputs.GetProperty("RootId")); inp1.SetProperty("Parent Path",Inputs.GetProperty("ObjectId")); inp1.SetProperty("RootId",Inputs.GetProperty("RootId")); inp1.SetProperty("RequestType","ExternalValidate"); s1.InvokeMethod("SubmitRequest",inp1, Outputs); } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects inp1 = null; s1 = null; } }

AEC Auto Fix Tools SCM
AECValidateActualInstance
function AECValidateActualInstance (Inputs, Outputs) { //*************************************************************************** // Author: Trenkler, Thomas // Company: Oracle // Date Created: 24.10.2011 // Purpose: This Business Service is validating the actual Complex Product instance after an AutoFix Action has been done // Modification List // Name Date Modification Description // ---------- ---- ----------------------------- // TTrenkler 20/12/2011 Initial Release //************************************************************************** var s1; var inp1; try { s1 = oApp.GetService("Cfg Web UI Service (JS)"); inp1 = oApp.NewPropertySet(); inp1.SetProperty("ObjId",Inputs.GetProperty("RootId")); inp1.SetProperty("Parent Path",Inputs.GetProperty("ObjectId")); inp1.SetProperty("RootId",Inputs.GetProperty("RootId")); inp1.SetProperty("RequestType","ExternalValidate"); s1.InvokeMethod("SubmitRequest",inp1, Outputs); } catch(e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects inp1 = null; s1 = null; } }

AEC Auto Fix Tools SCM
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

AEC Auto Fix Tools SCM
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

AEC Auto Fix Tools SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var iReturn; try { oApp = TheApplication(); iReturn = CancelOperation; switch (MethodName) { case "AECAddComponentToActualInstance": AECAddComponentToActualInstance (Inputs, Outputs); break; case "AECAddComponentToInstance": AECAddComponentToInstance (Inputs, Outputs); break; case "AddItem": AECAddItem (Inputs, Outputs); break; case "RemoveComponent": AECRemoveComponent (Inputs, Outputs); break; case "AECValidateActualInstance": AECValidateActualInstance (Inputs, Outputs); break; case "AECRemoveComponentFromActualInstance": AECRemoveComponentFromActualInstance (Inputs, Outputs); break; case "AECPromptApply": AECPromptApply (Inputs, Outputs); break; case "AECPromptUndo": AECPromptUndo (Inputs, Outputs); break; case "AECAddToList": AECAddToList (Inputs, Outputs); break; case "AECUpdateDefaultDiscountsSCMinIntance": AECUpdateDefaultDiscountsSCMinIntance (Inputs, Outputs); break; case "AECUpdateDefaultDiscountsSCMinIntance2": AECUpdateDefaultDiscountsSCMinIntance2 (Inputs, Outputs); break; case "AECRemovePromotionItem": AECRemovePromotionItem (Inputs, Outputs); break; case "AECSetActiveJWS": AECSetActiveJWS(Inputs,Outputs); break; case "AECGetHeaderFields": getHeaderFields(Inputs,Outputs); break; case "AECSetHeaderFields": setHeaderFields(Inputs,Outputs); break; case "AECGetSubcomponents": AECGetSubcomponents(Inputs,Outputs); break; default: iReturn = ContinueOperation; break; } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects oApp = null; } return (iReturn); }

AEC Auto Fix Tools SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var iReturn; try { oApp = TheApplication(); iReturn = CancelOperation; switch (MethodName) { case "AECAddComponentToActualInstance": AECAddComponentToActualInstance (Inputs, Outputs); break; case "AECAddComponentToInstance": AECAddComponentToInstance (Inputs, Outputs); break; case "AddItem": AECAddItem (Inputs, Outputs); break; case "RemoveComponent": AECRemoveComponent (Inputs, Outputs); break; case "AECValidateActualInstance": AECValidateActualInstance (Inputs, Outputs); break; case "AECRemoveComponentFromActualInstance": AECRemoveComponentFromActualInstance (Inputs, Outputs); break; case "AECPromptApply": AECPromptApply (Inputs, Outputs); break; case "AECPromptUndo": AECPromptUndo (Inputs, Outputs); break; case "AECAddToList": AECAddToList (Inputs, Outputs); break; case "AECUpdateDefaultDiscountsSCMinIntance": AECUpdateDefaultDiscountsSCMinIntance (Inputs, Outputs); break; case "AECUpdateDefaultDiscountsSCMinIntance2": AECUpdateDefaultDiscountsSCMinIntance2 (Inputs, Outputs); break; case "AECRemovePromotionItem": AECRemovePromotionItem (Inputs, Outputs); break; case "AECSetActiveJWS": AECSetActiveJWS(Inputs,Outputs); break; case "AECGetHeaderFields": getHeaderFields(Inputs,Outputs); break; case "AECSetHeaderFields": setHeaderFields(Inputs,Outputs); break; case "AECGetSubcomponents": AECGetSubcomponents(Inputs,Outputs); break; default: iReturn = ContinueOperation; break; } } catch (e) { Outputs.SetProperty("AEC Operation Success", "N"); oApp.Trace(e.toString()); throw e; } finally { //Release Objects oApp = null; } return (iReturn); }

AEC Auto Fix Tools SCM
getHeaderFields
function getHeaderFields(Inputs,Outputs) { /* function to extract Header Fields from SIS OM Quote Message an return these fields as output property delimited by given delimiter. Inputs: SiebelMessage ... child property set containing SIS OM Quote Delimiter ... delimiter to be used for extracted field values FieldName N Quote Field[:Asset Field] Quote Header property with optional Asset property (if is not specified, Quote and Asset property should be same Outputs: Field Set .... list for Field=Value delimited by delimiter TAABIVA1 2015-10-19 Function Created */ var sDelimiter:chars=""; var psMessage:PropertySet; var sPropName:chars; var sFieldMapping:chars; var arFieldMapping:Array; var sFieldName:chars=""; var sFieldValue:chars="" var sNewFieldName:chars=""; var psHeader:PropertySet=null; var iIndex:float=0; var arOutList:Array=new Array(); try { if(Inputs.PropertyExists("Delimiter")) { sDelimiter=Inputs.GetProperty("Delimiter"); } else sDelimiter="~"; if(Inputs.GetChildCount()>0) { psMessage=Inputs.GetChild(0); } if(oApp.GetProfileAttr("PMC_HEADER_FIELD_LIST")!="") { // admin code value was specified, we will add these fields // as appendix to inpus starting from 999 arFieldMapping=oApp.GetProfileAttr("PMC_HEADER_FIELD_LIST").split("|"); for(iIndex=0;iIndex<arFieldMapping.length;iIndex++) { Inputs.SetProperty("FieldName " + iIndex+99, arFieldMapping[iIndex]); } } sPropName=Inputs.GetFirstProperty(); psHeader=psMessage.GetChild(0).GetChild(0); // .GetChild(0); do { if(sPropName.indexOf("FieldName")>=0) { // property is fieldmapping property, other props are ignored. if(Inputs.GetProperty(sPropName).indexOf(":")>0) { // cross property mapping found arFieldMapping=null; arFieldMapping=Inputs.GetProperty(sPropName).split(":"); sFieldName=arFieldMapping[0]; sNewFieldName=arFieldMapping[1]; } else { // same input and output property sFieldName=Inputs.GetProperty(sPropName); sNewFieldName=sFieldName; } // now read arOutList.push(sNewFieldName+"=" + psHeader.GetProperty(sFieldName)); // increment counter iIndex++; } sPropName=Inputs.GetNextProperty(); }while(sPropName!=""); Outputs.SetProperty("Field Set", arOutList.join(sDelimiter)); } finally { psMessage=null; arFieldMapping=null; arOutList=null; psHeader=null; } }

AEC Auto Fix Tools SCM
getHeaderFields
function getHeaderFields(Inputs,Outputs) { /* function to extract Header Fields from SIS OM Quote Message an return these fields as output property delimited by given delimiter. Inputs: SiebelMessage ... child property set containing SIS OM Quote Delimiter ... delimiter to be used for extracted field values FieldName N Quote Field[:Asset Field] Quote Header property with optional Asset property (if is not specified, Quote and Asset property should be same Outputs: Field Set .... list for Field=Value delimited by delimiter TAABIVA1 2015-10-19 Function Created */ var sDelimiter:chars=""; var psMessage:PropertySet; var sPropName:chars; var sFieldMapping:chars; var arFieldMapping:Array; var sFieldName:chars=""; var sFieldValue:chars="" var sNewFieldName:chars=""; var psHeader:PropertySet=null; var iIndex:float=0; var arOutList:Array=new Array(); try { if(Inputs.PropertyExists("Delimiter")) { sDelimiter=Inputs.GetProperty("Delimiter"); } else sDelimiter="~"; if(Inputs.GetChildCount()>0) { psMessage=Inputs.GetChild(0); } if(oApp.GetProfileAttr("PMC_HEADER_FIELD_LIST")!="") { // admin code value was specified, we will add these fields // as appendix to inpus starting from 999 arFieldMapping=oApp.GetProfileAttr("PMC_HEADER_FIELD_LIST").split("|"); for(iIndex=0;iIndex<arFieldMapping.length;iIndex++) { Inputs.SetProperty("FieldName " + iIndex+99, arFieldMapping[iIndex]); } } sPropName=Inputs.GetFirstProperty(); psHeader=psMessage.GetChild(0).GetChild(0); // .GetChild(0); do { if(sPropName.indexOf("FieldName")>=0) { // property is fieldmapping property, other props are ignored. if(Inputs.GetProperty(sPropName).indexOf(":")>0) { // cross property mapping found arFieldMapping=null; arFieldMapping=Inputs.GetProperty(sPropName).split(":"); sFieldName=arFieldMapping[0]; sNewFieldName=arFieldMapping[1]; } else { // same input and output property sFieldName=Inputs.GetProperty(sPropName); sNewFieldName=sFieldName; } // now read arOutList.push(sNewFieldName+"=" + psHeader.GetProperty(sFieldName)); // increment counter iIndex++; } sPropName=Inputs.GetNextProperty(); }while(sPropName!=""); Outputs.SetProperty("Field Set", arOutList.join(sDelimiter)); } finally { psMessage=null; arFieldMapping=null; arOutList=null; psHeader=null; } }

AEC Auto Fix Tools SCM
setHeaderFields
function setHeaderFields(Inputs,Outputs) { /* Function which applies list of given fields Inputs : SiebelMessage .... hierarchy with SIS OM Asset structure expected Delimiter .... delimiter for fields Field Set .... list of field=value delimiter by delimtier Outputs: SiebelMessage with Header modified TAABIVA1 2015-10-19 Function Created */ var psMessage:PropertySet; var sDelimiter:chars; var sFieldSet:chars=Inputs.GetProperty("Field Set"); var arFields:Array; var arField:Array; var iIndex:float; if(Inputs.PropertyExists("Delimiter")) sDelimiter=Inputs.GetProperty("Delimiter"); else sDelimiter="~"; try { if(Inputs.GetChildCount()>0) { psMessage=Inputs.GetChild(0); } if((psMessage!=null)&&(sFieldSet!=null)) { // convert input string to arFields=sFieldSet.split(sDelimiter); for(iIndex=0;iIndex<arFields.length;iIndex++) { arField=arFields[iIndex].split("="); if(arField[1]==null) arField[1]=""; psMessage.GetChild(0).GetChild(0).SetProperty(arField[0],arField[1]); } } } finally { Outputs.AddChild(psMessage.Copy()); arFields=null; arField=null; psMessage=null; } }

AEC Auto Fix Tools SCM
setHeaderFields
function setHeaderFields(Inputs,Outputs) { /* Function which applies list of given fields Inputs : SiebelMessage .... hierarchy with SIS OM Asset structure expected Delimiter .... delimiter for fields Field Set .... list of field=value delimiter by delimtier Outputs: SiebelMessage with Header modified TAABIVA1 2015-10-19 Function Created */ var psMessage:PropertySet; var sDelimiter:chars; var sFieldSet:chars=Inputs.GetProperty("Field Set"); var arFields:Array; var arField:Array; var iIndex:float; if(Inputs.PropertyExists("Delimiter")) sDelimiter=Inputs.GetProperty("Delimiter"); else sDelimiter="~"; try { if(Inputs.GetChildCount()>0) { psMessage=Inputs.GetChild(0); } if((psMessage!=null)&&(sFieldSet!=null)) { // convert input string to arFields=sFieldSet.split(sDelimiter); for(iIndex=0;iIndex<arFields.length;iIndex++) { arField=arFields[iIndex].split("="); if(arField[1]==null) arField[1]=""; psMessage.GetChild(0).GetChild(0).SetProperty(arField[0],arField[1]); } } } finally { Outputs.AddChild(psMessage.Copy()); arFields=null; arField=null; psMessage=null; } }

AEC Compatibility Query VBC SCM
(declarations)
var oApp:Application;

AEC Compatibility Query VBC SCM
(declarations)
var oApp:Application;

AEC Compatibility Query VBC SCM
Init
/***************************************************************************** * Function: Init * Purpose : Initializes the vBC *----------------------------------------------------------------------------* * History : * Date Name Description * ---------- -------- ---------------------------------------------------- * 2013-06-24 Thomas Trenkler created * 2013-09-12 Thomas Trenkler Added "AC" field (Action Code) * 2013-09-12 Thomas Trenkler Added "GCF" field (Gigabit Capable Flag) * 2014-03-21 Matthieu Hattab Added "AF" field (Application Filter) for Stargate Project May 2014 Release * 2014-04-01 Matthieu Hattab Added "CW" field (Capability WLAN) for Stargate Project May 2014 Release (CR16) * 2014-09-04 Vaclav Bittmann Added "AEC List Name" Field * 2014-11-18 Vaclav Bittmann Added CHRGUI, PSTACKSRC, Group Name * 2015-03-17 Adarsh Sharma Added new field 'Commitment Period SCM' for REQ_WP-0700_SBL-39047 * 2015-04-15 Vaclav Bittmann Added Retention Flag * 2015-05-27 Martin Jurko Added NAS, Dect for REQ_WP-775_SBL-41161:Add new Capabilities to E&C engine * 2015-06-05 Martin Jurko Added Object Action * 2015-06-05 Martin Jurko Added Subject Action, Capability Bonding * 2015-10-08 Martin Jurko Added Midrange Capable SCM * 2015-11-23 Pavel Kamir Added Account Segment SCM, Simple Pay Blocked SCM, Care Customer SCM for REQ_WP-1054_SBL-48197:Extend E&C Framework to Support new conditions * 2015-12-15 Vaclav Bittmann Added Activation Correction Flg * 2016-03-30 Nishant Singhal Added Status, Workspace for TTP-135 * 2016-07-06 Pavel Kamir Added Bonding Capacity and Bonding Availability *****************************************************************************/ function Init (Inputs, Outputs) { Outputs.SetProperty("Name", ""); Outputs.SetProperty("AFAction", ""); Outputs.SetProperty("Adjustment Group", ""); Outputs.SetProperty("Adjustment Group Id", ""); Outputs.SetProperty("Analyze", ""); Outputs.SetProperty("BbType", ""); Outputs.SetProperty("Chain", ""); Outputs.SetProperty("Channel", ""); Outputs.SetProperty("DefProdId", ""); Outputs.SetProperty("Effective End Date", ""); Outputs.SetProperty("Effective Start Date", ""); Outputs.SetProperty("Info", ""); Outputs.SetProperty("MAXDS", ""); Outputs.SetProperty("MAXUS", ""); Outputs.SetProperty("MDS", ""); Outputs.SetProperty("MUS", ""); Outputs.SetProperty("Matrix Rule Num", ""); Outputs.SetProperty("MaxAge", ""); Outputs.SetProperty("Message Id SCM", ""); Outputs.SetProperty("MinAge", ""); Outputs.SetProperty("OMaxQty", ""); Outputs.SetProperty("OMinQty", ""); Outputs.SetProperty("OPRID", ""); Outputs.SetProperty("OPromId", ""); Outputs.SetProperty("ORProdId", ""); Outputs.SetProperty("ORQO", ""); Outputs.SetProperty("Order", ""); Outputs.SetProperty("Path", ""); Outputs.SetProperty("PrePick", ""); Outputs.SetProperty("Product", ""); Outputs.SetProperty("Product Class", ""); Outputs.SetProperty("Product Class Id", ""); Outputs.SetProperty("Product Id", ""); Outputs.SetProperty("Product Line", ""); Outputs.SetProperty("Product Line Id", ""); Outputs.SetProperty("Rel Product", ""); Outputs.SetProperty("Rel Product Class", ""); Outputs.SetProperty("Rel Product Class Id", ""); Outputs.SetProperty("Rel Product Id", ""); Outputs.SetProperty("Rel Product Line", ""); Outputs.SetProperty("Rel Product Line Id", ""); Outputs.SetProperty("Router", ""); Outputs.SetProperty("SMaxQty", ""); Outputs.SetProperty("SMinQty", ""); Outputs.SetProperty("SPRID", ""); Outputs.SetProperty("SPromId", ""); Outputs.SetProperty("SRProdId", ""); Outputs.SetProperty("Scenario", ""); Outputs.SetProperty("Scope", ""); Outputs.SetProperty("Scope-LIC", ""); Outputs.SetProperty("Seq", ""); Outputs.SetProperty("Type", ""); Outputs.SetProperty("Type-LIC", ""); Outputs.SetProperty("Id", ""); Outputs.SetProperty("CRuleId", ""); Outputs.SetProperty("AC", ""); Outputs.SetProperty("GCF",

AEC Compatibility Query VBC SCM
Init
/***************************************************************************** * Function: Init * Purpose : Initializes the vBC *----------------------------------------------------------------------------* * History : * Date Name Description * ---------- -------- ---------------------------------------------------- * 2013-06-24 Thomas Trenkler created * 2013-09-12 Thomas Trenkler Added "AC" field (Action Code) * 2013-09-12 Thomas Trenkler Added "GCF" field (Gigabit Capable Flag) * 2014-03-21 Matthieu Hattab Added "AF" field (Application Filter) for Stargate Project May 2014 Release * 2014-04-01 Matthieu Hattab Added "CW" field (Capability WLAN) for Stargate Project May 2014 Release (CR16) * 2014-09-04 Vaclav Bittmann Added "AEC List Name" Field * 2014-11-18 Vaclav Bittmann Added CHRGUI, PSTACKSRC, Group Name * 2015-03-17 Adarsh Sharma Added new field 'Commitment Period SCM' for REQ_WP-0700_SBL-39047 * 2015-04-15 Vaclav Bittmann Added Retention Flag * 2015-05-27 Martin Jurko Added NAS, Dect for REQ_WP-775_SBL-41161:Add new Capabilities to E&C engine * 2015-06-05 Martin Jurko Added Object Action * 2015-06-05 Martin Jurko Added Subject Action, Capability Bonding * 2015-10-08 Martin Jurko Added Midrange Capable SCM * 2015-11-23 Pavel Kamir Added Account Segment SCM, Simple Pay Blocked SCM, Care Customer SCM for REQ_WP-1054_SBL-48197:Extend E&C Framework to Support new conditions * 2015-12-15 Vaclav Bittmann Added Activation Correction Flg * 2016-03-30 Nishant Singhal Added Status, Workspace for TTP-135 *****************************************************************************/ function Init (Inputs, Outputs) { Outputs.SetProperty("Name", ""); Outputs.SetProperty("AFAction", ""); Outputs.SetProperty("Adjustment Group", ""); Outputs.SetProperty("Adjustment Group Id", ""); Outputs.SetProperty("Analyze", ""); Outputs.SetProperty("BbType", ""); Outputs.SetProperty("Chain", ""); Outputs.SetProperty("Channel", ""); Outputs.SetProperty("DefProdId", ""); Outputs.SetProperty("Effective End Date", ""); Outputs.SetProperty("Effective Start Date", ""); Outputs.SetProperty("Info", ""); Outputs.SetProperty("MAXDS", ""); Outputs.SetProperty("MAXUS", ""); Outputs.SetProperty("MDS", ""); Outputs.SetProperty("MUS", ""); Outputs.SetProperty("Matrix Rule Num", ""); Outputs.SetProperty("MaxAge", ""); Outputs.SetProperty("Message Id SCM", ""); Outputs.SetProperty("MinAge", ""); Outputs.SetProperty("OMaxQty", ""); Outputs.SetProperty("OMinQty", ""); Outputs.SetProperty("OPRID", ""); Outputs.SetProperty("OPromId", ""); Outputs.SetProperty("ORProdId", ""); Outputs.SetProperty("ORQO", ""); Outputs.SetProperty("Order", ""); Outputs.SetProperty("Path", ""); Outputs.SetProperty("PrePick", ""); Outputs.SetProperty("Product", ""); Outputs.SetProperty("Product Class", ""); Outputs.SetProperty("Product Class Id", ""); Outputs.SetProperty("Product Id", ""); Outputs.SetProperty("Product Line", ""); Outputs.SetProperty("Product Line Id", ""); Outputs.SetProperty("Rel Product", ""); Outputs.SetProperty("Rel Product Class", ""); Outputs.SetProperty("Rel Product Class Id", ""); Outputs.SetProperty("Rel Product Id", ""); Outputs.SetProperty("Rel Product Line", ""); Outputs.SetProperty("Rel Product Line Id", ""); Outputs.SetProperty("Router", ""); Outputs.SetProperty("SMaxQty", ""); Outputs.SetProperty("SMinQty", ""); Outputs.SetProperty("SPRID", ""); Outputs.SetProperty("SPromId", ""); Outputs.SetProperty("SRProdId", ""); Outputs.SetProperty("Scenario", ""); Outputs.SetProperty("Scope", ""); Outputs.SetProperty("Scope-LIC", ""); Outputs.SetProperty("Seq", ""); Outputs.SetProperty("Type", ""); Outputs.SetProperty("Type-LIC", ""); Outputs.SetProperty("Id", ""); Outputs.SetProperty("CRuleId", ""); Outputs.SetProperty("AC", ""); Outputs.SetProperty("GCF", ""); Outputs.SetProperty("RF", ""); Outputs.SetProperty("OBbType", "");

AEC Compatibility Query VBC SCM
Query
/***************************************************************************** * Function: Query * Purpose : Querys for the corresponding Rules, this VBC is necessary as we use outer joins to join Rule condition attributes to the rule * as there can be more than one condition per rule, the corresponding record is duplicated but the cache will only fetch the attributes of the first * Condition, because the duplicated Rules have the same Id. This VBC is now generating a separate Id for each record by concatenating the Row Id of the * Rule Condition with the Row_Id of the Rule (VRId). *----------------------------------------------------------------------------* * History : * Date Name Description * ---------- -------- ---------------------------------------------------- * 2013-06-24 Thomas Trenkler created * 2013-09-12 Thomas Trenkler Added "AC" field (Action Code) * 2013-09-12 Thomas Trenkler Added "GCF" field (Gigabit Capable Flag) * 2014-03-21 Matthieu Hattab Added "AF" field (Application Filter) for Stargate Project May 2014 Release * 2014-04-01 Matthieu Hattab Added "CW" field (Capability WLAN) for Stargate Project May 2014 Release (CR16)$ * 2014-09-04 Vaclav Bittmann Added "AEC List Name" Field * 2014-11-18 Vaclav Bittmann Added CHRGUI, PSTACKSRC, Group Name * 2015-03-17 Adarsh Sharma Added new field 'Commitment Period SCM' for REQ_WP-0700_SBL-39047 * 2015-04-15 Vaclav Bittmann Added Retention Flag * 2015-05-27 Martin Jurko Added NAS, Dect for REQ_WP-775_SBL-41161:Add new Capabilities to E&C engine * 2015-06-05 Martin Jurko Added Object Action * 2015-10-08 Martin Jurko Added Midrange Capable SCM * 2015-11-23 Pavel Kamir Added Account Segment SCM, Simple Pay Blocked SCM, Care Customer SCM for REQ_WP-1054_SBL-48197:Extend E&C Framework to Support new conditions * 2015-12-15 Vaclav Bittmann Added Activation Correction Flg * 2016-03-30 Nishant Singhal Added Status, Workspace for TTP-135 * 2016-04-21 Vincenzo Barra Added Adoption TV Flag * 2016-07-06 Pavel Kamir Added Bonding Capacity and Bonding Availability *****************************************************************************/ function Query(Inputs, Outputs) { var lbcBusObject; var lbcBusComp; oApp = TheApplication(); var lsrecord; var row1; try { lbcBusObject = oApp.GetBusObject("Adjustment Group"); lbcBusComp = lbcBusObject.GetBusComp ("AEC Product Compatibility Condition Query SCM"); with (lbcBusComp) { SetViewMode(AllView); ClearToQuery(); SetSearchExpr(Inputs.GetProperty ("search-string")); ExecuteQuery (ForwardOnly); lsrecord=FirstRecord(); while(lsrecord) { row1=TheApplication().NewPropertySet (); row1.SetProperty("AFAction", GetFieldValue("AFAction")); row1.SetProperty("Adjustment Group", GetFieldValue("Adjustment Group")); row1.SetProperty("Adjustment Group Id", GetFieldValue("Adjustment Group Id")); row1.SetProperty("Analyze", GetFieldValue("Analyze")); row1.SetProperty("BbType", GetFieldValue("BbType")); row1.SetProperty("Chain", GetFieldValue("Chain")); row1.SetProperty("Channel", GetFieldValue("Channel")); row1.SetProperty("DefProdId", GetFieldValue("DefProdId")); row1.SetProperty("Effective End Date", GetFieldValue("Effective End Date")); row1.SetProperty("Effective Start Date", GetFieldValue("Effective Start Date")); row1.SetProperty("Info", GetFieldValue("Info")); row1.SetProperty("MAXDS", GetFieldValue("MAXDS")); row1.SetProperty("MAXUS", GetFieldValue("MAXUS")); row1.SetProperty("MDS", GetFieldValue("MDS")); row1.SetProperty("MUS", GetFieldValue("MUS")); row1.SetProperty("Matrix Rule Num", GetFieldValue("Matrix Rule Num")); row1.SetProperty("MaxAge", GetFieldValue("MaxAge")); row1.SetProperty("Message Id SCM", GetFieldValue("Message Id SCM")); row1.SetProperty("MinAge", GetFieldValue("MinAge")); row1.SetProperty("OM

AEC Compatibility Query VBC SCM
Query
/***************************************************************************** * Function: Query * Purpose : Querys for the corresponding Rules, this VBC is necessary as we use outer joins to join Rule condition attributes to the rule * as there can be more than one condition per rule, the corresponding record is duplicated but the cache will only fetch the attributes of the first * Condition, because the duplicated Rules have the same Id. This VBC is now generating a separate Id for each record by concatenating the Row Id of the * Rule Condition with the Row_Id of the Rule (VRId). *----------------------------------------------------------------------------* * History : * Date Name Description * ---------- -------- ---------------------------------------------------- * 2013-06-24 Thomas Trenkler created * 2013-09-12 Thomas Trenkler Added "AC" field (Action Code) * 2013-09-12 Thomas Trenkler Added "GCF" field (Gigabit Capable Flag) * 2014-03-21 Matthieu Hattab Added "AF" field (Application Filter) for Stargate Project May 2014 Release * 2014-04-01 Matthieu Hattab Added "CW" field (Capability WLAN) for Stargate Project May 2014 Release (CR16)$ * 2014-09-04 Vaclav Bittmann Added "AEC List Name" Field * 2014-11-18 Vaclav Bittmann Added CHRGUI, PSTACKSRC, Group Name * 2015-03-17 Adarsh Sharma Added new field 'Commitment Period SCM' for REQ_WP-0700_SBL-39047 * 2015-04-15 Vaclav Bittmann Added Retention Flag * 2015-05-27 Martin Jurko Added NAS, Dect for REQ_WP-775_SBL-41161:Add new Capabilities to E&C engine * 2015-06-05 Martin Jurko Added Object Action * 2015-10-08 Martin Jurko Added Midrange Capable SCM * 2015-11-23 Pavel Kamir Added Account Segment SCM, Simple Pay Blocked SCM, Care Customer SCM for REQ_WP-1054_SBL-48197:Extend E&C Framework to Support new conditions * 2015-12-15 Vaclav Bittmann Added Activation Correction Flg * 2016-03-30 Nishant Singhal Added Status, Workspace for TTP-135 * 2016-04-21 Vincenzo Barra Added Adoption TV Flag *****************************************************************************/ function Query(Inputs, Outputs) { var lbcBusObject; var lbcBusComp; oApp = TheApplication(); var lsrecord; var row1; try { lbcBusObject = oApp.GetBusObject("Adjustment Group"); lbcBusComp = lbcBusObject.GetBusComp ("AEC Product Compatibility Condition Query SCM"); with (lbcBusComp) { SetViewMode(AllView); ClearToQuery(); SetSearchExpr(Inputs.GetProperty ("search-string")); ExecuteQuery (ForwardOnly); lsrecord=FirstRecord(); while(lsrecord) { row1=TheApplication().NewPropertySet (); row1.SetProperty("AFAction", GetFieldValue("AFAction")); row1.SetProperty("Adjustment Group", GetFieldValue("Adjustment Group")); row1.SetProperty("Adjustment Group Id", GetFieldValue("Adjustment Group Id")); row1.SetProperty("Analyze", GetFieldValue("Analyze")); row1.SetProperty("BbType", GetFieldValue("BbType")); row1.SetProperty("Chain", GetFieldValue("Chain")); row1.SetProperty("Channel", GetFieldValue("Channel")); row1.SetProperty("DefProdId", GetFieldValue("DefProdId")); row1.SetProperty("Effective End Date", GetFieldValue("Effective End Date")); row1.SetProperty("Effective Start Date", GetFieldValue("Effective Start Date")); row1.SetProperty("Info", GetFieldValue("Info")); row1.SetProperty("MAXDS", GetFieldValue("MAXDS")); row1.SetProperty("MAXUS", GetFieldValue("MAXUS")); row1.SetProperty("MDS", GetFieldValue("MDS")); row1.SetProperty("MUS", GetFieldValue("MUS")); row1.SetProperty("Matrix Rule Num", GetFieldValue("Matrix Rule Num")); row1.SetProperty("MaxAge", GetFieldValue("MaxAge")); row1.SetProperty("Message Id SCM", GetFieldValue("Message Id SCM")); row1.SetProperty("MinAge", GetFieldValue("MinAge")); row1.SetProperty("OMaxQty", GetFieldValue("OMaxQty")); row1.SetProperty("OMinQty", GetField

AEC Compatibility Query VBC SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if (MethodName == "Init") { return(Init(Inputs, Outputs)); } else if (MethodName == "Query") { Query(Inputs, Outputs); return (CancelOperation); } else { return (ContinueOperation); } }

AEC Compatibility Query VBC SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if (MethodName == "Init") { return(Init(Inputs, Outputs)); } else if (MethodName == "Query") { Query(Inputs, Outputs); return (CancelOperation); } else { return (ContinueOperation); } }

AEC Log
Service_PreInvokeMethod
function Service_PreInvokeMethod(MethodName, Inputs, Outputs){ var oApp = TheApplication(); var bIsTraceOn = oApp.isTraceON; try{ if (MethodName == "LogString"){ var sFileString = Inputs.GetProperty("File"); var bWindows = oApp.GetProfileAttr("OPERATING_SYSTEM") == "WINDOWS"; // for dedicated client if(bWindows) sFileString = "C:" + sFileString.replace(/[\/]/g, "\\"); var sString = Inputs.GetProperty("String"); var file = Clib.fopen(sFileString, "at"); if(file != null){ Clib.fputs(sString + "\n", file); Clib.fclose(file); } else{ oApp.RaiseErrorText("File: " + sFileString + " could not be opened"); } } if (MethodName == "GetTime"){ var sProfileAttrName = Inputs.GetProperty("sProfileAttrNameCascade"); var now = new Date(); var timeStamp = now.toGMTString() + " " + now.getUTCMilliseconds(); TheApplication().SetProfileAttr(sProfileAttrName, timeStamp); } if (MethodName == "GetEndOfLine"){ TheApplication().SetProfileAttr("sEndOfLine","\n"); } return (CancelOperation); } catch (e){ // Trace error and ... var sError = e.toString(); if (this.bIsTraceOn) this.oApp.Trace(Name() + " -> Method Error: " + sError); // ... throw the error message back to the WF throw (e); } finally{ this.oApp = null; } }

AEC Log
Service_PreInvokeMethod
function Service_PreInvokeMethod(MethodName, Inputs, Outputs){ var oApp = TheApplication(); var bIsTraceOn = oApp.isTraceON; try{ if (MethodName == "LogString"){ var sFileString = Inputs.GetProperty("File"); var bWindows = oApp.GetProfileAttr("OPERATING_SYSTEM") == "WINDOWS"; // for dedicated client if(bWindows) sFileString = "C:" + sFileString.replace(/[\/]/g, "\\"); var sString = Inputs.GetProperty("String"); var file = Clib.fopen(sFileString, "at"); if(file != null){ Clib.fputs(sString + "\n", file); Clib.fclose(file); } else{ oApp.RaiseErrorText("File: " + sFileString + " could not be opened"); } } if (MethodName == "GetTime"){ var sProfileAttrName = Inputs.GetProperty("sProfileAttrNameCascade"); var now = new Date(); var timeStamp = now.toGMTString() + " " + now.getUTCMilliseconds(); TheApplication().SetProfileAttr(sProfileAttrName, timeStamp); } if (MethodName == "GetEndOfLine"){ TheApplication().SetProfileAttr("sEndOfLine","\n"); } return (CancelOperation); } catch (e){ // Trace error and ... var sError = e.toString(); if (this.bIsTraceOn) this.oApp.Trace(Name() + " -> Method Error: " + sError); // ... throw the error message back to the WF throw (e); } finally{ this.oApp = null; } }

AEC SPE Wrapper SCM
(declarations)
var oApp:Application; var bIsTraceOn:bool;

AEC SPE Wrapper SCM
(declarations)
var oApp:Application; var bIsTraceOn:bool;

AEC SPE Wrapper SCM
ApplyCfgActions
function ApplyCfgActions(Inputs,Outputs) { /* Method to execute actions against opened eCfg Sessions Inputs: SPE Sessions ... Row Set with SPE Session Identifiers and RootId ObjId ... ObjId of eCfg Session AEC Actions Row Set ... Row set with Actions to be aplied against sesions Context ... processing context Row Set .... full row set of existing quote SPE Use Case ... name of SPE Use case to be called SPE Context Id .... context id ( quote ID or any different uniq context id Workflow Process Name ... name of workflow process name to be called before Process : For each Session will be sent all actions and retuned */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var oPsSessions:PropertySet; var oPsActions:PropertySet; var oPsContext:PropertySet; var oPsRowSet:PropertySet; var sObjId:chars=Inputs.GetProperty("ObjId"); var sSpeContextId:chars=Inputs.GetProperty("SPE Context Id"); var sSpeUseCase:chars=Inputs.GetProperty("SPE Use Case"); var oPsSpeInp:PropertySet=oApp.NewPropertySet(); var oPsSpeOut:PropertySet=oApp.NewPropertySet(); var sWfName:chars=Inputs.GetProperty("Workflow Process Name"); var oSpeService:Service=oApp.GetService("EAI SPE Caller SCM"); var iChild:float; var iChildCount:float=Inputs.GetChildCount(); var sReqTmpl:chars; try { // first load proper inputs for(iChild=0;iChild<iChildCount;iChild++) { switch(Inputs.GetChild(iChild).GetType()) { case "SPE Sessions": oPsSessions=Inputs.GetChild(iChild); break; case "AEC Actions Row Set": oPsActions=Inputs.GetChild(iChild); break; case "Context": oPsContext=Inputs.GetChild(iChild); break; case "Row Set": oPsRowSet=Inputs.GetChild(iChild); break; } } // start building inputs for SPE Service with(oPsSpeInp) { SetProperty("ContextId",sSpeContextId); SetProperty("UseCase",sSpeUseCase); // now common arguments for all threads oPsContext.SetType("Req_Context"); AddChild(oPsContext); oPsActions.SetType("Req_Row Set"); AddChild(oPsActions); oPsRowSet.SetType("Req_Full Row Set"); AddChild(oPsRowSet); } // now configure each request Individually iChildCount=oPsSessions.GetChildCount(); for(iChild=1;iChild<=iChildCount;iChild++) { sReqTmpl="Req"+iChild; oPsSpeInp.SetProperty(sReqTmpl+"_SessionId",oPsSessions.GetChild(iChild-1).GetProperty("SessionId")); oPsSpeInp.SetProperty(sReqTmpl+"_RootId",oPsSessions.GetChild(iChild-1).GetProperty("RootId")); oPsSpeInp.SetProperty(sReqTmpl+"_BusSvcName","Workflow Process Manager"); oPsSpeInp.SetProperty(sReqTmpl+"_BusSvcMethod","RunProcess"); oPsSpeInp.SetProperty(sReqTmpl+"_ProcessName",sWfName); oPsSpeInp.SetProperty("Req_ObjId",sObjId); } // execute SPE Request oSpeService.InvokeMethod("ExecuteStatefulRequest",oPsSpeInp,oPsSpeOut); oPsSpeOut.SetType("SPE Response"); Outputs.AddChild(oPsSpeOut); } catch(e) { if(bIsTraceOn) { oApp.Trace("AEC SPE Wrapper SCM->SPE Request Error: " + e.toString()); } Outputs.SetProperty("Error Message", e.toString()); Outputs.SetProperty("Error Flag","Y"); } finally { oPsSpeInp=null; oPsSpeOut=null; oPsSessions=null; oPsActions=null; oPsContext=null; oPsRowSet=null; oSpeService=null; oApp=null; } }

AEC SPE Wrapper SCM
ApplyCfgActions
function ApplyCfgActions(Inputs,Outputs) { /* Method to execute actions against opened eCfg Sessions Inputs: SPE Sessions ... Row Set with SPE Session Identifiers and RootId ObjId ... ObjId of eCfg Session AEC Actions Row Set ... Row set with Actions to be aplied against sesions Context ... processing context Row Set .... full row set of existing quote SPE Use Case ... name of SPE Use case to be called SPE Context Id .... context id ( quote ID or any different uniq context id Workflow Process Name ... name of workflow process name to be called before Process : For each Session will be sent all actions and retuned */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var oPsSessions:PropertySet; var oPsActions:PropertySet; var oPsContext:PropertySet; var oPsRowSet:PropertySet; var sObjId:chars=Inputs.GetProperty("ObjId"); var sSpeContextId:chars=Inputs.GetProperty("SPE Context Id"); var sSpeUseCase:chars=Inputs.GetProperty("SPE Use Case"); var oPsSpeInp:PropertySet=oApp.NewPropertySet(); var oPsSpeOut:PropertySet=oApp.NewPropertySet(); var sWfName:chars=Inputs.GetProperty("Workflow Process Name"); var oSpeService:Service=oApp.GetService("EAI SPE Caller SCM"); var iChild:float; var iChildCount:float=Inputs.GetChildCount(); var sReqTmpl:chars; try { // first load proper inputs for(iChild=0;iChild<iChildCount;iChild++) { switch(Inputs.GetChild(iChild).GetType()) { case "SPE Sessions": oPsSessions=Inputs.GetChild(iChild); break; case "AEC Actions Row Set": oPsActions=Inputs.GetChild(iChild); break; case "Context": oPsContext=Inputs.GetChild(iChild); break; case "Row Set": oPsRowSet=Inputs.GetChild(iChild); break; } } // start building inputs for SPE Service with(oPsSpeInp) { SetProperty("ContextId",sSpeContextId); SetProperty("UseCase",sSpeUseCase); // now common arguments for all threads oPsContext.SetType("Req_Context"); AddChild(oPsContext); oPsActions.SetType("Req_Row Set"); AddChild(oPsActions); oPsRowSet.SetType("Req_Full Row Set"); AddChild(oPsRowSet); } // now configure each request Individually iChildCount=oPsSessions.GetChildCount(); for(iChild=1;iChild<=iChildCount;iChild++) { sReqTmpl="Req"+iChild; oPsSpeInp.SetProperty(sReqTmpl+"_SessionId",oPsSessions.GetChild(iChild-1).GetProperty("SessionId")); oPsSpeInp.SetProperty(sReqTmpl+"_RootId",oPsSessions.GetChild(iChild-1).GetProperty("RootId")); oPsSpeInp.SetProperty(sReqTmpl+"_BusSvcName","Workflow Process Manager"); oPsSpeInp.SetProperty(sReqTmpl+"_BusSvcMethod","RunProcess"); oPsSpeInp.SetProperty(sReqTmpl+"_ProcessName",sWfName); oPsSpeInp.SetProperty("Req_ObjId",sObjId); } // execute SPE Request oSpeService.InvokeMethod("ExecuteStatefulRequest",oPsSpeInp,oPsSpeOut); oPsSpeOut.SetType("SPE Response"); Outputs.AddChild(oPsSpeOut); } catch(e) { if(bIsTraceOn) { oApp.Trace("AEC SPE Wrapper SCM->SPE Request Error: " + e.toString()); } Outputs.SetProperty("Error Message", e.toString()); Outputs.SetProperty("Error Flag","Y"); } finally { oPsSpeInp=null; oPsSpeOut=null; oPsSessions=null; oPsActions=null; oPsContext=null; oPsRowSet=null; oSpeService=null; oApp=null; } }

AEC SPE Wrapper SCM
ApplyVarMap
function ApplyVarMap(Inputs,Outputs) { /* Inputs : Row Set ... orig, flatenized row Set Varmap Def ... Hierarchy variable Map definition Output Type ... Output type definition Context Sequence ... Quote,Any (No Spaces) Outputs : Var Map Expr ... string containg translated variable map to expression {Output Row Set} += New('Line Item', [Varible Name]={Row.Source Property}, [Variable Name]=GetProfileAttr('Prof Attr Name'), [Variable Name]=SystemPreference('')) for each row Contexts will be processed depending on sequence in inputs */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var sOutType:chars=Inputs.GetProperty("Output Type"); var sContextSeq:chars=Inputs.GetProperty("Context Sequence"); var sExplicitMapping:chars = Inputs.GetProperty("Explicit Mapping"); var sOutput:chars="{Output Row Set} += New('"; var oPsRowSet:PropertySet; var oPsVarMap:PropertySet; var oPsMapped:PropertySet=oApp.NewPropertySet(); var oPsMap:PropertySet; var iChild:float; var iChildCount:float; var iContext:float; var arMapping:Array; var arContexts:Array; try { iChildCount=Inputs.GetChildCount(); for(iChild=0;iChild<iChildCount;iChild++) { switch(Inputs.GetChild(iChild).GetType()) { case "Row Set": oPsRowSet=Inputs.GetChild(iChild); break; case "Varmap Def": oPsVarMap=Inputs.GetChild(iChild); break; } } arContexts=sContextSeq.split(","); if(sExplicitMapping!=null&&sExplicitMapping!="" ) { sOutput=sOutput+"," + sExplicitMapping; } for(iContext=0;iContext<arContexts.length;iContext++) { iChildCount=oPsVarMap.GetChildCount(); for(iChild=0;iChild<iChildCount;iChild++) { oPsMap=oPsVarMap.GetChild(iChild); if(oPsMap.GetProperty("Mode")==arContexts[iContext]) { // check if property was mapped if(!oPsMapped.PropertyExists(oPsMap.GetProperty("Var Name"))) { switch(oPsMap.GetProperty("Source Type")) { case "Instance": // instance field is last element after splitting with / arMapping=oPsMap.GetProperty("Path").split("/"); sOutput=sOutput+", ["+ oPsMap.GetProperty("Var Name") + "]={Row."+ arMapping[arMapping.length-1] + "}"; oPsMapped.SetProperty(oPsMap.GetProperty("Var Name"),"Y"); break; case "Profile Attribute": sOutput=sOutput+", ["+ oPsMap.GetProperty("Var Name") + "]=GetProfileAttr('"+ oPsMap.GetProperty("Path") + "')"; oPsMapped.SetProperty(oPsMap.GetProperty("Var Name"),"Y"); break; case "System Preference": sOutput=sOutput+", ["+ oPsMap.GetProperty("Var Name") + "]=SystemPreference('"+ oPsMap.GetProperty("Path") + "')"; oPsMapped.SetProperty(oPsMap.GetProperty("Var Name"),"Y"); break; } // switch } // if } // if } // for varmap contetnt } // for contexts sOutput= sOutput + " )"; Outputs.SetProperty("PSP Expression", sOutput); } catch(e) { if(bIsTraceOn) { oApp.Trace("AEC SPE Wrapper SCM->SPE Request Error: " + e.toString()); } Outputs.SetProperty("Error Flag","Y"); } finally { oPsMapped=null; arMapping=null; arContexts=null; oPsMap=null; oPsRowSet=null; oPsVarMap=null; oApp=null; } }

AEC SPE Wrapper SCM
ApplyVarMap
function ApplyVarMap(Inputs,Outputs) { /* Inputs : Row Set ... orig, flatenized row Set Varmap Def ... Hierarchy variable Map definition Output Type ... Output type definition Context Sequence ... Quote,Any (No Spaces) Outputs : Var Map Expr ... string containg translated variable map to expression {Output Row Set} += New('Line Item', [Varible Name]={Row.Source Property}, [Variable Name]=GetProfileAttr('Prof Attr Name'), [Variable Name]=SystemPreference('')) for each row Contexts will be processed depending on sequence in inputs */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var sOutType:chars=Inputs.GetProperty("Output Type"); var sContextSeq:chars=Inputs.GetProperty("Context Sequence"); var sExplicitMapping:chars = Inputs.GetProperty("Explicit Mapping"); var sOutput:chars="{Output Row Set} += New('"; var oPsRowSet:PropertySet; var oPsVarMap:PropertySet; var oPsMapped:PropertySet=oApp.NewPropertySet(); var oPsMap:PropertySet; var iChild:float; var iChildCount:float; var iContext:float; var arMapping:Array; var arContexts:Array; try { iChildCount=Inputs.GetChildCount(); for(iChild=0;iChild<iChildCount;iChild++) { switch(Inputs.GetChild(iChild).GetType()) { case "Row Set": oPsRowSet=Inputs.GetChild(iChild); break; case "Varmap Def": oPsVarMap=Inputs.GetChild(iChild); break; } } arContexts=sContextSeq.split(","); if(sExplicitMapping!=null&&sExplicitMapping!="" ) { sOutput=sOutput+"," + sExplicitMapping; } for(iContext=0;iContext<arContexts.length;iContext++) { iChildCount=oPsVarMap.GetChildCount(); for(iChild=0;iChild<iChildCount;iChild++) { oPsMap=oPsVarMap.GetChild(iChild); if(oPsMap.GetProperty("Mode")==arContexts[iContext]) { // check if property was mapped if(!oPsMapped.PropertyExists(oPsMap.GetProperty("Var Name"))) { switch(oPsMap.GetProperty("Source Type")) { case "Instance": // instance field is last element after splitting with / arMapping=oPsMap.GetProperty("Path").split("/"); sOutput=sOutput+", ["+ oPsMap.GetProperty("Var Name") + "]={Row."+ arMapping[arMapping.length-1] + "}"; oPsMapped.SetProperty(oPsMap.GetProperty("Var Name"),"Y"); break; case "Profile Attribute": sOutput=sOutput+", ["+ oPsMap.GetProperty("Var Name") + "]=GetProfileAttr('"+ oPsMap.GetProperty("Path") + "')"; oPsMapped.SetProperty(oPsMap.GetProperty("Var Name"),"Y"); break; case "System Preference": sOutput=sOutput+", ["+ oPsMap.GetProperty("Var Name") + "]=SystemPreference('"+ oPsMap.GetProperty("Path") + "')"; oPsMapped.SetProperty(oPsMap.GetProperty("Var Name"),"Y"); break; } // switch } // if } // if } // for varmap contetnt } // for contexts sOutput= sOutput + " )"; Outputs.SetProperty("PSP Expression", sOutput); } catch(e) { if(bIsTraceOn) { oApp.Trace("AEC SPE Wrapper SCM->SPE Request Error: " + e.toString()); } Outputs.SetProperty("Error Flag","Y"); } finally { oPsMapped=null; arMapping=null; arContexts=null; oPsMap=null; oPsRowSet=null; oPsVarMap=null; oApp=null; } }

AEC SPE Wrapper SCM
CopyInp
function CopyInp(Inputs:PropertySet, Output:PropertySet, sOrigPrefix:chars, sNewPrefix:chars) { /* function will copy input properties from Input to Output PS and will rename them from sOrigPrefix to sNewPrefix Same will be done with child property sets Example : Input Property Scoring_Foo will be renamed to Req1_Foo 2015-09-25 TAABIVA1 Added loop for cycling by propertz set list */ var sPropName:chars=""; var iTargCount:float=0; var iPropInd:float=0; var sPropElem:Array; var psTmp:PropertySet; var arPaList:Array; var i:float=0; sPropName=Inputs.GetFirstProperty(); iTargCount=Inputs.GetPropertyCount(); for(iPropInd=0;iPropInd<iTargCount;iPropInd++) { sPropElem=sPropName.split("_"); if(sPropElem[0]==sOrigPrefix) { sPropElem[0]=sNewPrefix; Output.SetProperty(sPropElem.join("_") ,Inputs.GetProperty(sPropName)); } sPropName=Inputs.GetNextProperty(); } iTargCount=Inputs.GetChildCount(); for(iPropInd=0;iPropInd<iTargCount;iPropInd++) { sPropName=Inputs.GetChild(iPropInd).GetType(); sPropElem=sPropName.split("_"); if(sPropElem[0]==sOrigPrefix) { sPropElem[0]=sNewPrefix; psTmp=Inputs.GetChild(iPropInd).Copy(); psTmp.SetType(sPropElem.join("_")); Output.AddChild(psTmp); } } // now copy profile attributes to each request if((Inputs.GetProperty("PA")!="") && (Inputs.GetProperty("PA")!=null) && (sOrigPrefix!="Common")) { // profile attrs are spefied on input arPaList=Inputs.GetProperty("PA").split(","); for(i=0;i<arPaList.length;i++) { Output.SetProperty(sNewPrefix + "_PA_" + arPaList[i], oApp.GetProfileAttr(arPaList[i])); } } arPaList=null; sPropElem=null; psTmp=null; }

AEC SPE Wrapper SCM
CopyInp
function CopyInp(Inputs:PropertySet, Output:PropertySet, sOrigPrefix:chars, sNewPrefix:chars) { /* function will copy input properties from Input to Output PS and will rename them from sOrigPrefix to sNewPrefix Same will be done with child property sets Example : Input Property Scoring_Foo will be renamed to Req1_Foo 2015-09-25 TAABIVA1 Added loop for cycling by propertz set list */ var sPropName:chars=""; var iTargCount:float=0; var iPropInd:float=0; var sPropElem:Array; var psTmp:PropertySet; var arPaList:Array; var i:float=0; sPropName=Inputs.GetFirstProperty(); iTargCount=Inputs.GetPropertyCount(); for(iPropInd=0;iPropInd<iTargCount;iPropInd++) { sPropElem=sPropName.split("_"); if(sPropElem[0]==sOrigPrefix) { sPropElem[0]=sNewPrefix; Output.SetProperty(sPropElem.join("_") ,Inputs.GetProperty(sPropName)); } sPropName=Inputs.GetNextProperty(); } iTargCount=Inputs.GetChildCount(); for(iPropInd=0;iPropInd<iTargCount;iPropInd++) { sPropName=Inputs.GetChild(iPropInd).GetType(); sPropElem=sPropName.split("_"); if(sPropElem[0]==sOrigPrefix) { sPropElem[0]=sNewPrefix; psTmp=Inputs.GetChild(iPropInd).Copy(); psTmp.SetType(sPropElem.join("_")); Output.AddChild(psTmp); } } // now copy profile attributes to each request if((Inputs.GetProperty("PA")!="") && (Inputs.GetProperty("PA")!=null) && (sOrigPrefix!="Common")) { // profile attrs are spefied on input arPaList=Inputs.GetProperty("PA").split(","); for(i=0;i<arPaList.length;i++) { Output.SetProperty(sNewPrefix + "_PA_" + arPaList[i], oApp.GetProfileAttr(arPaList[i])); } } arPaList=null; sPropElem=null; psTmp=null; }

AEC SPE Wrapper SCM
CreateNewRoots
function CreateNewRoots(Inputs,Outputs) { /* function will generate new SPE Session for each root to be created and then call workflow, which will create new root item. Inputs: Row Set .... contains product IDs to be created Context .... processing context, will be sent to child workflow ObjId .... quote header identifier to be used SPE Use Case ... Use Case for SPE Caller Service SPE Context Id ... Context Id for SPE Caller logs Workflow Process Name ... name of Workflow to be exexuted for root creation ... process must return RootId property for newly created root item Outputs: SPE Sessions ... row set containing newly created sessions with SessionId and RootId to be merged with existing sessions for whole process */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var sSpeUseCase:chars = Inputs.GetProperty("SPE Use Case"); var sSpeContextId:chars = Inputs.GetProperty("SPE Context Id"); var sObjId:chars = Inputs.GetProperty("ObjId"); var sWfName:chars = Inputs.GetProperty("Workflow Process Name"); var oPsRowSet:PropertySet; var oPsContext:PropertySet; var oPsSpeInp:PropertySet=oApp.NewPropertySet(); var oPsSpeOut:PropertySet=oApp.NewPropertySet(); var oSpeService:Service=oApp.GetService("EAI SPE Caller SCM"); var oPsQteHeader:PropertySet; var oPsFullRs:PropertySet; var iChild:float; var iChildCount:float=Inputs.GetChildCount(); var sReqTmpl:chars; var oPsSession:PropertySet; var oPsSessions:PropertySet; var oPsRowSetParam:PropertySet; var oPsContextParam:PropertySet; try { for(iChild=0;iChild<iChildCount;iChild++) { switch(Inputs.GetChild(iChild).GetType()) { case "Row Set": oPsRowSet=Inputs.GetChild(iChild); break; case "Context": oPsContext=Inputs.GetChild(iChild); break; case "Quote Header": oPsQteHeader=Inputs.GetChild(iChild); break; case "Full Row Set": oPsFullRs=Inputs.GetChild(iChild); } } // we will request new SPE Session for each Row iChildCount=oPsRowSet.GetChildCount(); oPsSpeInp.SetProperty("UseCase",sSpeUseCase); oPsSpeInp.SetProperty("NumberOfSessions",iChildCount); oPsSpeInp.SetProperty("ContextId",sSpeContextId); oSpeService.InvokeMethod("GetStatefulSessions",oPsSpeInp,oPsSpeOut); // now attach each session to Row Set for(iChild=1;iChild<=iChildCount;iChild++) { oPsRowSet.GetChild(iChild-1).SetProperty("SessionId",oPsSpeOut.GetProperty("SessionId"+iChild)); } // now prepare main call for SPE Session to launch target Workflow oPsSpeInp.Reset(); oPsSpeOut.Reset(); // generic SPE Call Setup oPsSpeInp.SetProperty("UseCase",sSpeUseCase); oPsSpeInp.SetProperty("NumberOfSessions",iChildCount); oPsSpeInp.SetProperty("ContextId",sSpeContextId); oPsSpeInp.SetProperty("Req_ObjId",sObjId); // and now prepare context shared argument oPsContextParam=oPsContext.Copy(); oPsContextParam.SetType("Req_Context"); oPsSpeInp.AddChild(oPsContextParam); oPsQteHeader.SetType("Req_Quote Header"); oPsSpeInp.AddChild(oPsQteHeader); oPsFullRs.SetType("Req_Full Row Set"); oPsSpeInp.AddChild(oPsFullRs); // and request details for(iChild=0;iChild<iChildCount;iChild++) { sReqTmpl="Req" + ToString(iChild+1); oPsSpeInp.SetProperty(sReqTmpl+"_SessionId", oPsRowSet.GetChild(iChild).GetProperty("SessionId")); oPsSpeInp.SetProperty(sReqTmpl+"_BusSvcName","Workflow Process Manager"); oPsSpeInp.SetProperty(sReqTmpl+"_BusSvcMethod","RunProcess"); oPsSpeInp.SetProperty(sReqTmpl+"_ProcessName",sWfName); // and now Structures oPsRowSetParam=oApp.NewPropertySet(); oPsRowSetParam.SetType(sReqTmpl+"_Row Set"); oPsRowSetParam.AddChild(oPsRowSet.GetChild(iChild)); oPsSpeInp.AddChild(oPsRowSetParam); } // physical call to SPE // copy of Input is passed because SPE Service modifies property Set provided by reference oSpeService.InvokeMethod("ExecuteStatefulRequest",oPsSpeInp,oPsSpeOu

AEC SPE Wrapper SCM
CreateNewRoots
function CreateNewRoots(Inputs,Outputs) { /* function will generate new SPE Session for each root to be created and then call workflow, which will create new root item. Inputs: Row Set .... contains product IDs to be created Context .... processing context, will be sent to child workflow ObjId .... quote header identifier to be used SPE Use Case ... Use Case for SPE Caller Service SPE Context Id ... Context Id for SPE Caller logs Workflow Process Name ... name of Workflow to be exexuted for root creation ... process must return RootId property for newly created root item Outputs: SPE Sessions ... row set containing newly created sessions with SessionId and RootId to be merged with existing sessions for whole process */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var sSpeUseCase:chars = Inputs.GetProperty("SPE Use Case"); var sSpeContextId:chars = Inputs.GetProperty("SPE Context Id"); var sObjId:chars = Inputs.GetProperty("ObjId"); var sWfName:chars = Inputs.GetProperty("Workflow Process Name"); var oPsRowSet:PropertySet; var oPsContext:PropertySet; var oPsSpeInp:PropertySet=oApp.NewPropertySet(); var oPsSpeOut:PropertySet=oApp.NewPropertySet(); var oSpeService:Service=oApp.GetService("EAI SPE Caller SCM"); var oPsQteHeader:PropertySet; var oPsFullRs:PropertySet; var iChild:float; var iChildCount:float=Inputs.GetChildCount(); var sReqTmpl:chars; var oPsSession:PropertySet; var oPsSessions:PropertySet; var oPsRowSetParam:PropertySet; var oPsContextParam:PropertySet; try { for(iChild=0;iChild<iChildCount;iChild++) { switch(Inputs.GetChild(iChild).GetType()) { case "Row Set": oPsRowSet=Inputs.GetChild(iChild); break; case "Context": oPsContext=Inputs.GetChild(iChild); break; case "Quote Header": oPsQteHeader=Inputs.GetChild(iChild); break; case "Full Row Set": oPsFullRs=Inputs.GetChild(iChild); } } // we will request new SPE Session for each Row iChildCount=oPsRowSet.GetChildCount(); oPsSpeInp.SetProperty("UseCase",sSpeUseCase); oPsSpeInp.SetProperty("NumberOfSessions",iChildCount); oPsSpeInp.SetProperty("ContextId",sSpeContextId); oSpeService.InvokeMethod("GetStatefulSessions",oPsSpeInp,oPsSpeOut); // now attach each session to Row Set for(iChild=1;iChild<=iChildCount;iChild++) { oPsRowSet.GetChild(iChild-1).SetProperty("SessionId",oPsSpeOut.GetProperty("SessionId"+iChild)); } // now prepare main call for SPE Session to launch target Workflow oPsSpeInp.Reset(); oPsSpeOut.Reset(); // generic SPE Call Setup oPsSpeInp.SetProperty("UseCase",sSpeUseCase); oPsSpeInp.SetProperty("NumberOfSessions",iChildCount); oPsSpeInp.SetProperty("ContextId",sSpeContextId); oPsSpeInp.SetProperty("Req_ObjId",sObjId); // and now prepare context shared argument oPsContextParam=oPsContext.Copy(); oPsContextParam.SetType("Req_Context"); oPsSpeInp.AddChild(oPsContextParam); oPsQteHeader.SetType("Req_Quote Header"); oPsSpeInp.AddChild(oPsQteHeader); oPsFullRs.SetType("Req_Full Row Set"); oPsSpeInp.AddChild(oPsFullRs); // and request details for(iChild=0;iChild<iChildCount;iChild++) { sReqTmpl="Req" + ToString(iChild+1); oPsSpeInp.SetProperty(sReqTmpl+"_SessionId", oPsRowSet.GetChild(iChild).GetProperty("SessionId")); oPsSpeInp.SetProperty(sReqTmpl+"_BusSvcName","Workflow Process Manager"); oPsSpeInp.SetProperty(sReqTmpl+"_BusSvcMethod","RunProcess"); oPsSpeInp.SetProperty(sReqTmpl+"_ProcessName",sWfName); // and now Structures oPsRowSetParam=oApp.NewPropertySet(); oPsRowSetParam.SetType(sReqTmpl+"_Row Set"); oPsRowSetParam.AddChild(oPsRowSet.GetChild(iChild)); oPsSpeInp.AddChild(oPsRowSetParam); } // physical call to SPE // copy of Input is passed because SPE Service modifies property Set provided by reference oSpeService.InvokeMethod("ExecuteStatefulRequest",oPsSpeInp,oPsSpeOu

AEC SPE Wrapper SCM
GetSessions
function GetSessions(Inputs,Outputs) { /* function for calling statefull sessions on SPE and which will apply delta between eCfg Session between Current Asset and eCfg State asset Inputs: SPE Use Case ... name of SPE Use case to be called SPE Context Id .... context id ( quote ID or any different uniq context id ObjId ... shared argument to address eCfg sessions Root Sessions .... hierarchy (Row Set ) containing list of Session Handles, Callback URL and RootId to Address session Current Assets ... property set containing child SIS OM Messages in state before each eCfg session Workflow Process Name ... name of workflow process name to be called before Init Sessions .... debugging argument, Y means that Root Sessions will be populated with data instead of inputed Asset Id Root Field .... Property name on header level to be used for geting proper RootId for eCfg Session mapping DestroySessions .... optional for debugging purposes to be able destroy all SPE Sessions */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var sSpeUseCase:chars = Inputs.GetProperty("SPE Use Case"); var sSpeContextId:chars = Inputs.GetProperty("SPE Context Id"); var sObjId:chars = Inputs.GetProperty("ObjId"); var sWfName:chars = Inputs.GetProperty("Workflow Process Name"); var sInitSessions:chars = Inputs.GetProperty("Init Sessions"); var sRootIdProp:chars = Inputs.GetProperty("Asset Id Root Field"); var sDestroySess:chars = Inputs.GetProperty("DestroySessions"); var oSessions:PropertySet; var oCurrAssets:PropertySet; var oSpeInp:PropertySet=oApp.NewPropertySet(); var oSpeOut:PropertySet=oApp.NewPropertySet(); var oPsActions:PropertySet=null; var oPsContext:PropertySet=null; var oPsRowSet:PropertySet=null; var oSpeService:Service=oApp.GetService("EAI SPE Caller SCM"); var oSession:PropertySet; var iChildCount:float=Inputs.GetChildCount(); var sReqTmpl:chars=""; var iChild; var iAssCount:float=0; var iAss:float; var bFound:bool=false; var sChar1:chars; var sChar2:chars; // first load proper inputs try { for(iChild=0;iChild<iChildCount;iChild++) { switch(Inputs.GetChild(iChild).GetType()) { case "Root Sessions": oSessions=Inputs.GetChild(iChild); break; case "Current Assets": oCurrAssets=Inputs.GetChild(iChild); iAssCount=oCurrAssets.GetChildCount(); break; case "AEC Actions Row Set": oPsActions=Inputs.GetChild(iChild); break; case "Context": oPsContext=Inputs.GetChild(iChild); break; case "Row Set": oPsRowSet=Inputs.GetChild(iChild); break; } } if(oSessions==null) { oSessions=oApp.NewPropertySet(); } iChildCount=oSessions.GetChildCount(); // first we have to handle opening of SPE Sessions, if they are missing if(iChildCount==0) { // get set of provided assets iChildCount=oCurrAssets.GetChildCount(); // oSpeInp=oApp.NewPropertySet(); // oSpeOut=oApp.NewPropertySet(); // set SPE Broker Request oSpeInp.SetProperty("ContextId",sSpeContextId); oSpeInp.SetProperty("UseCase",sSpeUseCase); oSpeInp.SetProperty("NumberOfSessions",iChildCount); oSpeService.InvokeMethod("GetStatefulSessions",oSpeInp,oSpeOut); for(iChild=1;iChild<=iChildCount;iChild++) { // build own row set with root-session mapping oSession=oApp.NewPropertySet(); // oSession.SetProperty("CallbackURL",oSpeOut.GetProperty("CallbackURL")); oSession.SetProperty("SessionId",oSpeOut.GetProperty("SessionId"+iChild)); oSession.SetProperty("RootId",oCurrAssets.GetChild(iChild-1).GetProperty(sRootIdProp)); oSession.SetType("SPE Session"); oSessions.AddChild(oSession); } oSpeInp.Reset(); oSpeOut.Reset(); } // we assume, that all sessions are prepared .... we can call WF in paralel with each session with(oSpeInp) { SetProperty("ContextId",sSpeContextId); SetProperty("UseCase",sSpeUseCase); if(oPsContext!=null) { oPsContext.SetTyp

AEC SPE Wrapper SCM
GetSessions
function GetSessions(Inputs,Outputs) { /* function for calling statefull sessions on SPE and which will apply delta between eCfg Session between Current Asset and eCfg State asset Inputs: SPE Use Case ... name of SPE Use case to be called SPE Context Id .... context id ( quote ID or any different uniq context id ObjId ... shared argument to address eCfg sessions Root Sessions .... hierarchy (Row Set ) containing list of Session Handles, Callback URL and RootId to Address session Current Assets ... property set containing child SIS OM Messages in state before each eCfg session Workflow Process Name ... name of workflow process name to be called before Init Sessions .... debugging argument, Y means that Root Sessions will be populated with data instead of inputed Asset Id Root Field .... Property name on header level to be used for geting proper RootId for eCfg Session mapping DestroySessions .... optional for debugging purposes to be able destroy all SPE Sessions */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var sSpeUseCase:chars = Inputs.GetProperty("SPE Use Case"); var sSpeContextId:chars = Inputs.GetProperty("SPE Context Id"); var sObjId:chars = Inputs.GetProperty("ObjId"); var sWfName:chars = Inputs.GetProperty("Workflow Process Name"); var sInitSessions:chars = Inputs.GetProperty("Init Sessions"); var sRootIdProp:chars = Inputs.GetProperty("Asset Id Root Field"); var sDestroySess:chars = Inputs.GetProperty("DestroySessions"); var oSessions:PropertySet; var oCurrAssets:PropertySet; var oSpeInp:PropertySet=oApp.NewPropertySet(); var oSpeOut:PropertySet=oApp.NewPropertySet(); var oPsActions:PropertySet=null; var oPsContext:PropertySet=null; var oPsRowSet:PropertySet=null; var oSpeService:Service=oApp.GetService("EAI SPE Caller SCM"); var oSession:PropertySet; var iChildCount:float=Inputs.GetChildCount(); var sReqTmpl:chars=""; var iChild; var iAssCount:float=0; var iAss:float; var bFound:bool=false; var sChar1:chars; var sChar2:chars; // first load proper inputs try { for(iChild=0;iChild<iChildCount;iChild++) { switch(Inputs.GetChild(iChild).GetType()) { case "Root Sessions": oSessions=Inputs.GetChild(iChild); break; case "Current Assets": oCurrAssets=Inputs.GetChild(iChild); iAssCount=oCurrAssets.GetChildCount(); break; case "AEC Actions Row Set": oPsActions=Inputs.GetChild(iChild); break; case "Context": oPsContext=Inputs.GetChild(iChild); break; case "Row Set": oPsRowSet=Inputs.GetChild(iChild); break; } } if(oSessions==null) { oSessions=oApp.NewPropertySet(); } iChildCount=oSessions.GetChildCount(); // first we have to handle opening of SPE Sessions, if they are missing if(iChildCount==0) { // get set of provided assets iChildCount=oCurrAssets.GetChildCount(); // oSpeInp=oApp.NewPropertySet(); // oSpeOut=oApp.NewPropertySet(); // set SPE Broker Request oSpeInp.SetProperty("ContextId",sSpeContextId); oSpeInp.SetProperty("UseCase",sSpeUseCase); oSpeInp.SetProperty("NumberOfSessions",iChildCount); oSpeService.InvokeMethod("GetStatefulSessions",oSpeInp,oSpeOut); for(iChild=1;iChild<=iChildCount;iChild++) { // build own row set with root-session mapping oSession=oApp.NewPropertySet(); // oSession.SetProperty("CallbackURL",oSpeOut.GetProperty("CallbackURL")); oSession.SetProperty("SessionId",oSpeOut.GetProperty("SessionId"+iChild)); oSession.SetProperty("RootId",oCurrAssets.GetChild(iChild-1).GetProperty(sRootIdProp)); oSession.SetType("SPE Session"); oSessions.AddChild(oSession); } oSpeInp.Reset(); oSpeOut.Reset(); } // we assume, that all sessions are prepared .... we can call WF in paralel with each session with(oSpeInp) { SetProperty("ContextId",sSpeContextId); SetProperty("UseCase",sSpeUseCase); if(oPsContext!=null) { oPsContext.SetTyp

AEC SPE Wrapper SCM
RemoveChildLi
function RemoveChildLi(Inputs,Outputs) { /* Just Root item will remain in SIS OM Message */ var oPsInp=Inputs.GetChild(0).Copy(); // ListOfSIS OM.Header var iChildCount:float=0; var iChild:float; iChildCount=oPsInp.GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChildCount(); for(iChild=iChildCount-1;iChild>=0;iChild--) { oPsInp.GetChild(0).GetChild(0).GetChild(0).GetChild(0).RemoveChild(iChild); } Outputs.AddChild(oPsInp); oPsInp=null; }

AEC SPE Wrapper SCM
RemoveChildLi
function RemoveChildLi(Inputs,Outputs) { /* Just Root item will remain in SIS OM Message */ var oPsInp=Inputs.GetChild(0).Copy(); // ListOfSIS OM.Header var iChildCount:float=0; var iChild:float; iChildCount=oPsInp.GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChildCount(); for(iChild=iChildCount-1;iChild>=0;iChild--) { oPsInp.GetChild(0).GetChild(0).GetChild(0).GetChild(0).RemoveChild(iChild); } Outputs.AddChild(oPsInp); oPsInp=null; }

AEC SPE Wrapper SCM
RemoveLineItems
function RemoveLineItems(Inputs,Outputs) { /* function will remove ListOf Line Item and Child Elements from Input Siebel Message */ var oPsInp=Inputs.GetChild(0).Copy(); var iChild:float=0; var iChildCount:float=oPsInp.GetChild(0).GetChild(0).GetChild(0).GetChildCount(); // ListOfSIS OM.Header for(iChild=iChildCount-1;iChild>=0;iChild--) { oPsInp.GetChild(0).GetChild(0).GetChild(0).RemoveChild(iChild); } Outputs.AddChild(oPsInp); oPsInp=null; }

AEC SPE Wrapper SCM
RemoveLineItems
function RemoveLineItems(Inputs,Outputs) { /* function will remove ListOf Line Item and Child Elements from Input Siebel Message */ var oPsInp=Inputs.GetChild(0).Copy(); var iChild:float=0; var iChildCount:float=oPsInp.GetChild(0).GetChild(0).GetChild(0).GetChildCount(); // ListOfSIS OM.Header for(iChild=iChildCount-1;iChild>=0;iChild--) { oPsInp.GetChild(0).GetChild(0).GetChild(0).RemoveChild(iChild); } Outputs.AddChild(oPsInp); oPsInp=null; }

AEC SPE Wrapper SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { switch(MethodName) { case "SPE Request": SpeRequest(Inputs, Outputs); break; case "Get SPE Output": SpeOutputs(Inputs, Outputs); break; case "Get Instances": GetSessions(Inputs,Outputs); break; case "Apply Var Map": ApplyVarMap(Inputs,Outputs); break; case "Apply eCfg Actions": ApplyCfgActions(Inputs,Outputs); break; case "Remove Line Items": RemoveLineItems(Inputs,Outputs); break; case "Create New Roots": CreateNewRoots(Inputs,Outputs); break; case "Remove Child Li": RemoveChildLi(Inputs,Outputs); break; } return (CancelOperation); }

AEC SPE Wrapper SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { switch(MethodName) { case "SPE Request": SpeRequest(Inputs, Outputs); break; case "Get SPE Output": SpeOutputs(Inputs, Outputs); break; case "Get Instances": GetSessions(Inputs,Outputs); break; case "Apply Var Map": ApplyVarMap(Inputs,Outputs); break; case "Apply eCfg Actions": ApplyCfgActions(Inputs,Outputs); break; case "Remove Line Items": RemoveLineItems(Inputs,Outputs); break; case "Create New Roots": CreateNewRoots(Inputs,Outputs); break; case "Remove Child Li": RemoveChildLi(Inputs,Outputs); break; } return (CancelOperation); }

AEC SPE Wrapper SCM
SpeOutputs
function SpeOutputs(Inputs, Outputs) { /* function to get specific SPE Outputs from merged SPE Response Inputs: SPE Response ..... child hierarchy with overall SPE Response Request Num ..... request num to be processed processed Hierarchy List .. list of child property sets, comma delimited without spaces Property List .... list of properties from this requesty to be returned, comma delimited, without spaces eg. for Request num 2 and Hierarchy List=Row Set, Context will be returend outputs Req2_Row Set and Req2_Context Outputs: Hierachies and Properties based on provided inputs */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var psSpeResponse:PropertySet; var arChildList:Array; var arTargetNames:Array; var sPropList:chars=Inputs.GetProperty("Property List"); var sHierList:chars=Inputs.GetProperty("Hierarchy List"); var iReqNum:float=Inputs.GetProperty("Request Num"); var iCounter:float=0; var iChild:float=0; var iChildCount:float=0; var sPrefix:chars="Req"+iReqNum+"_"; var psTmp:PropertySet; try { // first to take properties if(Inputs.GetChildCount()>0) { psSpeResponse=Inputs.GetChild(0); if(sPropList!=null&&sPropList!="") { arChildList=sPropList.split(","); // arTargetNames=sPropList.split(","); for(iCounter=0;iCounter<arChildList.length;iCounter++) { Outputs.SetProperty(arChildList[iCounter],psSpeResponse.GetProperty(sPrefix+arChildList[iCounter])); } // for child propsets will be more complex, no direct name access is done } arChildList=sHierList.split(","); arTargetNames=sHierList.split(","); // build expected type names for(iCounter=0;iCounter<arChildList.length;iCounter++) { arChildList[iCounter]=sPrefix+arChildList[iCounter]; } iChildCount=psSpeResponse.GetChildCount(); for(iCounter=0;iCounter<iChildCount;iCounter++) { for(iChild=0;iChild<arChildList.length;iChild++) { if(psSpeResponse.GetChild(iCounter).GetType()==arChildList[iChild]) { // found match between child type and array psTmp=psSpeResponse.GetChild(iCounter); psTmp.SetType(arTargetNames[iChild]); Outputs.AddChild(psTmp); // clear target name to know, that has been found in response arTargetNames[iChild]=""; // stop array loop break; } } } // now we have to create new empty childs, which has not been found in reponse for(iCounter=0;iCounter<arTargetNames.length;iCounter++) { if(arTargetNames[iCounter].length>0) { psTmp=oApp.NewPropertySet(); psTmp.SetType(arTargetNames[iCounter]); Outputs.AddChild(psTmp); } } } else { // missing input hierarchy, just build empty outputs to // not kill workflow arTargetNames=sHierList.split(","); for(iCounter=0;iCounter<arTargetNames.length;iCounter++) { psTmp=oApp.NewPropertySet(); psTmp.SetType(arTargetNames[iCounter]); Outputs.AddChild(psTmp); } } } catch(e) { if(bIsTraceOn) { oApp.Trace("BusinessService->Method Error: " + e.toString()); } } finally { psTmp=null; psSpeResponse=null; arChildList=null; arTargetNames=null; } }

AEC SPE Wrapper SCM
SpeOutputs
function SpeOutputs(Inputs, Outputs) { /* function to get specific SPE Outputs from merged SPE Response Inputs: SPE Response ..... child hierarchy with overall SPE Response Request Num ..... request num to be processed processed Hierarchy List .. list of child property sets, comma delimited without spaces Property List .... list of properties from this requesty to be returned, comma delimited, without spaces eg. for Request num 2 and Hierarchy List=Row Set, Context will be returend outputs Req2_Row Set and Req2_Context Outputs: Hierachies and Properties based on provided inputs */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var psSpeResponse:PropertySet; var arChildList:Array; var arTargetNames:Array; var sPropList:chars=Inputs.GetProperty("Property List"); var sHierList:chars=Inputs.GetProperty("Hierarchy List"); var iReqNum:float=Inputs.GetProperty("Request Num"); var iCounter:float=0; var iChild:float=0; var iChildCount:float=0; var sPrefix:chars="Req"+iReqNum+"_"; var psTmp:PropertySet; try { // first to take properties if(Inputs.GetChildCount()>0) { psSpeResponse=Inputs.GetChild(0); if(sPropList!=null&&sPropList!="") { arChildList=sPropList.split(","); // arTargetNames=sPropList.split(","); for(iCounter=0;iCounter<arChildList.length;iCounter++) { Outputs.SetProperty(arChildList[iCounter],psSpeResponse.GetProperty(sPrefix+arChildList[iCounter])); } // for child propsets will be more complex, no direct name access is done } arChildList=sHierList.split(","); arTargetNames=sHierList.split(","); // build expected type names for(iCounter=0;iCounter<arChildList.length;iCounter++) { arChildList[iCounter]=sPrefix+arChildList[iCounter]; } iChildCount=psSpeResponse.GetChildCount(); for(iCounter=0;iCounter<iChildCount;iCounter++) { for(iChild=0;iChild<arChildList.length;iChild++) { if(psSpeResponse.GetChild(iCounter).GetType()==arChildList[iChild]) { // found match between child type and array psTmp=psSpeResponse.GetChild(iCounter); psTmp.SetType(arTargetNames[iChild]); Outputs.AddChild(psTmp); // clear target name to know, that has been found in response arTargetNames[iChild]=""; // stop array loop break; } } } // now we have to create new empty childs, which has not been found in reponse for(iCounter=0;iCounter<arTargetNames.length;iCounter++) { if(arTargetNames[iCounter].length>0) { psTmp=oApp.NewPropertySet(); psTmp.SetType(arTargetNames[iCounter]); Outputs.AddChild(psTmp); } } } else { // missing input hierarchy, just build empty outputs to // not kill workflow arTargetNames=sHierList.split(","); for(iCounter=0;iCounter<arTargetNames.length;iCounter++) { psTmp=oApp.NewPropertySet(); psTmp.SetType(arTargetNames[iCounter]); Outputs.AddChild(psTmp); } } } catch(e) { if(bIsTraceOn) { oApp.Trace("BusinessService->Method Error: " + e.toString()); } } finally { psTmp=null; psSpeResponse=null; arChildList=null; arTargetNames=null; } }

AEC SPE Wrapper SCM
SpeRequest
function SpeRequest(Inputs,Outputs) { /* function for encapsulation of SPE Call with amount defined amount of threads Inputs: SPE Service ... name of SPE Service to be called SPE U ContextId ... ContextId for SPE Service to find reques in their log Scoring Enabled .... Y/N .. enables one thread for scoring Maximum Threads .... number with maximum amount of EnC threads to be executed Scoring Workflow ... name of Scoring Workflow to be executed EnC Workflow ... EnC Workflow Name EnC Thread Prop ... EnC Thread Property name for Req_ .... properties or Child property Sets which should be same for all EnC and Scoring requests EnC_ .... properties or child propsets to be sent into EnC process Name Scoring_ .... properties or Childs to be passed into Scoring PA .... comma separated list of profile attributes, to be passed into each request */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var sSpeServiceName:chars=Inputs.GetProperty("SPE Service"); var sSpeUseCase:chars=Inputs.GetProperty("SPE UseCase"); var sContext:chars=Inputs.GetProperty("ContextId"); var sScoringEnabled=Inputs.GetProperty("Scoring Enabled"); var sOSIEnabled=Inputs.GetProperty("OSI Enabled"); var iMaxThreads:float=Inputs.GetProperty("Maximum Threads"); var sScoringWf:chars=Inputs.GetProperty("Scoring Workflow"); var sOSIWf:chars=Inputs.GetProperty("OSI Workflow"); var sEligWf:chars=Inputs.GetProperty("EnC Workflow"); var sThreadProp:chars=Inputs.GetProperty("EnC Thread Prop"); // SPE Inputs var psSpeInputs:PropertySet=oApp.NewPropertySet(); var psSpeOutputs:PropertySet=oApp.NewPropertySet(); var oSpeService:Service=oApp.GetService(sSpeServiceName); // working objects (counters, strings etc) var sPropName:chars=""; var sChildName:chars=""; var iPropInd:float = 0; var iTargCount:float = 0; var sPropElem:Array; var iThreadNum:float; var iReqOffset:float=0; var sReqPrefix:chars=""; try { Outputs.SetProperty("Error Flag","N"); // simple arguments for SPE Call with(psSpeInputs) { SetProperty("ContextId",sContext); SetProperty("UseCase",sSpeUseCase); } // now copy common arguments CopyInp(Inputs,psSpeInputs,"Common","Req"); // now build Scoring Request if(sScoringEnabled=="Y") { with(psSpeInputs) { SetProperty("Req1_BusSvcName","Workflow Process Manager"); SetProperty("Req1_BusSvcMethod","RunProcess"); SetProperty("Req1_ProcessName",sScoringWf); } CopyInp(Inputs, psSpeInputs, "Scoring", "Req1"); iReqOffset=1; } if(sOSIEnabled=="Y") { iPropInd=1+iReqOffset; sReqPrefix="Req"+iPropInd; with(psSpeInputs) { SetProperty(sReqPrefix+"_BusSvcName","Workflow Process Manager"); SetProperty(sReqPrefix+"_BusSvcMethod","RunProcess"); SetProperty(sReqPrefix+"_ProcessName",sOSIWf); } CopyInp(Inputs, psSpeInputs, "OSI", sReqPrefix); iReqOffset=iReqOffset+1; } // now build data for EnC requests for(iThreadNum=1;iThreadNum<=iMaxThreads;iThreadNum++) { iPropInd=iThreadNum+iReqOffset; sReqPrefix="Req"+iPropInd; with(psSpeInputs) { SetProperty(sReqPrefix+"_BusSvcName","Workflow Process Manager"); SetProperty(sReqPrefix+"_BusSvcMethod","RunProcess"); SetProperty(sReqPrefix+"_ProcessName",sEligWf); SetProperty(sReqPrefix+"_"+sThreadProp,iThreadNum); } CopyInp(Inputs,psSpeInputs,"EnC",sReqPrefix); } // request parameters build finished Outputs.AddChild(psSpeInputs.Copy()); Outputs.GetChild(0).SetType("RequestBefore"); oSpeService.InvokeMethod("ExecuteStatelessRequest",psSpeInputs,psSpeOutputs); // take outputs and pass them as child response of service psSpeOutputs.SetType("Response"); psSpeInputs.SetType("Request"); //just for debugging purposes Outputs.AddChild(psSpeOutputs); Outputs.AddChild(psSpeInputs); } catch(e) { if(bIsTraceOn) { oApp.Trace("AEC SPE Wrapper SCM->SPE Request Error: " + e.toString()); } Outp

AEC SPE Wrapper SCM
SpeRequest
function SpeRequest(Inputs,Outputs) { /* function for encapsulation of SPE Call with amount defined amount of threads Inputs: SPE Service ... name of SPE Service to be called SPE U ContextId ... ContextId for SPE Service to find reques in their log Scoring Enabled .... Y/N .. enables one thread for scoring Maximum Threads .... number with maximum amount of EnC threads to be executed Scoring Workflow ... name of Scoring Workflow to be executed EnC Workflow ... EnC Workflow Name EnC Thread Prop ... EnC Thread Property name for Req_ .... properties or Child property Sets which should be same for all EnC and Scoring requests EnC_ .... properties or child propsets to be sent into EnC process Name Scoring_ .... properties or Childs to be passed into Scoring PA .... comma separated list of profile attributes, to be passed into each request */ oApp=TheApplication(); bIsTraceOn=oApp.isTraceON; var sSpeServiceName:chars=Inputs.GetProperty("SPE Service"); var sSpeUseCase:chars=Inputs.GetProperty("SPE UseCase"); var sContext:chars=Inputs.GetProperty("ContextId"); var sScoringEnabled=Inputs.GetProperty("Scoring Enabled"); var sOSIEnabled=Inputs.GetProperty("OSI Enabled"); var iMaxThreads:float=Inputs.GetProperty("Maximum Threads"); var sScoringWf:chars=Inputs.GetProperty("Scoring Workflow"); var sOSIWf:chars=Inputs.GetProperty("OSI Workflow"); var sEligWf:chars=Inputs.GetProperty("EnC Workflow"); var sThreadProp:chars=Inputs.GetProperty("EnC Thread Prop"); // SPE Inputs var psSpeInputs:PropertySet=oApp.NewPropertySet(); var psSpeOutputs:PropertySet=oApp.NewPropertySet(); var oSpeService:Service=oApp.GetService(sSpeServiceName); // working objects (counters, strings etc) var sPropName:chars=""; var sChildName:chars=""; var iPropInd:float = 0; var iTargCount:float = 0; var sPropElem:Array; var iThreadNum:float; var iReqOffset:float=0; var sReqPrefix:chars=""; try { Outputs.SetProperty("Error Flag","N"); // simple arguments for SPE Call with(psSpeInputs) { SetProperty("ContextId",sContext); SetProperty("UseCase",sSpeUseCase); } // now copy common arguments CopyInp(Inputs,psSpeInputs,"Common","Req"); // now build Scoring Request if(sScoringEnabled=="Y") { with(psSpeInputs) { SetProperty("Req1_BusSvcName","Workflow Process Manager"); SetProperty("Req1_BusSvcMethod","RunProcess"); SetProperty("Req1_ProcessName",sScoringWf); } CopyInp(Inputs, psSpeInputs, "Scoring", "Req1"); iReqOffset=1; } if(sOSIEnabled=="Y") { iPropInd=1+iReqOffset; sReqPrefix="Req"+iPropInd; with(psSpeInputs) { SetProperty(sReqPrefix+"_BusSvcName","Workflow Process Manager"); SetProperty(sReqPrefix+"_BusSvcMethod","RunProcess"); SetProperty(sReqPrefix+"_ProcessName",sOSIWf); } CopyInp(Inputs, psSpeInputs, "OSI", sReqPrefix); iReqOffset=iReqOffset+1; } // now build data for EnC requests for(iThreadNum=1;iThreadNum<=iMaxThreads;iThreadNum++) { iPropInd=iThreadNum+iReqOffset; sReqPrefix="Req"+iPropInd; with(psSpeInputs) { SetProperty(sReqPrefix+"_BusSvcName","Workflow Process Manager"); SetProperty(sReqPrefix+"_BusSvcMethod","RunProcess"); SetProperty(sReqPrefix+"_ProcessName",sEligWf); SetProperty(sReqPrefix+"_"+sThreadProp,iThreadNum); } CopyInp(Inputs,psSpeInputs,"EnC",sReqPrefix); } // request parameters build finished Outputs.AddChild(psSpeInputs.Copy()); Outputs.GetChild(0).SetType("RequestBefore"); oSpeService.InvokeMethod("ExecuteStatelessRequest",psSpeInputs,psSpeOutputs); // take outputs and pass them as child response of service psSpeOutputs.SetType("Response"); psSpeInputs.SetType("Request"); //just for debugging purposes Outputs.AddChild(psSpeOutputs); Outputs.AddChild(psSpeInputs); } catch(e) { if(bIsTraceOn) { oApp.Trace("AEC SPE Wrapper SCM->SPE Request Error: " + e.toString()); } Outp

AIP Access Info Service SCM
(declarations)
//Your public declarations go here... var bFirst = false; var oApp = TheApplication(); var curBO:BusObject = null; var bIsTraceOn:bool = true;

AIP Access Info Service SCM
Init
function Init (Inputs:PropertySet, Outputs:PropertySet) { /************************************************************************************************************** ** Name: Init ** Created: 24.11.2016 ** Created By: Binu Krishnan ** Description: Do the VBC Init ** *************************************************************************************************************** ** Modification: ** Modified By: ** Description: ***************************************************************************************************************/ try { if (bIsTraceOn) oApp.Trace(this.Name()+".Init() START"); with(Outputs) { SetProperty("Access Id SCM",""); SetProperty("Service Utilization SCM",""); SetProperty("Connection Type SCM",""); SetProperty("Temporary Access Id SCM",""); SetProperty("Temporary Service Utilization SCM",""); SetProperty("Temporary Connection Type SCM",""); SetProperty("Error Message SCM",""); } } catch(e) { throw(e); } finally { if (bIsTraceOn) oApp.Trace(this.Name()+".Init() END"); } }

AIP Access Info Service SCM
Query
function Query(Inputs: PropertySet, Outputs: PropertySet) { /************************************************************************************************************** ** Name: Query ** Created: 24.11.2016 ** Created By: Binu Krishnan ** Description: Do the VBC Query ** *************************************************************************************************************** ** Modification: Def:1830: Geographic address nodes is optional in response XML ** Modified By: TAARARA7 *************************************************************************************************************** ** Modification: Def:2024:07.02.17 CI3: OUT_995 is getting called for non LQS dependent bundles when we navigate to Access Info tab in "Asset Mgmt - Asset Bundle Detail View SCM" view. Bypass the webservice call if Access call is not required, check for value of field :[Requires Access Flag SCM] ** Modified By: TAARARA7 ** Modification: Def:3499,3501:16.02.17 CI3: Street data incorrectly dispalyed, data quality test issues ** Modified By: TAARARA7 ***************************************************************************************************************/ var psInputs: PropertySet; var psOutputs: PropertySet; var psIn: PropertySet; var psOut: PropertySet; var sErrorCode; var bsCallAccessWF; var sErrorMessage; var pschildPropset: PropertySet; var oPSOutputStruct: PropertySet; var sblueaditAccountNumber; var psPropset: PropertySet; var psListofPH: PropertySet; var sBlueaditAccountNumber = ""; var sContractId = ""; var sCustomerRowId = ""; var boAsset: BusObject; ; var bcAsset: BusComp; try { if (bIsTraceOn) TheApplication().Trace(this.Name() + " : Start VBQ BS "); if (bIsTraceOn) TheApplication().Trace(this.Name() + " : Fetching contract Id"); sContractId = Inputs.GetChild(0).GetProperty("Parent Contract Id"); if (bIsTraceOn) TheApplication().Trace(this.Name() + " : Contract Id: " + sContractId); if (sContractId == "") { if (bIsTraceOn) TheApplication().Trace(this.Name() + " : Exiting, Contract Id is null"); return; } boAsset = oApp.GetBusObject("Asset Management"); bcAsset = boAsset.GetBusComp("Asset Mgmt - Asset (Order Mgmt)"); with (bcAsset) { if (bIsTraceOn) TheApplication().Trace(this.Name() + " : Querying asset id: " + sContractId); ClearToQuery(); SetSearchSpec("Id", sContractId); ActivateField("Auto Type"); ActivateField("Bundle Configuration Mobile SCM"); ActivateField("AIP User External Integration Id"); ActivateField("Requires Access Flag SCM"); ActivateField("Owner Account Id"); SetViewMode(3); ExecuteQuery(ForwardOnly); if (FirstRecord()) { //IIf([Asset Auto Type Calc SCM] = "Bundle" and [Asset Bundle Configuration Mobile Calc SCM] = "0", "Y", "N") var sAutType = GetFieldValue("Auto Type"); var sBundleConfig = GetFieldValue("Bundle Configuration Mobile SCM"); if (GetFieldValue("Requires Access Flag SCM") == "Y" && GetFieldValue("Auto Type") == "Bundle" && GetFieldValue("Bundle Configuration Mobile SCM") == "0") { /*Def:2024:07.02.17.TAARARA7 Bypass the webservice call if Access call is not required */ sBlueaditAccountNumber = GetFieldValue("AIP User External Integration Id"); sCustomerRowId = GetFieldValue("Owner Account Id"); if (bIsTraceOn) TheApplication().Trace(this.Name() + " : BlueAdit number:" + sBlueaditAccountNumber); } else { if (bIsTraceOn) TheApplication().Trace(this.Name() + " : Exiting, not Wireline bundle"); oPSOutputStruct = oApp.NewPropertySet(); oPSOutputStruct.SetProperty("Is Wireline Bundle Flag", "Y"); Outputs.AddChild(oPSOutputStruct); return; } } else { oPSOutputStruct = oApp.NewPropertySet(); oPSOutputStruct.SetProperty("Is Wireline Bundle Flag", "N"); Outputs.AddChild(oPSOutputStruct); return; } } psInputs = oApp.NewPropertySet(); ps

AIP Access Info Service SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod(MethodName, Inputs: PropertySet, Outputs: PropertySet) { /************************************************************************************************************** ** Name: Main ** Created: 24.11.2016 ** Created By: Binu Krishnan ** Description: Main method handler ** *************************************************************************************************************** ** Modification: ** Modified By: ** Description: ***************************************************************************************************************/ var iReturn; try { iReturn = CancelOperation; oApp = TheApplication(); switch (MethodName) { case "Init": Init(Inputs, Outputs); break; case "Query": Query(Inputs, Outputs); break; case "openUIInvoke": openUIInvoke(Inputs, Outputs); break; default: iReturn = ContinueOperation; break; } } catch (e) { throw (e); } finally { curBO = null; oApp = null; } return (iReturn); }

AIP Access Info Service SCM
openUIInvoke
function openUIInvoke(Inputs: PropertySet, Outputs: PropertySet) { /************************************************************************************************************** ** Name: Query ** Created: 24.11.2016 ** Created By: TAARARA7 ** Description: Do the VBC Query ** *************************************************************************************************************** ** Modification: Def:1830: Geographic address nodes is optional in response XML ** Modified By: TAARARA7 ** Modification: Def:3499,3501:16.02.17 CI3: Street data incorrectly dispalyed, data quality test issues ** Modified By: TAARARA7 ***************************************************************************************************************/ var psInputs: PropertySet; var psOutputs: PropertySet; var psIn: PropertySet; var psOut: PropertySet; var sErrorCode; var bsCallAccessWF; var sErrorMessage; var pschildPropset: PropertySet; var psAccessSource: PropertySet; var psPropset: PropertySet; var psListofPH: PropertySet; var sBlueaditAccountNumber = ""; var sCustomerRowId = ""; var sContractId = ""; var boAsset: BusObject; ; var bcAsset: BusComp; try { sBlueaditAccountNumber = Inputs.GetProperty("sBlueaditAccountNumber"); sCustomerRowId = Inputs.GetProperty("sCustomerRowId"); if (bIsTraceOn) TheApplication().Trace(this.Name() + " : Contract Id: " + sContractId); psInputs = oApp.NewPropertySet(); psOutputs = oApp.NewPropertySet(); psIn = oApp.NewPropertySet(); psOut = oApp.NewPropertySet(); psPropset = oApp.NewPropertySet(); pschildPropset = oApp.NewPropertySet(); psListofPH = oApp.NewPropertySet(); sErrorCode = ""; //sBlueaditAccountNumber = "ServUsrId5-67543"; //test two addresses psIn.SetProperty("BlueaditAccountNumber", sBlueaditAccountNumber); /* TAARARA7:02.02.17: Passing Customer Row Id for language preference */ psIn.SetProperty("CustomerId", sCustomerRowId); if (bIsTraceOn) TheApplication().Trace(this.Name() + " : Invoking WF: EAI Get Access SCM"); psIn.SetProperty("ProcessName", "EAI Get Access SCM"); bsCallAccessWF = oApp.GetService("Workflow Process Manager"); bsCallAccessWF.InvokeMethod("RunProcess", psIn, psOut); if (bIsTraceOn) TheApplication().Trace(this.Name() + " : WF invoked"); sErrorCode = psOut.GetProperty("Error Code"); sErrorMessage = psOut.GetProperty("Error Message"); if (bIsTraceOn) TheApplication().Trace(this.Name() + " : WF error" + sErrorMessage); //sErrorCode="DDD"; // for testing if (sErrorCode == "") { Outputs.SetProperty("Error Occurred SCM", "N"); Outputs.SetProperty("Error Message SCM", ""); var sMainAddress = ""; var sMainStreet = ""; var sMainHouseNumber = ""; var sMainHouseName = ""; var sMainZipCode = ""; var sMainCity = ""; var sMainLocationIdentifier = ""; var sNomadicAddress = ""; var sNomadicStreet = ""; var sNomadicHouseNumber = ""; var sNomadicHouseName = ""; var sNomadicZipCode = ""; var sNomadicCity = ""; var sNomadicLocationIdentifier = ""; sMainStreet = psOut.GetProperty("MainAddressStreetName"); sMainHouseNumber = psOut.GetProperty("HouseNumber"); sMainHouseName = psOut.GetProperty("HouseName"); sMainZipCode = psOut.GetProperty("ZipCode"); sMainCity = psOut.GetProperty("City"); sMainLocationIdentifier = psOut.GetProperty("LocationIdentifier"); sNomadicStreet = psOut.GetProperty("StreetName"); sNomadicHouseNumber = psOut.GetProperty("NHouseNumber"); sNomadicHouseName = psOut.GetProperty("NHouseName"); sNomadicZipCode = psOut.GetProperty("NZipCode"); sNomadicCity = psOut.GetProperty("NCity"); sNomadicLocationIdentifier = psOut.GetProperty("NLocationIdentifier"); sMainAddress = sMainStreet; sMainAddress += (sMainHouseNumber == "" ? "" : (sMainAddress == "" ? "" : ", ") + sMainHouseNumber); sMainAddress += (sMainHouseName == "" ? "" : (sMainAddress == "" ? "" : ", ") + sMainHouseName);

ATP ASI Test
(declarations)
#include "eaisiebel.js"

ATP ASI Test
(declarations)
#include "eaisiebel.js"

ATP ASI Test
(declarations)
#include "eaisiebel.js"

ATP ASI Test
AddOneDay
function AddOneDay (Indate) { var ObjDate = new Date(Indate); return (ObjDate.getMonth()+1) + "/" + (ObjDate.getDate()+1) + "/" + (ObjDate.getYear()+1900); }

ATP ASI Test
AddOneDay
function AddOneDay (Indate) { var ObjDate = new Date(Indate); return (ObjDate.getMonth()+1) + "/" + (ObjDate.getDate()+1) + "/" + (ObjDate.getYear()+1900); }

ATP ASI Test
AddOneDay
function AddOneDay (Indate) { var ObjDate = new Date(Indate); return (ObjDate.getMonth()+1) + "/" + (ObjDate.getDate()+1) + "/" + (ObjDate.getYear()+1900); }

ATP ASI Test
GeneratePromised
function GeneratePromised (Inputs, Outputs) { var SiebelMessage; var ListOfHeader; var Header; var ListOfItems; var SysDate = Clib.time(); var ObjDate = Date.fromSystem(SysDate); var reqQty; var reqDate; var halfQty; var rowId; var ATPstatus; var pATPItem; var i =0; if (Inputs.GetChildCount()>0) { SiebelMessage = Inputs.GetChild(0); ListOfHeader = SiebelMessage.GetChild(0); Header = ListOfHeader.GetChild(0); Header.SetProperty("Available Message","ATP Test eScript Success"); ListOfItems = Header.GetChild(0); while (ListOfItems.GetChildCount() > i) { pATPItem = ListOfItems.GetChild(i); ATPstatus = pATPItem.GetProperty("ATP Action") + "d"; pATPItem.RemoveProperty("ATP Action"); while (pATPItem.GetChildCount()>0) { pATPItem.RemoveChild(0); } reqQty = pATPItem.GetProperty("Requested Quantity"); reqDate = pATPItem.GetProperty("Requested Date"); if (reqDate == ""){ reqDate = (ObjDate.getMonth()+1) + "/" + ObjDate.getDate() + "/2002"; } var reqDate1 = AddOneDay(reqDate); halfQty = reqQty / 2; halfQty = Math.ceil(halfQty); logResults ("halfQty",halfQty); logResults ("reqDate",reqDate); logResults ("reqDate1",reqDate1); var availList = TheApplication().NewPropertySet(); availList.SetType("ListOfPromised Schedule Line"); var avail1 = TheApplication().NewPropertySet(); GetPromiseLine(pATPItem,halfQty,reqDate1,ATPstatus,"1",avail1); availList.AddChild(avail1); if (reqQty > 1){ var avail2 = TheApplication().NewPropertySet(); GetPromiseLine(pATPItem,(reqQty-halfQty),reqDate1,ATPstatus,"2",avail2); availList.AddChild(avail2); } pATPItem.AddChild(availList); i++; } } SiebelMessage = Inputs.GetChild(0); Outputs.AddChild(SiebelMessage); }

ATP ASI Test
GeneratePromised
function GeneratePromised (Inputs, Outputs) { var SiebelMessage; var ListOfHeader; var Header; var ListOfItems; var SysDate = Clib.time(); var ObjDate = Date.fromSystem(SysDate); var reqQty; var reqDate; var halfQty; var rowId; var ATPstatus; var pATPItem; var i =0; if (Inputs.GetChildCount()>0) { SiebelMessage = Inputs.GetChild(0); ListOfHeader = SiebelMessage.GetChild(0); Header = ListOfHeader.GetChild(0); Header.SetProperty("Available Message","ATP Test eScript Success"); ListOfItems = Header.GetChild(0); while (ListOfItems.GetChildCount() > i) { pATPItem = ListOfItems.GetChild(i); ATPstatus = pATPItem.GetProperty("ATP Action") + "d"; pATPItem.RemoveProperty("ATP Action"); while (pATPItem.GetChildCount()>0) { pATPItem.RemoveChild(0); } reqQty = pATPItem.GetProperty("Requested Quantity"); reqDate = pATPItem.GetProperty("Requested Date"); if (reqDate == ""){ reqDate = (ObjDate.getMonth()+1) + "/" + ObjDate.getDate() + "/2002"; } var reqDate1 = AddOneDay(reqDate); halfQty = reqQty / 2; halfQty = Math.ceil(halfQty); logResults ("halfQty",halfQty); logResults ("reqDate",reqDate); logResults ("reqDate1",reqDate1); var availList = TheApplication().NewPropertySet(); availList.SetType("ListOfPromised Schedule Line"); var avail1 = TheApplication().NewPropertySet(); GetPromiseLine(pATPItem,halfQty,reqDate1,ATPstatus,"1",avail1); availList.AddChild(avail1); if (reqQty > 1){ var avail2 = TheApplication().NewPropertySet(); GetPromiseLine(pATPItem,(reqQty-halfQty),reqDate1,ATPstatus,"2",avail2); availList.AddChild(avail2); } pATPItem.AddChild(availList); i++; } } SiebelMessage = Inputs.GetChild(0); Outputs.AddChild(SiebelMessage); }

ATP ASI Test
GeneratePromised
function GeneratePromised (Inputs, Outputs) { var SiebelMessage; var ListOfHeader; var Header; var ListOfItems; var SysDate = Clib.time(); var ObjDate = Date.fromSystem(SysDate); var reqQty; var reqDate; var halfQty; var rowId; var ATPstatus; var pATPItem; var i =0; if (Inputs.GetChildCount()>0) { SiebelMessage = Inputs.GetChild(0); ListOfHeader = SiebelMessage.GetChild(0); Header = ListOfHeader.GetChild(0); Header.SetProperty("Available Message","ATP Test eScript Success"); ListOfItems = Header.GetChild(0); while (ListOfItems.GetChildCount() > i) { pATPItem = ListOfItems.GetChild(i); ATPstatus = pATPItem.GetProperty("ATP Action") + "d"; pATPItem.RemoveProperty("ATP Action"); while (pATPItem.GetChildCount()>0) { pATPItem.RemoveChild(0); } reqQty = pATPItem.GetProperty("Requested Quantity"); reqDate = pATPItem.GetProperty("Requested Date"); if (reqDate == ""){ reqDate = (ObjDate.getMonth()+1) + "/" + ObjDate.getDate() + "/2002"; } var reqDate1 = AddOneDay(reqDate); halfQty = reqQty / 2; halfQty = Math.ceil(halfQty); logResults ("halfQty",halfQty); logResults ("reqDate",reqDate); logResults ("reqDate1",reqDate1); var availList = TheApplication().NewPropertySet(); availList.SetType("ListOfPromised Schedule Line"); var avail1 = TheApplication().NewPropertySet(); GetPromiseLine(pATPItem,halfQty,reqDate1,ATPstatus,"1",avail1); availList.AddChild(avail1); if (reqQty > 1){ var avail2 = TheApplication().NewPropertySet(); GetPromiseLine(pATPItem,(reqQty-halfQty),reqDate1,ATPstatus,"2",avail2); availList.AddChild(avail2); } pATPItem.AddChild(availList); i++; } } SiebelMessage = Inputs.GetChild(0); Outputs.AddChild(SiebelMessage); }

ATP ASI Test
GetPromiseLine
function GetPromiseLine (pATPItem,availQty,availDate,status,LineNumber,avail1) { var SysDate = Clib.time(); var ObjDate = Date.fromSystem(SysDate); var rowId; var prodId; var prodIntId; var dateStr = (ObjDate.getMonth()+1) + "/" + (ObjDate.getDate()+1) + "/2004"; //promisedLine = TheApplication().NewPropertySet(); logResults("datestr=",dateStr); rowId = pATPItem.GetProperty("Id"); prodId = pATPItem.GetProperty("Product Id"); prodIntId = pATPItem.GetProperty("Product Integration Id"); var srcInvId = pATPItem.GetProperty("Source Inventory Loc Id"); var srcInvIntId = pATPItem.GetProperty("Source Inventory Loc Integration Id"); var srcInvLoc = pATPItem.GetProperty("Source Inventory Location"); if (status != "Reserved") status = "Available"; avail1.SetType("Promised Schedule Line"); // avail1.SetProperty("Line Row Id",rowId); avail1.SetProperty("Id",rowId+LineNumber); avail1.SetProperty("Line Number",LineNumber); avail1.SetProperty("Available Quantity",availQty); avail1.SetProperty("Available Date",availDate); avail1.SetProperty("Available Status",status); avail1.SetProperty("Product Id",prodId); avail1.SetProperty("Product Integration Id",prodIntId); avail1.SetProperty("Available Status As Of Date",dateStr); avail1.SetProperty("Source Inventory Loc Id",srcInvId); avail1.SetProperty("Source Inventory Loc Integration Id",srcInvIntId); avail1.SetProperty("Source Inventory Location",srcInvLoc); }

ATP ASI Test
GetPromiseLine
function GetPromiseLine (pATPItem,availQty,availDate,status,LineNumber,avail1) { var SysDate = Clib.time(); var ObjDate = Date.fromSystem(SysDate); var rowId; var prodId; var prodIntId; var dateStr = (ObjDate.getMonth()+1) + "/" + (ObjDate.getDate()+1) + "/2004"; //promisedLine = TheApplication().NewPropertySet(); logResults("datestr=",dateStr); rowId = pATPItem.GetProperty("Id"); prodId = pATPItem.GetProperty("Product Id"); prodIntId = pATPItem.GetProperty("Product Integration Id"); var srcInvId = pATPItem.GetProperty("Source Inventory Loc Id"); var srcInvIntId = pATPItem.GetProperty("Source Inventory Loc Integration Id"); var srcInvLoc = pATPItem.GetProperty("Source Inventory Location"); if (status != "Reserved") status = "Available"; avail1.SetType("Promised Schedule Line"); // avail1.SetProperty("Line Row Id",rowId); avail1.SetProperty("Id",rowId+LineNumber); avail1.SetProperty("Line Number",LineNumber); avail1.SetProperty("Available Quantity",availQty); avail1.SetProperty("Available Date",availDate); avail1.SetProperty("Available Status",status); avail1.SetProperty("Product Id",prodId); avail1.SetProperty("Product Integration Id",prodIntId); avail1.SetProperty("Available Status As Of Date",dateStr); avail1.SetProperty("Source Inventory Loc Id",srcInvId); avail1.SetProperty("Source Inventory Loc Integration Id",srcInvIntId); avail1.SetProperty("Source Inventory Location",srcInvLoc); }

ATP ASI Test
GetPromiseLine
function GetPromiseLine (pATPItem,availQty,availDate,status,LineNumber,avail1) { var SysDate = Clib.time(); var ObjDate = Date.fromSystem(SysDate); var rowId; var prodId; var prodIntId; var dateStr = (ObjDate.getMonth()+1) + "/" + (ObjDate.getDate()+1) + "/2004"; //promisedLine = TheApplication().NewPropertySet(); logResults("datestr=",dateStr); rowId = pATPItem.GetProperty("Id"); prodId = pATPItem.GetProperty("Product Id"); prodIntId = pATPItem.GetProperty("Product Integration Id"); var srcInvId = pATPItem.GetProperty("Source Inventory Loc Id"); var srcInvIntId = pATPItem.GetProperty("Source Inventory Loc Integration Id"); var srcInvLoc = pATPItem.GetProperty("Source Inventory Location"); if (status != "Reserved") status = "Available"; avail1.SetType("Promised Schedule Line"); // avail1.SetProperty("Line Row Id",rowId); avail1.SetProperty("Id",rowId+LineNumber); avail1.SetProperty("Line Number",LineNumber); avail1.SetProperty("Available Quantity",availQty); avail1.SetProperty("Available Date",availDate); avail1.SetProperty("Available Status",status); avail1.SetProperty("Product Id",prodId); avail1.SetProperty("Product Integration Id",prodIntId); avail1.SetProperty("Available Status As Of Date",dateStr); avail1.SetProperty("Source Inventory Loc Id",srcInvId); avail1.SetProperty("Source Inventory Loc Integration Id",srcInvIntId); avail1.SetProperty("Source Inventory Location",srcInvLoc); }

ATP ASI Test
GetShipmentInfo
function GetShipmentInfo (InputPropset, OutputPropSet) { //ThrowError("This funtionality is not yet implemented."); var ResponseFile; var OutputFile; var xmlService; var Outdata; var Indata; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; var psInputs4; var psOutputs4; var value2; var child1; var logfile; var getType1; ResponseFile = "d:\\ATPResponse.xml"; OutputFile = "d:\\ATPOutput.xml"; xmlService = TheApplication().GetService("EAI XML Converter"); psInputs2 = TheApplication().NewPropertySet(); child1 = InputPropset.GetChild(0); getType1 = child1.GetType(); logResults(logfile, "Output Child Type returns: " + getType1); psInputs2 = InputPropset; psOutputs2 = TheApplication().NewPropertySet(); xmlService.InvokeMethod("PropSetToXML", psInputs2, psOutputs2); value2 = psOutputs2.GetValue(); bsFILE = TheApplication().GetService("EAI File Transport"); psInputs3 = TheApplication().NewPropertySet(); psOutputs3 = TheApplication().NewPropertySet(); psInputs3.SetProperty("FileName", OutputFile); psInputs3.SetValue(value2); bsFILE.InvokeMethod("Send", psInputs3, psOutputs3); psInputs4 = TheApplication().NewPropertySet(); psOutputs4 = TheApplication().NewPropertySet(); psInputs4.SetProperty("FileName", ResponseFile); psInputs4.SetProperty("IsReceivingTextData","false"); bsFILE.InvokeMethod("Receive",psInputs4,psOutputs4); psOutputs4.SetProperty("StripNameSpace",""); xmlService.InvokeMethod("XMLToPropSet", psOutputs4, OutputPropSet); }

ATP ASI Test
GetShipmentInfo
function GetShipmentInfo (InputPropset, OutputPropSet) { //ThrowError("This funtionality is not yet implemented."); var ResponseFile; var OutputFile; var xmlService; var Outdata; var Indata; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; var psInputs4; var psOutputs4; var value2; var child1; var logfile; var getType1; ResponseFile = "d:\\ATPResponse.xml"; OutputFile = "d:\\ATPOutput.xml"; xmlService = TheApplication().GetService("EAI XML Converter"); psInputs2 = TheApplication().NewPropertySet(); child1 = InputPropset.GetChild(0); getType1 = child1.GetType(); logResults(logfile, "Output Child Type returns: " + getType1); psInputs2 = InputPropset; psOutputs2 = TheApplication().NewPropertySet(); xmlService.InvokeMethod("PropSetToXML", psInputs2, psOutputs2); value2 = psOutputs2.GetValue(); bsFILE = TheApplication().GetService("EAI File Transport"); psInputs3 = TheApplication().NewPropertySet(); psOutputs3 = TheApplication().NewPropertySet(); psInputs3.SetProperty("FileName", OutputFile); psInputs3.SetValue(value2); bsFILE.InvokeMethod("Send", psInputs3, psOutputs3); psInputs4 = TheApplication().NewPropertySet(); psOutputs4 = TheApplication().NewPropertySet(); psInputs4.SetProperty("FileName", ResponseFile); psInputs4.SetProperty("IsReceivingTextData","false"); bsFILE.InvokeMethod("Receive",psInputs4,psOutputs4); psOutputs4.SetProperty("StripNameSpace",""); xmlService.InvokeMethod("XMLToPropSet", psOutputs4, OutputPropSet); }

ATP ASI Test
GetShipmentInfo
function GetShipmentInfo (InputPropset, OutputPropSet) { //ThrowError("This funtionality is not yet implemented."); var ResponseFile; var OutputFile; var xmlService; var Outdata; var Indata; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; var psInputs4; var psOutputs4; var value2; var child1; var logfile; var getType1; ResponseFile = "d:\\ATPResponse.xml"; OutputFile = "d:\\ATPOutput.xml"; xmlService = TheApplication().GetService("EAI XML Converter"); psInputs2 = TheApplication().NewPropertySet(); child1 = InputPropset.GetChild(0); getType1 = child1.GetType(); logResults(logfile, "Output Child Type returns: " + getType1); psInputs2 = InputPropset; psOutputs2 = TheApplication().NewPropertySet(); xmlService.InvokeMethod("PropSetToXML", psInputs2, psOutputs2); value2 = psOutputs2.GetValue(); bsFILE = TheApplication().GetService("EAI File Transport"); psInputs3 = TheApplication().NewPropertySet(); psOutputs3 = TheApplication().NewPropertySet(); psInputs3.SetProperty("FileName", OutputFile); psInputs3.SetValue(value2); bsFILE.InvokeMethod("Send", psInputs3, psOutputs3); psInputs4 = TheApplication().NewPropertySet(); psOutputs4 = TheApplication().NewPropertySet(); psInputs4.SetProperty("FileName", ResponseFile); psInputs4.SetProperty("IsReceivingTextData","false"); bsFILE.InvokeMethod("Receive",psInputs4,psOutputs4); psOutputs4.SetProperty("StripNameSpace",""); xmlService.InvokeMethod("XMLToPropSet", psOutputs4, OutputPropSet); }

ATP ASI Test
RunATPTest
function RunATPTest (InputPropset, OutputPropSet) { var OutputFile; var envPath; var envSlash; if (Clib.getenv("OS") == "Windows_NT") { envSlash = "\\"; } else { envSlash = "/"; } envPath = Clib.getenv("REQUEST_ASI_PATH") + envSlash; if ( (envPath == ("null" + envSlash)) || (envPath == envSlash) ) { envPath = Clib.getenv("SIEBEL_HOME"); if ((envPath == "null") || (envPath == "")) { envPath = ""; } else { envPath = envPath + envSlash + "bin" + envSlash; } } OutputFile = envPath + "ATPOutput.xml"; WriteXMLFile(InputPropset,OutputFile); GeneratePromised(InputPropset,OutputPropSet); var ResponseFile = envPath + "ATPFinished.xml"; WriteXMLFile(OutputPropSet,ResponseFile); }

ATP ASI Test
RunATPTest
function RunATPTest (InputPropset, OutputPropSet) { var OutputFile; var envPath; var envSlash; if (Clib.getenv("OS") == "Windows_NT") { envSlash = "\\"; } else { envSlash = "/"; } envPath = Clib.getenv("REQUEST_ASI_PATH") + envSlash; if ( (envPath == ("null" + envSlash)) || (envPath == envSlash) ) { envPath = Clib.getenv("SIEBEL_HOME"); if ((envPath == "null") || (envPath == "")) { envPath = ""; } else { envPath = envPath + envSlash + "bin" + envSlash; } } OutputFile = envPath + "ATPOutput.xml"; WriteXMLFile(InputPropset,OutputFile); GeneratePromised(InputPropset,OutputPropSet); var ResponseFile = envPath + "ATPFinished.xml"; WriteXMLFile(OutputPropSet,ResponseFile); }

ATP ASI Test
RunATPTest
function RunATPTest (InputPropset, OutputPropSet) { var OutputFile; var envPath; var envSlash; if (Clib.getenv("OS") == "Windows_NT") { envSlash = "\\"; } else { envSlash = "/"; } envPath = Clib.getenv("REQUEST_ASI_PATH") + envSlash; if ( (envPath == ("null" + envSlash)) || (envPath == envSlash) ) { envPath = Clib.getenv("SIEBEL_HOME"); if ((envPath == "null") || (envPath == "")) { envPath = ""; } else { envPath = envPath + envSlash + "bin" + envSlash; } } OutputFile = envPath + "ATPOutput.xml"; WriteXMLFile(InputPropset,OutputFile); GeneratePromised(InputPropset,OutputPropSet); var ResponseFile = envPath + "ATPFinished.xml"; WriteXMLFile(OutputPropSet,ResponseFile); }

ATP ASI Test
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if (MethodName == "Execute") { //GetShipmentInfo (Inputs, Outputs); RunATPTest (Inputs, Outputs); } if (MethodName == "WriteXML") { //GetShipmentInfo (Inputs, Outputs); WriteXMLFile (Inputs,"d:\\ATPBeforeExecute.xml"); } return (CancelOperation); }

ATP ASI Test
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if (MethodName == "Execute") { //GetShipmentInfo (Inputs, Outputs); RunATPTest (Inputs, Outputs); } if (MethodName == "WriteXML") { //GetShipmentInfo (Inputs, Outputs); WriteXMLFile (Inputs,"d:\\ATPBeforeExecute.xml"); } return (CancelOperation); }

ATP ASI Test
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if (MethodName == "Execute") { //GetShipmentInfo (Inputs, Outputs); RunATPTest (Inputs, Outputs); } if (MethodName == "WriteXML") { //GetShipmentInfo (Inputs, Outputs); WriteXMLFile (Inputs,"d:\\ATPBeforeExecute.xml"); } return (CancelOperation); }

ATP ASI Test
WriteJunk
function WriteJunk (Inputs) { var SiebelMessage; var ListOfHeader; var Header; var ListOfItems; var Item; var ListOfATP; var Promised; var data; logResults ("jnk","WriteJunk"); SiebelMessage = Inputs.GetChild(0); data = SiebelMessage.GetType(); logResults ("SiebMes",data); ListOfHeader = SiebelMessage.GetChild(0); data = ListOfHeader.GetType(); logResults ("ListOHeader",data); Header = ListOfHeader.GetChild(0); data = Header.GetType(); logResults ("DaHeader",data); ListOfItems = Header.GetChild(0); data = ListOfItems.GetType(); logResults ("LstOItems",data); Item = ListOfItems.GetChild(0); data = Item.GetType(); logResults ("Item",data); ListOfATP = Item.GetChild(0); data = ListOfATP.GetType(); logResults ("ListOAtp",data); Promised = ListOfATP.GetChild(0); data = Promised.GetType(); logResults ("Promised",data); }

ATP ASI Test
WriteJunk
function WriteJunk (Inputs) { var SiebelMessage; var ListOfHeader; var Header; var ListOfItems; var Item; var ListOfATP; var Promised; var data; logResults ("jnk","WriteJunk"); SiebelMessage = Inputs.GetChild(0); data = SiebelMessage.GetType(); logResults ("SiebMes",data); ListOfHeader = SiebelMessage.GetChild(0); data = ListOfHeader.GetType(); logResults ("ListOHeader",data); Header = ListOfHeader.GetChild(0); data = Header.GetType(); logResults ("DaHeader",data); ListOfItems = Header.GetChild(0); data = ListOfItems.GetType(); logResults ("LstOItems",data); Item = ListOfItems.GetChild(0); data = Item.GetType(); logResults ("Item",data); ListOfATP = Item.GetChild(0); data = ListOfATP.GetType(); logResults ("ListOAtp",data); Promised = ListOfATP.GetChild(0); data = Promised.GetType(); logResults ("Promised",data); }

ATP ASI Test
WriteJunk
function WriteJunk (Inputs) { var SiebelMessage; var ListOfHeader; var Header; var ListOfItems; var Item; var ListOfATP; var Promised; var data; logResults ("jnk","WriteJunk"); SiebelMessage = Inputs.GetChild(0); data = SiebelMessage.GetType(); logResults ("SiebMes",data); ListOfHeader = SiebelMessage.GetChild(0); data = ListOfHeader.GetType(); logResults ("ListOHeader",data); Header = ListOfHeader.GetChild(0); data = Header.GetType(); logResults ("DaHeader",data); ListOfItems = Header.GetChild(0); data = ListOfItems.GetType(); logResults ("LstOItems",data); Item = ListOfItems.GetChild(0); data = Item.GetType(); logResults ("Item",data); ListOfATP = Item.GetChild(0); data = ListOfATP.GetType(); logResults ("ListOAtp",data); Promised = ListOfATP.GetChild(0); data = Promised.GetType(); logResults ("Promised",data); }

ATP ASI Test
WriteXMLFile
function WriteXMLFile (Inputs, fileName) { var xmlService; var value2; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; psInputs2 = TheApplication().NewPropertySet(); psInputs2 = Inputs; psOutputs2 = TheApplication().NewPropertySet(); xmlService = TheApplication().GetService("EAI XML Write to File"); psInputs2.SetProperty ("FileName", fileName); xmlService.InvokeMethod("WriteEAIMsg", psInputs2, psOutputs2); }

ATP ASI Test
WriteXMLFile
function WriteXMLFile (Inputs, fileName) { var xmlService; var value2; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; psInputs2 = TheApplication().NewPropertySet(); psInputs2 = Inputs; psOutputs2 = TheApplication().NewPropertySet(); xmlService = TheApplication().GetService("EAI XML Write to File"); psInputs2.SetProperty ("FileName", fileName); xmlService.InvokeMethod("WriteEAIMsg", psInputs2, psOutputs2); }

ATP ASI Test
WriteXMLFile
function WriteXMLFile (Inputs, fileName) { var xmlService; var value2; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; psInputs2 = TheApplication().NewPropertySet(); psInputs2 = Inputs; psOutputs2 = TheApplication().NewPropertySet(); xmlService = TheApplication().GetService("EAI XML Write to File"); psInputs2.SetProperty ("FileName", fileName); xmlService.InvokeMethod("WriteEAIMsg", psInputs2, psOutputs2); }

ATP ASI Test
logResults
function logResults (lf,data) { var logfile; //var logfile = Clib.fopen("craiglog.txt", "a"); // Clib.fputs(" \n", logfile); // data = lf + " " + data + " \n"; // if ( !Clib.fputs(data, logfile)) // { // Clib.ferror(logfile); // } // Clib.fputs(" \n", logfile); //Clib.fclose(logfile); }

ATP ASI Test
logResults
function logResults (lf,data) { var logfile; //var logfile = Clib.fopen("craiglog.txt", "a"); // Clib.fputs(" \n", logfile); // data = lf + " " + data + " \n"; // if ( !Clib.fputs(data, logfile)) // { // Clib.ferror(logfile); // } // Clib.fputs(" \n", logfile); //Clib.fclose(logfile); }

ATP ASI Test
logResults
function logResults (lf,data) { var logfile; //var logfile = Clib.fopen("craiglog.txt", "a"); // Clib.fputs(" \n", logfile); // data = lf + " " + data + " \n"; // if ( !Clib.fputs(data, logfile)) // { // Clib.ferror(logfile); // } // Clib.fputs(" \n", logfile); //Clib.fclose(logfile); }

ATP ASI Test XML
Execute
function Execute(Inputs, Outputs) { var ResponseFile; var OutputFile; var xmlService; var Outdata; var Indata; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; var psInputs4; var psOutputs4; var value2; var child1; var logfile; var getType1; var envPath; var envSlash; if (Clib.getenv("OS") == "Windows_NT") { envSlash = "\\"; } else { envSlash = "/"; } envPath = Clib.getenv("REQUEST_ASI_PATH") + envSlash; if (envPath == ("null" + envSlash)) { envPath = Clib.getenv("SIEBEL_HOME") + envSlash + "bin" + envSlash; } OutputFile = envPath + "ATPOutput.xml"; ResponseFile = envPath + "ATPResponse.xml"; psInputs2 = TheApplication().NewPropertySet(); psInputs2 = Inputs; psOutputs2 = TheApplication().NewPropertySet(); xmlService = TheApplication().GetService("EAI XML Write to File"); psInputs2.SetProperty ("FileName", OutputFile); xmlService.InvokeMethod("WriteEAIMsg", psInputs2, psOutputs2); psInputs4 = TheApplication().NewPropertySet(); psInputs4.SetProperty("FileName", ResponseFile); xmlService = TheApplication().GetService("EAI XML Read from File"); xmlService.InvokeMethod("ReadEAIMsg", psInputs4, Outputs); }

ATP ASI Test XML
Execute
function Execute(Inputs, Outputs) { var ResponseFile; var OutputFile; var xmlService; var Outdata; var Indata; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; var psInputs4; var psOutputs4; var value2; var child1; var logfile; var getType1; var envPath; var envSlash; if (Clib.getenv("OS") == "Windows_NT") { envSlash = "\\"; } else { envSlash = "/"; } envPath = Clib.getenv("REQUEST_ASI_PATH") + envSlash; if (envPath == ("null" + envSlash)) { envPath = Clib.getenv("SIEBEL_HOME") + envSlash + "bin" + envSlash; } OutputFile = envPath + "ATPOutput.xml"; ResponseFile = envPath + "ATPResponse.xml"; psInputs2 = TheApplication().NewPropertySet(); psInputs2 = Inputs; psOutputs2 = TheApplication().NewPropertySet(); xmlService = TheApplication().GetService("EAI XML Write to File"); psInputs2.SetProperty ("FileName", OutputFile); xmlService.InvokeMethod("WriteEAIMsg", psInputs2, psOutputs2); psInputs4 = TheApplication().NewPropertySet(); psInputs4.SetProperty("FileName", ResponseFile); xmlService = TheApplication().GetService("EAI XML Read from File"); xmlService.InvokeMethod("ReadEAIMsg", psInputs4, Outputs); }

ATP ASI Test XML
Execute
function Execute(Inputs, Outputs) { var ResponseFile; var OutputFile; var xmlService; var Outdata; var Indata; var psInputs2; var psOutputs2; var bsFILE; var psInputs3; var psOutputs3; var psInputs4; var psOutputs4; var value2; var child1; var logfile; var getType1; var envPath; var envSlash; if (Clib.getenv("OS") == "Windows_NT") { envSlash = "\\"; } else { envSlash = "/"; } envPath = Clib.getenv("REQUEST_ASI_PATH") + envSlash; if (envPath == ("null" + envSlash)) { envPath = Clib.getenv("SIEBEL_HOME") + envSlash + "bin" + envSlash; } OutputFile = envPath + "ATPOutput.xml"; ResponseFile = envPath + "ATPResponse.xml"; psInputs2 = TheApplication().NewPropertySet(); psInputs2 = Inputs; psOutputs2 = TheApplication().NewPropertySet(); xmlService = TheApplication().GetService("EAI XML Write to File"); psInputs2.SetProperty ("FileName", OutputFile); xmlService.InvokeMethod("WriteEAIMsg", psInputs2, psOutputs2); psInputs4 = TheApplication().NewPropertySet(); psInputs4.SetProperty("FileName", ResponseFile); xmlService = TheApplication().GetService("EAI XML Read from File"); xmlService.InvokeMethod("ReadEAIMsg", psInputs4, Outputs); }

ATP ASI Test XML
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var ret= CancelOperation; if (MethodName=="Execute") { Execute(Inputs,Outputs); } else { TheApplication.ErrorText("Invalid function name. Valid method name is 'Execute'"); ret=ContinueOperation; } return ret; }

ATP ASI Test XML
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var ret= CancelOperation; if (MethodName=="Execute") { Execute(Inputs,Outputs); } else { TheApplication().ErrorText("Invalid function name. Valid method name is 'Execute'"); ret=ContinueOperation; } return ret; }

ATP ASI Test XML
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var ret= CancelOperation; if (MethodName=="Execute") { Execute(Inputs,Outputs); } else { TheApplication().ErrorText("Invalid function name. Valid method name is 'Execute'"); ret=ContinueOperation; } return ret; }

Abo MOCCA SCM
(declarations)
//Variable Declarations var bIsTraceOn:bool = TheApplication().isTraceON; var STARS:String = "****"; var STARS_DT:String ="**/**/**/ **:**:**"; var oApp = TheApplication(); //ERROR String var ERROR_VBC:String = "Error in VBC"; //Field names in VBC var TARGET_ABO_VBC:String = "Target Abo SCM"; var TARGET_ABO_NAME_VBC:String = "Target Abo Name SCM"; var FEE_VBC:String = "Fee SCM";

Abo MOCCA SCM
(declarations)
//Variable Declarations var bIsTraceOn:bool = TheApplication().isTraceON; var STARS:String = "****"; var STARS_DT:String ="**/**/**/ **:**:**"; var oApp = TheApplication(); //ERROR String var ERROR_VBC:String = "Error in VBC"; //Field names in VBC var TARGET_ABO_VBC:String = "Target Abo SCM"; var TARGET_ABO_NAME_VBC:String = "Target Abo Name SCM"; var FEE_VBC:String = "Fee SCM";

Abo MOCCA SCM
AboGetValidate
function AboGetValidate (Inputs, Outputs){ /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Function CalculateDuration ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking Calculates the duration based on star and end date and returns as an HH:MM format *****************************************************************/ //Variable declaration var psInputs:PropertySet; var psReturnRecord:PropertySet; var psListOfAbos:PropertySet; var psListOfType:PropertySet; var psListOfListAbos:PropertySet; var psSourceAbo:PropertySet; var psMandatoryFlag:PropertySet; var psListOfErrors:PropertySet; var psErrors:PropertySet; var aFinalAbosList = new Array(); var bsCallWFGetAbos:Service; var wsInputs; var wsOutputs; var sMandatory; var sSourceAbo; var intRecords; var intIndex; var strMSISDN; var strExecDate; var strSegment; var strLang; var sFinalAbosList = ""; var strErrorCode = ""; var strErrorMessage = ""; // BEGIN - 17.10.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" / Defect 42876 var dtToday = new Date; var nYearToday:Number; var sMonthToday:String; var sDayToday:String; var dtBirthDay; var nYearBD:Number; var sMonthBD:String; var sDayBD:String; var nAgeInYears:Number; var strAgeInYears:String; // END - 17.10.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" / Defect 42876 try{ strMSISDN = Inputs.GetProperty("MSISDN"); strExecDate = Inputs.GetProperty("ExecDate"); strSegment = Inputs.GetProperty("Segment"); strLang = Inputs.GetProperty("Language"); dtBirthDay = Inputs.GetProperty("AccountBirthDate"); // Initialize variables wsInputs = TheApplication().NewPropertySet(); wsOutputs = TheApplication().NewPropertySet(); // BEGIN - 17.10.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" / Defect 42876 // Calculate age in Years nYearToday = dtToday.getFullYear(); sMonthToday = ToString(dtToday.getMonth() + 1); if (sMonthToday.length == 1) {sMonthToday = "0" + sMonthToday;} sDayToday = ToString(dtToday.getDate()); if (sMonthToday.length == 1) {sMonthToday = "0" + sMonthToday;} if ( dtBirthDay == "" ) { nAgeInYears = null; strAgeInYears = ""; } else { nYearBD = parseInt(dtBirthDay.substr(6,4)); sMonthBD = dtBirthDay.substr(0,2); sDayBD = dtBirthDay.substr(3,2); if (( sMonthToday + sDayToday ) < ( sMonthBD + sDayBD )) { nAgeInYears = nYearToday - nYearBD - 1; } else { nAgeInYears = nYearToday - nYearBD; } strAgeInYears = nAgeInYears.toString(); } if (bIsTraceOn) { TheApplication().Trace(this.Name() + " ... Today: " + sDayToday + sMonthToday + nYearToday ); TheApplication().Trace(this.Name() + " ... BirthDay: " + sDayBD + sMonthBD + nYearBD ); TheApplication().Trace(this.Name() + " ... AgeInYears: " + nAgeInYears ); TheApplication().Trace(this.Name() + " ... AgeInYears: " + strAgeInYears ); } wsInputs.SetProperty("age", strAgeInYears); // END - 17.10.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" / Defect 42876 wsInputs.SetProperty("number", strMSISDN); wsInputs.SetProperty("mainSegment", strSegment); wsInputs.SetProperty("executionDate", strExecDate); wsInputs.SetProperty("employeeLanguage", strLang); //Call EAI Service to getAbos bsCallWFGetAbos = TheApplication().GetService("EAI Subscription SCM"); bsCallWFGetAbos.InvokeMethod("getValidAbos", wsInputs,wsOutputs); psErrors = getHierElement(wsOutputs, "ListOfgetAvailableSubscriptionTypesResMsg"); if(psErrors == null) { // WS response msg is reqd oApp.RaiseErrorText(Name() + ".Error: response message not found"); } strErrorCode = psErrors.GetProperty("Error Code"); strErrorMessage = psErrors.GetProperty("Error Message"); if (strErrorCode == "0") { //Obtain the list of Target abos Ids. psInputs = getHierElement(wsOutputs, "ListOfg

Abo MOCCA SCM
AboGetValidate
function AboGetValidate (Inputs, Outputs){ /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Function CalculateDuration ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking Calculates the duration based on star and end date and returns as an HH:MM format *****************************************************************/ //Variable declaration var psInputs:PropertySet; var psReturnRecord:PropertySet; var psListOfAbos:PropertySet; var psListOfType:PropertySet; var psListOfListAbos:PropertySet; var psSourceAbo:PropertySet; var psMandatoryFlag:PropertySet; var psListOfErrors:PropertySet; var psErrors:PropertySet; var aFinalAbosList = new Array(); var bsCallWFGetAbos:Service; var wsInputs; var wsOutputs; var sMandatory; var sSourceAbo; var intRecords; var intIndex; var strMSISDN; var strExecDate; var strSegment; var strLang; var sFinalAbosList = ""; var strErrorCode = ""; var strErrorMessage = ""; // BEGIN - 17.10.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" / Defect 42876 var dtToday = new Date; var nYearToday:Number; var sMonthToday:String; var sDayToday:String; var dtBirthDay; var nYearBD:Number; var sMonthBD:String; var sDayBD:String; var nAgeInYears:Number; var strAgeInYears:String; // END - 17.10.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" / Defect 42876 try{ strMSISDN = Inputs.GetProperty("MSISDN"); strExecDate = Inputs.GetProperty("ExecDate"); strSegment = Inputs.GetProperty("Segment"); strLang = Inputs.GetProperty("Language"); dtBirthDay = Inputs.GetProperty("AccountBirthDate"); // Initialize variables wsInputs = TheApplication().NewPropertySet(); wsOutputs = TheApplication().NewPropertySet(); // BEGIN - 17.10.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" / Defect 42876 // Calculate age in Years nYearToday = dtToday.getFullYear(); sMonthToday = ToString(dtToday.getMonth() + 1); if (sMonthToday.length == 1) {sMonthToday = "0" + sMonthToday;} sDayToday = ToString(dtToday.getDate()); if (sMonthToday.length == 1) {sMonthToday = "0" + sMonthToday;} if ( dtBirthDay == "" ) { nAgeInYears = null; strAgeInYears = ""; } else { nYearBD = parseInt(dtBirthDay.substr(6,4)); sMonthBD = dtBirthDay.substr(0,2); sDayBD = dtBirthDay.substr(3,2); if (( sMonthToday + sDayToday ) < ( sMonthBD + sDayBD )) { nAgeInYears = nYearToday - nYearBD - 1; } else { nAgeInYears = nYearToday - nYearBD; } strAgeInYears = nAgeInYears.toString(); } if (bIsTraceOn) { TheApplication().Trace(this.Name() + " ... Today: " + sDayToday + sMonthToday + nYearToday ); TheApplication().Trace(this.Name() + " ... BirthDay: " + sDayBD + sMonthBD + nYearBD ); TheApplication().Trace(this.Name() + " ... AgeInYears: " + nAgeInYears ); TheApplication().Trace(this.Name() + " ... AgeInYears: " + strAgeInYears ); } wsInputs.SetProperty("age", strAgeInYears); // END - 17.10.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" / Defect 42876 wsInputs.SetProperty("number", strMSISDN); wsInputs.SetProperty("mainSegment", strSegment); wsInputs.SetProperty("executionDate", strExecDate); wsInputs.SetProperty("employeeLanguage", strLang); //Call EAI Service to getAbos bsCallWFGetAbos = TheApplication().GetService("EAI Subscription SCM"); bsCallWFGetAbos.InvokeMethod("getValidAbos", wsInputs,wsOutputs); psErrors = getHierElement(wsOutputs, "ListOfgetAvailableSubscriptionTypesResMsg"); if(psErrors == null) { // WS response msg is reqd oApp.RaiseErrorText(Name() + ".Error: response message not found"); } strErrorCode = psErrors.GetProperty("Error Code"); strErrorMessage = psErrors.GetProperty("Error Message"); if (strErrorCode == "0") { //Obtain the list of Target abos Ids. psInputs = getHierElement(wsOutputs, "ListOfg

Abo MOCCA SCM
Init
function Init (Inputs, Outputs){ /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking Initialize the BC fields *****************************************************************/ try{ Outputs.SetProperty(TARGET_ABO_VBC, ""); Outputs.SetProperty(TARGET_ABO_NAME_VBC, ""); Outputs.SetProperty(FEE_VBC, ""); } catch(e){ if(bIsTraceOn)TheApplication().Trace(this.Name() + " Init Error: " + e.message); throw(e); } finally{ //Do nothing } }

Abo MOCCA SCM
Init
function Init (Inputs, Outputs){ /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking Initialize the BC fields *****************************************************************/ try{ Outputs.SetProperty(TARGET_ABO_VBC, ""); Outputs.SetProperty(TARGET_ABO_NAME_VBC, ""); Outputs.SetProperty(FEE_VBC, ""); } catch(e){ if(bIsTraceOn)TheApplication().Trace(this.Name() + " Init Error: " + e.message); throw(e); } finally{ //Do nothing } }

Abo MOCCA SCM
Query
function Query(Inputs, Outputs){ /************************************************************************************************** * Function: Query in BusService "Appointments Slots VBC SCM" * Author : TGDSEAI1 * Purpose : CTM: Appointment Booking Call the EAI WS and process the response to display in VBC * Date : 03.08.2010 **************************************************************************************************/ //Declare variables var wsInputs:PropertySet; var wsOutputs:PropertySet; var bsCallWFGetAbos:Service; var strMSISDN; var strExecDate; var strSegment; var strLang; var BO; var BC; // BEGIN - 22.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" var dtToday = new Date; var nYearToday:Number; var sMonthToday:String; var sDayToday:String; var dtBirthDay; var nYearBD:Number; var sMonthBD:String; var sDayBD:String; var nAgeInYears:Number; var strAgeInYears:String; // END - 22.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" try{ BO = TheApplication().ActiveBusObject(); BC = BO.GetBusComp("Service Request"); strMSISDN = BC.GetFieldValue("MSISDN Take Over SCM"); strExecDate = BC.GetFieldValue("Calc Commit Time"); //BEGIN - OneCRM - TGDPADA4 - 2010.11.13 - Defect 27845 //strSegment = BC.GetFieldValue("Account Grobsegment SCM"); strSegment = BC.GetFieldValue("Calculated Account Grobsegment SCM"); //END - OneCRM - TGDPADA4 - 2010.11.13 - Defect 27845 strLang = BC.GetFieldValue("Language"); //TGDBLRO4 07.10.2010: Added for Defect 27859 if ((strMSISDN == "") || (strExecDate == "") || (strSegment == "") || (strLang == "")) { oApp.RaiseError("TOAC Order Not Configured"); } // BEGIN - 22.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" // Calculate age in Years nYearToday = dtToday.getFullYear(); sMonthToday = ToString(dtToday.getMonth() + 1); if (sMonthToday.length == 1) {sMonthToday = "0" + sMonthToday;} sDayToday = ToString(dtToday.getDate()); if (sMonthToday.length == 1) {sMonthToday = "0" + sMonthToday;} dtBirthDay = BC.GetFieldValue("Account Primary Contact Birth Date SCM"); if ( dtBirthDay == "" ) { nAgeInYears = null; strAgeInYears = ""; } else { nYearBD = parseInt(dtBirthDay.substr(6,4)); sMonthBD = dtBirthDay.substr(0,2); sDayBD = dtBirthDay.substr(3,2); if (( sMonthToday + sDayToday ) < ( sMonthBD + sDayBD )) { nAgeInYears = nYearToday - nYearBD - 1; } else { nAgeInYears = nYearToday - nYearBD; } strAgeInYears = nAgeInYears.toString(); } if (bIsTraceOn) { TheApplication().Trace(this.Name() + " ... Today: " + sDayToday + sMonthToday + nYearToday ); TheApplication().Trace(this.Name() + " ... BirthDay: " + sDayBD + sMonthBD + nYearBD ); TheApplication().Trace(this.Name() + " ... AgeInYears: " + nAgeInYears ); TheApplication().Trace(this.Name() + " ... AgeInYears: " + strAgeInYears ); } // END - 22.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" // Initialize variables wsInputs = TheApplication().NewPropertySet(); wsOutputs = TheApplication().NewPropertySet(); wsInputs.SetProperty("number", strMSISDN); wsInputs.SetProperty("mainSegment", strSegment); wsInputs.SetProperty("executionDate", strExecDate); wsInputs.SetProperty("employeeLanguage", strLang); // BEGIN - 23.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" wsInputs.SetProperty("age", strAgeInYears); // END - 23.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" //Call EAI Service to getAbos bsCallWFGetAbos = TheApplication().GetService("EAI Subscription SCM"); bsCallWFGetAbos.InvokeMethod("getValidAbos", wsInputs,wsOutputs); //Go trough records returned by the EAI BS and process them one by one returnTransformedAbos(wsOutputs, Outputs); return(Outputs); } catch(e) { if(bIsTraceOn) TheApplication().Trace(this.Name() + " Query method. Error: " + e.message); //Set the Output to empty O

Abo MOCCA SCM
Query
function Query(Inputs, Outputs){ /************************************************************************************************** * Function: Query in BusService "Appointments Slots VBC SCM" * Author : TGDSEAI1 * Purpose : CTM: Appointment Booking Call the EAI WS and process the response to display in VBC * Date : 03.08.2010 **************************************************************************************************/ //Declare variables var wsInputs:PropertySet; var wsOutputs:PropertySet; var bsCallWFGetAbos:Service; var strMSISDN; var strExecDate; var strSegment; var strLang; var BO; var BC; // BEGIN - 22.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" var dtToday = new Date; var nYearToday:Number; var sMonthToday:String; var sDayToday:String; var dtBirthDay; var nYearBD:Number; var sMonthBD:String; var sDayBD:String; var nAgeInYears:Number; var strAgeInYears:String; // END - 22.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" try{ BO = TheApplication().ActiveBusObject(); BC = BO.GetBusComp("Service Request"); strMSISDN = BC.GetFieldValue("MSISDN Take Over SCM"); strExecDate = BC.GetFieldValue("Calc Commit Time"); //BEGIN - OneCRM - TGDPADA4 - 2010.11.13 - Defect 27845 //strSegment = BC.GetFieldValue("Account Grobsegment SCM"); strSegment = BC.GetFieldValue("Calculated Account Grobsegment SCM"); //END - OneCRM - TGDPADA4 - 2010.11.13 - Defect 27845 strLang = BC.GetFieldValue("Language"); //TGDBLRO4 07.10.2010: Added for Defect 27859 if ((strMSISDN == "") || (strExecDate == "") || (strSegment == "") || (strLang == "")) { oApp.RaiseError("TOAC Order Not Configured"); } // BEGIN - 22.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" // Calculate age in Years nYearToday = dtToday.getFullYear(); sMonthToday = ToString(dtToday.getMonth() + 1); if (sMonthToday.length == 1) {sMonthToday = "0" + sMonthToday;} sDayToday = ToString(dtToday.getDate()); if (sMonthToday.length == 1) {sMonthToday = "0" + sMonthToday;} dtBirthDay = BC.GetFieldValue("Account Primary Contact Birth Date SCM"); if ( dtBirthDay == "" ) { nAgeInYears = null; strAgeInYears = ""; } else { nYearBD = parseInt(dtBirthDay.substr(6,4)); sMonthBD = dtBirthDay.substr(0,2); sDayBD = dtBirthDay.substr(3,2); if (( sMonthToday + sDayToday ) < ( sMonthBD + sDayBD )) { nAgeInYears = nYearToday - nYearBD - 1; } else { nAgeInYears = nYearToday - nYearBD; } strAgeInYears = nAgeInYears.toString(); } if (bIsTraceOn) { TheApplication().Trace(this.Name() + " ... Today: " + sDayToday + sMonthToday + nYearToday ); TheApplication().Trace(this.Name() + " ... BirthDay: " + sDayBD + sMonthBD + nYearBD ); TheApplication().Trace(this.Name() + " ... AgeInYears: " + nAgeInYears ); TheApplication().Trace(this.Name() + " ... AgeInYears: " + strAgeInYears ); } // END - 22.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" // Initialize variables wsInputs = TheApplication().NewPropertySet(); wsOutputs = TheApplication().NewPropertySet(); wsInputs.SetProperty("number", strMSISDN); wsInputs.SetProperty("mainSegment", strSegment); wsInputs.SetProperty("executionDate", strExecDate); wsInputs.SetProperty("employeeLanguage", strLang); // BEGIN - 23.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" wsInputs.SetProperty("age", strAgeInYears); // END - 23.08.2011 - TGDSTER2 - CR770 "Changes Taking Over Process" //Call EAI Service to getAbos bsCallWFGetAbos = TheApplication().GetService("EAI Subscription SCM"); bsCallWFGetAbos.InvokeMethod("getValidAbos", wsInputs,wsOutputs); //Go trough records returned by the EAI BS and process them one by one returnTransformedAbos(wsOutputs, Outputs); return(Outputs); } catch(e) { if(bIsTraceOn) TheApplication().Trace(this.Name() + " Query method. Error: " + e.message); //Set the Output to empty O

Abo MOCCA SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking: BS for the VBC , Appointment Slots VBC SCM to initialize and fill the BC with data from ** the external WS call *****************************************************************/ switch (MethodName) { case("Init"): Init(Inputs, Outputs); break; case("Query"): Query(Inputs,Outputs); break; case "AboGetValidate": AboGetValidate (Inputs, Outputs); break; default: break; } return (CancelOperation); }

Abo MOCCA SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking: BS for the VBC , Appointment Slots VBC SCM to initialize and fill the BC with data from ** the external WS call *****************************************************************/ switch (MethodName) { case("Init"): Init(Inputs, Outputs); break; case("Query"): Query(Inputs,Outputs); break; case "AboGetValidate": AboGetValidate (Inputs, Outputs); break; default: break; } return (CancelOperation); }

Abo MOCCA SCM
createDummyRecord
function createDummyRecord(){ /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Function createDummyRecord ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking creates a dummy appointment booking record *****************************************************************/ //Variable declarations var pOutputRecord:PropertySet; try{ //Initialize pOutputRecord = TheApplication().NewPropertySet(); //Set all the record with stars pOutputRecord.SetProperty(TARGET_ABO_VBC, "472"); pOutputRecord.SetProperty(TARGET_ABO_NAME_VBC, "NATEL business basic"); pOutputRecord.SetProperty(FEE_VBC,"23"); // TGDDERO7, 31.05.2011, move line behind finally statement // return (pOutputRecord); } catch(e){ if(bIsTraceOn) TheApplication().Trace(this.Name() + " CreateDummyRecord. Error: " + e.message); throw(e); } finally{ //Variable destruction // TGDDERO7, 31.05.2011, do not destroy // pOutputRecord = null; } // TGDDERO7, 31.05.2011, move line behind finally statement return (pOutputRecord); }

Abo MOCCA SCM
createDummyRecord
function createDummyRecord(){ /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Function createDummyRecord ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking creates a dummy appointment booking record *****************************************************************/ //Variable declarations var pOutputRecord:PropertySet; try{ //Initialize pOutputRecord = TheApplication().NewPropertySet(); //Set all the record with stars pOutputRecord.SetProperty(TARGET_ABO_VBC, "472"); pOutputRecord.SetProperty(TARGET_ABO_NAME_VBC, "NATEL business basic"); pOutputRecord.SetProperty(FEE_VBC,"23"); // TGDDERO7, 31.05.2011, move line behind finally statement // return (pOutputRecord); } catch(e){ if(bIsTraceOn) TheApplication().Trace(this.Name() + " CreateDummyRecord. Error: " + e.message); throw(e); } finally{ //Variable destruction // TGDDERO7, 31.05.2011, do not destroy // pOutputRecord = null; } // TGDDERO7, 31.05.2011, move line behind finally statement return (pOutputRecord); }

Abo MOCCA SCM
createErrorRecord
function createErrorRecord(strError){ /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Function createDummyRecord ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking creates a dummy appointment to display error *****************************************************************/ //Variable declarations var pOutputRecord:PropertySet; try{ //Initialize pOutputRecord = TheApplication().NewPropertySet(); //Set slot id with stars -> disable the button on the Applet pOutputRecord.SetProperty(TARGET_ABO_VBC, STARS); //Set Rank field with the error message pOutputRecord.SetProperty(TARGET_ABO_NAME_VBC, strError); //Set rest of the fields with the ERROR string pOutputRecord.SetProperty(FEE_VBC, ERROR_VBC) // TGDDERO7, 31.05.2011, move line behind finally statement // return (pOutputRecord); } catch(e){ if(bIsTraceOn) TheApplication().Trace(this.Name() + " CreateDummyRecord. Error: " + e.message); throw(e); } finally{ //Variable destruction // TGDDERO7, 31.05.2011, do not destroy // pOutputRecord = null; } // TGDDERO7, 31.05.2011, move line behind finally statement return (pOutputRecord); }

Abo MOCCA SCM
createErrorRecord
function createErrorRecord(strError){ /***************************************************************** ** Bussiness Service: Appointment Slots VBC SCM ** Function createDummyRecord ** Created: 03.08.2010 ** Created By: TGDSEAI1 ** Description: CTM: Appointment Booking creates a dummy appointment to display error *****************************************************************/ //Variable declarations var pOutputRecord:PropertySet; try{ //Initialize pOutputRecord = TheApplication().NewPropertySet(); //Set slot id with stars -> disable the button on the Applet pOutputRecord.SetProperty(TARGET_ABO_VBC, STARS); //Set Rank field with the error message pOutputRecord.SetProperty(TARGET_ABO_NAME_VBC, strError); //Set rest of the fields with the ERROR string pOutputRecord.SetProperty(FEE_VBC, ERROR_VBC) // TGDDERO7, 31.05.2011, move line behind finally statement // return (pOutputRecord); } catch(e){ if(bIsTraceOn) TheApplication().Trace(this.Name() + " CreateDummyRecord. Error: " + e.message); throw(e); } finally{ //Variable destruction // TGDDERO7, 31.05.2011, do not destroy // pOutputRecord = null; } // TGDDERO7, 31.05.2011, move line behind finally statement return (pOutputRecord); }

Abo MOCCA SCM
getHierElement
function getHierElement(psElement, sPath) { /*************************************************************************************************** ** Author: Jan Hengst ** Date: 30.08.2010 ** Descr: Returns child property set identified by path. The path consists of property set types ** which are used to traverse parent/child/grandchild .. property sets until the indicated ** element is found. Cardinality must be one, multiple children with the same type cannot ** be identified. ** Params: psElement - hierarchical property set containing child property set ** sPath - forward slash-separated string containing property set types ** Returns: child property set or null if child ps was not found ***************************************************************************************************/ var psCurrElmt:PropertySet; try { var iChildCount:Number; var bElementFound:bool; var aHierarchy:Array = sPath.split("/"); psCurrElmt = psElement; for(var i:Number = 0; i < aHierarchy.length; i++) { iChildCount = psCurrElmt.GetChildCount(); bElementFound = false; for(var j:Number = 0; j < iChildCount; j++) { if (bIsTraceOn) oApp.Trace(Name() + ".getHierElement: current type " + psCurrElmt.GetChild(j).GetType()); if(psCurrElmt.GetChild(j).GetType() == aHierarchy[i]) { if (bIsTraceOn) oApp.Trace(Name() + ".getHierElement: found " + aHierarchy[i]); psCurrElmt = psCurrElmt.GetChild(j); // set child as next current element bElementFound = true; break; } } if(!bElementFound) { if (bIsTraceOn) oApp.Trace(Name() + ".getHierElement:" + aHierarchy[i] + " not found"); return; // return null if hierarchy doesn't match } } return psCurrElmt; } finally { psCurrElmt = null; aHierarchy = null; } }

Abo MOCCA SCM
getHierElement
function getHierElement(psElement, sPath) { /*************************************************************************************************** ** Author: Jan Hengst ** Date: 30.08.2010 ** Descr: Returns child property set identified by path. The path consists of property set types ** which are used to traverse parent/child/grandchild .. property sets until the indicated ** element is found. Cardinality must be one, multiple children with the same type cannot ** be identified. ** Params: psElement - hierarchical property set containing child property set ** sPath - forward slash-separated string containing property set types ** Returns: child property set or null if child ps was not found ***************************************************************************************************/ var psCurrElmt:PropertySet; try { var iChildCount:Number; var bElementFound:bool; var aHierarchy:Array = sPath.split("/"); psCurrElmt = psElement; for(var i:Number = 0; i < aHierarchy.length; i++) { iChildCount = psCurrElmt.GetChildCount(); bElementFound = false; for(var j:Number = 0; j < iChildCount; j++) { if (bIsTraceOn) oApp.Trace(Name() + ".getHierElement: current type " + psCurrElmt.GetChild(j).GetType()); if(psCurrElmt.GetChild(j).GetType() == aHierarchy[i]) { if (bIsTraceOn) oApp.Trace(Name() + ".getHierElement: found " + aHierarchy[i]); psCurrElmt = psCurrElmt.GetChild(j); // set child as next current element bElementFound = true; break; } } if(!bElementFound) { if (bIsTraceOn) oApp.Trace(Name() + ".getHierElement:" + aHierarchy[i] + " not found"); return; // return null if hierarchy doesn't match } } return psCurrElmt; } finally { psCurrElmt = null; aHierarchy = null; } }

Abo MOCCA SCM
processRecord
function processRecord(wsRecord){ /************************************************************************************************** * Service : Appointments Slots VBC SCM * Function: processRecord * Author : TGDJUVI1 * Purpose : MBG Autmatisierung: Abos Booking this method will return a property set with the structure in the VBC * Date : 03.08.2010 **************************************************************************************************/ //Variable Declarations var pInputs:PropertySet; var pOutputRecord:PropertySet; var psPenalties:PropertySet; try{ //Initialize variables pInputs = TheApplication().NewPropertySet(); pOutputRecord = TheApplication().NewPropertySet(); //Fields mapped directly from EAI return pOutputRecord.SetProperty(TARGET_ABO_VBC, wsRecord.GetProperty("id")); pOutputRecord.SetProperty(TARGET_ABO_NAME_VBC, wsRecord.GetProperty("name")); psPenalties = getHierElement(wsRecord, "ListOfpenalties/penalties"); if(psPenalties == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } pOutputRecord.SetProperty(FEE_VBC, psPenalties.GetProperty("totalPenalties")); // TGDDERO7, 31.05.2011, move line behind finally statement // return(pOutputRecord); } catch(e){ if(bIsTraceOn) TheApplication().Trace(this.Name() + " ProcessRecord function. Error: " + e.message); throw(e); } finally{ //Variable Destruction pInputs = null; psPenalties = null; // TGDDERO7, 31.05.2011, do not destroy // pOutputRecord = null; } // TGDDERO7, 31.05.2011, move line behind finally statement return(pOutputRecord); }

Abo MOCCA SCM
processRecord
function processRecord(wsRecord){ /************************************************************************************************** * Service : Appointments Slots VBC SCM * Function: processRecord * Author : TGDJUVI1 * Purpose : MBG Autmatisierung: Abos Booking this method will return a property set with the structure in the VBC * Date : 03.08.2010 **************************************************************************************************/ //Variable Declarations var pInputs:PropertySet; var pOutputRecord:PropertySet; var psPenalties:PropertySet; try{ //Initialize variables pInputs = TheApplication().NewPropertySet(); pOutputRecord = TheApplication().NewPropertySet(); //Fields mapped directly from EAI return pOutputRecord.SetProperty(TARGET_ABO_VBC, wsRecord.GetProperty("id")); pOutputRecord.SetProperty(TARGET_ABO_NAME_VBC, wsRecord.GetProperty("name")); psPenalties = getHierElement(wsRecord, "ListOfpenalties/penalties"); if(psPenalties == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } pOutputRecord.SetProperty(FEE_VBC, psPenalties.GetProperty("totalPenalties")); // TGDDERO7, 31.05.2011, move line behind finally statement // return(pOutputRecord); } catch(e){ if(bIsTraceOn) TheApplication().Trace(this.Name() + " ProcessRecord function. Error: " + e.message); throw(e); } finally{ //Variable Destruction pInputs = null; psPenalties = null; // TGDDERO7, 31.05.2011, do not destroy // pOutputRecord = null; } // TGDDERO7, 31.05.2011, move line behind finally statement return(pOutputRecord); }

Abo MOCCA SCM
returnTransformedAbos
function returnTransformedAbos(wsOutput, Outputs){ /************************************************************************************************** * Service : ABO MOCCA SCM * Function : getTargetRestoreTime * Author : TGDJUVI1 * Purpose : MBG Autmatisierung: Abos Booking this method will return a property set with the structure in the VBC * Date : 10.09.2010 * Input : wsOutput: Property set with the EAI Output ****************psReturnOutput**********************************************************************************/ //Variable declarations var psInputs:PropertySet; var psReturnRecord:PropertySet; var psListOfAbos:PropertySet; var psListOfType:PropertySet; var psListOfListAbos:PropertySet; var psListOfErrors:PropertySet; var psErrors:PropertySet; var intRecords; var intIndex; var strErrorCode; var strErrorMessage = ""; try{ // variable initialization psInputs = TheApplication().NewPropertySet(); psListOfAbos = TheApplication().NewPropertySet(); psReturnRecord = TheApplication().NewPropertySet(); psErrors = TheApplication().NewPropertySet(); psErrors = getHierElement(wsOutput, "ListOfgetAvailableSubscriptionTypesResMsg"); if(psErrors == null) { // WS response msg is reqd oApp.RaiseErrorText(Name() + ".Error: response message not found"); } strErrorCode = psErrors.GetProperty("Error Code"); strErrorMessage = psErrors.GetProperty("Error Message"); if (strErrorCode != "0") { oApp.RaiseErrorText(Name() + psErrors.GetProperty("Error Message")); } else { psInputs = getHierElement(wsOutput, "ListOfgetAvailableSubscriptionTypesResMsg/getAvailableSubscriptionTypesResMsg"); if(psInputs == null) { // WS response msg is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesResMsg: response message not found"); } psListOfType = getHierElement(psInputs, "ListOfgetAvailableSubscriptionTypesRes/getAvailableSubscriptionTypesRes"); if(psListOfType == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } psListOfErrors = getHierElement(psListOfType, "ListOfconcatenatedRemark/concatenatedRemark"); if(psListOfErrors == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } strErrorCode = psListOfErrors.GetProperty("code"); strErrorMessage = psListOfErrors.GetProperty("message"); if ((strErrorCode == 0) || (strErrorCode == "") || (strErrorCode == null)) { psListOfListAbos = getHierElement(psListOfType, "ListOfavailableSubscriptionTypes/availableSubscriptionTypes"); if(psListOfListAbos == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } psListOfAbos = getHierElement(psListOfListAbos, "ListOfavailableSubscriptionType"); if(psListOfAbos == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } //Process each abo one by one callin function processRecord intRecords = psListOfAbos.GetChildCount(); for(intIndex = 0; intIndex<intRecords;intIndex++) { psReturnRecord = processRecord(psListOfAbos.GetChild(intIndex)); Outputs.AddChild(psReturnRecord);//Add the current record }//End for } else { oApp.RaiseErrorText(Name() + strErrorMessage); } }// End Else }//End try catch(e){ if(bIsTraceOn) TheApplication().Trace(this.Name() + " returnTransformedSlots Error:" + e.message); throw(e); } finally{ //variable destruction psInputs = null; psReturnRecord = null; psListOfAbos = null; psListOfType = null; psListOfListAbos = null; psListOfErrors = null; psErrors = null; intRecords = null; intIndex = null; } }

Abo MOCCA SCM
returnTransformedAbos
function returnTransformedAbos(wsOutput, Outputs){ /************************************************************************************************** * Service : ABO MOCCA SCM * Function : getTargetRestoreTime * Author : TGDJUVI1 * Purpose : MBG Autmatisierung: Abos Booking this method will return a property set with the structure in the VBC * Date : 10.09.2010 * Input : wsOutput: Property set with the EAI Output ****************psReturnOutput**********************************************************************************/ //Variable declarations var psInputs:PropertySet; var psReturnRecord:PropertySet; var psListOfAbos:PropertySet; var psListOfType:PropertySet; var psListOfListAbos:PropertySet; var psListOfErrors:PropertySet; var psErrors:PropertySet; var intRecords; var intIndex; var strErrorCode; var strErrorMessage = ""; try{ // variable initialization psInputs = TheApplication().NewPropertySet(); psListOfAbos = TheApplication().NewPropertySet(); psReturnRecord = TheApplication().NewPropertySet(); psErrors = TheApplication().NewPropertySet(); psErrors = getHierElement(wsOutput, "ListOfgetAvailableSubscriptionTypesResMsg"); if(psErrors == null) { // WS response msg is reqd oApp.RaiseErrorText(Name() + ".Error: response message not found"); } strErrorCode = psErrors.GetProperty("Error Code"); strErrorMessage = psErrors.GetProperty("Error Message"); if (strErrorCode != "0") { oApp.RaiseErrorText(Name() + psErrors.GetProperty("Error Message")); } else { psInputs = getHierElement(wsOutput, "ListOfgetAvailableSubscriptionTypesResMsg/getAvailableSubscriptionTypesResMsg"); if(psInputs == null) { // WS response msg is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesResMsg: response message not found"); } psListOfType = getHierElement(psInputs, "ListOfgetAvailableSubscriptionTypesRes/getAvailableSubscriptionTypesRes"); if(psListOfType == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } psListOfErrors = getHierElement(psListOfType, "ListOfconcatenatedRemark/concatenatedRemark"); if(psListOfErrors == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } strErrorCode = psListOfErrors.GetProperty("code"); strErrorMessage = psListOfErrors.GetProperty("message"); if ((strErrorCode == 0) || (strErrorCode == "") || (strErrorCode == null)) { psListOfListAbos = getHierElement(psListOfType, "ListOfavailableSubscriptionTypes/availableSubscriptionTypes"); if(psListOfListAbos == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } psListOfAbos = getHierElement(psListOfListAbos, "ListOfavailableSubscriptionType"); if(psListOfAbos == null) { // WS response is reqd oApp.RaiseErrorText(Name() + ".getAvailableSubscriptionTypesRes: response not found"); } //Process each abo one by one callin function processRecord intRecords = psListOfAbos.GetChildCount(); for(intIndex = 0; intIndex<intRecords;intIndex++) { psReturnRecord = processRecord(psListOfAbos.GetChild(intIndex)); Outputs.AddChild(psReturnRecord);//Add the current record }//End for } else { oApp.RaiseErrorText(Name() + strErrorMessage); } }// End Else }//End try catch(e){ if(bIsTraceOn) TheApplication().Trace(this.Name() + " returnTransformedSlots Error:" + e.message); throw(e); } finally{ //variable destruction psInputs = null; psReturnRecord = null; psListOfAbos = null; psListOfType = null; psListOfListAbos = null; psListOfErrors = null; psErrors = null; intRecords = null; intIndex = null; } }

Abochange SCM
(declarations)
var oApp; var bIsTraceOn;

Abochange SCM
(declarations)
var oApp; var bIsTraceOn;

Abochange SCM
RefreshProduct
function RefreshProduct(Inputs,Outputs) { var sOrderId; var sOrderProdId; var sAssetId; var sAssetProdId; var oBOOLI; var oBCOLI; var oBOAss; var oBCAss; try { sOrderId = Inputs.GetProperty("Order Id"); oBOOLI = oApp.GetBusObject("Order Item"); oBCOLI = oBOOLI.GetBusComp("Order Entry - Line Items (Simple)"); oBCOLI.SetViewMode(AllView); oBCOLI.ClearToQuery(); oBCOLI.ActivateField("Product Id"); oBCOLI.ActivateField("Asset Id"); oBCOLI.SetSearchExpr("[Order Header Id]='"+sOrderId+"' AND [Root Order Item Id]=[Id]"); oBCOLI.ExecuteQuery(ForwardBackward); if (isRecord(oBCOLI)) { sOrderProdId = oBCOLI.GetFieldValue("Product Id"); sAssetId = oBCOLI.GetFieldValue("Asset Id"); if (bIsTraceOn) oApp.Trace("Abochange SCM - RefreshProduct: sAssetId=" + sAssetId); if (bIsTraceOn) oApp.Trace("Abochange SCM - RefreshProduct: sOrderProdId=" + sOrderProdId); oBOAss = oApp.GetBusObject("Asset Management"); oBCAss = oBOAss.GetBusComp("Asset Mgmt - Asset - Header"); oBCAss.SetViewMode(AllView); oBCAss.ClearToQuery(); oBCAss.ActivateField("Product Id"); oBCAss.SetSearchSpec("Id", sAssetId); oBCAss.ExecuteQuery(ForwardBackward); if (isRecord(oBCAss)) { sAssetProdId = oBCAss.GetFieldValue("Product Id"); if (bIsTraceOn) oApp.Trace("Abochange SCM - RefreshProduct: sAssetProdId=" + sAssetProdId); if (sOrderProdId != sAssetProdId) { oBCOLI.SetFieldValue("Product Id", sAssetProdId); oBCOLI.WriteRecord(); if (bIsTraceOn) oApp.Trace("Abochange SCM - RefreshProduct: WriteRecord()"); } } } } finally { oBCAss = null; oBOAss = null; oBCOLI = null; oBOOLI = null; } }

Abochange SCM
RefreshProduct
function RefreshProduct(Inputs,Outputs) { var sOrderId; var sOrderProdId; var sAssetId; var sAssetProdId; var oBOOLI; var oBCOLI; var oBOAss; var oBCAss; try { sOrderId = Inputs.GetProperty("Order Id"); oBOOLI = oApp.GetBusObject("Order Item"); oBCOLI = oBOOLI.GetBusComp("Order Entry - Line Items (Simple)"); oBCOLI.SetViewMode(AllView); oBCOLI.ClearToQuery(); oBCOLI.ActivateField("Product Id"); oBCOLI.ActivateField("Asset Id"); oBCOLI.SetSearchExpr("[Order Header Id]='"+sOrderId+"' AND [Root Order Item Id]=[Id]"); oBCOLI.ExecuteQuery(ForwardBackward); if (isRecord(oBCOLI)) { sOrderProdId = oBCOLI.GetFieldValue("Product Id"); sAssetId = oBCOLI.GetFieldValue("Asset Id"); if (bIsTraceOn) oApp.Trace("Abochange SCM - RefreshProduct: sAssetId=" + sAssetId); if (bIsTraceOn) oApp.Trace("Abochange SCM - RefreshProduct: sOrderProdId=" + sOrderProdId); oBOAss = oApp.GetBusObject("Asset Management"); oBCAss = oBOAss.GetBusComp("Asset Mgmt - Asset - Header"); oBCAss.SetViewMode(AllView); oBCAss.ClearToQuery(); oBCAss.ActivateField("Product Id"); oBCAss.SetSearchSpec("Id", sAssetId); oBCAss.ExecuteQuery(ForwardBackward); if (isRecord(oBCAss)) { sAssetProdId = oBCAss.GetFieldValue("Product Id"); if (bIsTraceOn) oApp.Trace("Abochange SCM - RefreshProduct: sAssetProdId=" + sAssetProdId); if (sOrderProdId != sAssetProdId) { oBCOLI.SetFieldValue("Product Id", sAssetProdId); oBCOLI.WriteRecord(); if (bIsTraceOn) oApp.Trace("Abochange SCM - RefreshProduct: WriteRecord()"); } } } } finally { oBCAss = null; oBOAss = null; oBCOLI = null; oBOOLI = null; } }

Abochange SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { oApp = TheApplication(); bIsTraceOn = oApp.isTraceON; try { switch (MethodName) { case "Refresh Product": RefreshProduct(Inputs,Outputs); break; } } catch(e) { if (bIsTraceOn) oApp.Trace("Abochange SCM - PreInvokeMethod: " + e.toString()); throw e; } finally { oApp = null; } return (CancelOperation); }

Abochange SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { oApp = TheApplication(); bIsTraceOn = oApp.isTraceON; try { switch (MethodName) { case "Refresh Product": RefreshProduct(Inputs,Outputs); break; } } catch(e) { if (bIsTraceOn) oApp.Trace("Abochange SCM - PreInvokeMethod: " + e.toString()); throw e; } finally { oApp = null; } return (CancelOperation); }

Abochange SCM
isRecord
function isRecord(oBC) { var bBack; var sId; try { sId = oBC.GetFieldValue("Id"); bBack = true; } catch(e) { bBack = false; } return (bBack); }

Abochange SCM
isRecord
function isRecord(oBC) { var bBack; var sId; try { sId = oBC.GetFieldValue("Id"); bBack = true; } catch(e) { bBack = false; } return (bBack); }

Abochange SCS
(declarations)
var oApp; var bIsTraceOn;

Abochange SCS
(declarations)
var oApp; var bIsTraceOn;

Abochange SCS
GenerateBatchFile
function GenerateBatchFile(sPath, Outputs) { /*************************************************************************************** ** Name: GenerateBatchFile ** Created: 28.6.2007 ** Created By: Petra Graber ** Description: Generates a batch file for MOCCA ** with all closed Retention orders from Shop and POS which contain ** a Abochange. ** abochange is executed ** Parameters: ** strPath,input Optional path where to store file ** Important: file has to be created one day before the abo change should be executed!! ** ** Update: TGDSCTHO, 20070912 ** Changed file name according to MOCCA design *****************************************************************************************/ //BEGIN OneCRM R1 SCM 2009-02-26 TGDHIAN4 - BL2: New vars to retrieve BC data. var sTarget; var sRateplan; var sBundles; var sDealerId; //END OneCRM R1 SCM 2009-02-26 TGDHIAN4 - BL2: New vars to retrieve BC data. var boAboChng; var bcAboChng; var sFileNameOut; var sPathOut; var dToday; var sExecDate; var sExecDateFile; var sExec; var oFile; var iCounter; var bIsRecord; // 03.04.2012; tgdstre0; defect 49217 var sOrderDate; var dOrderDate; try { //search all abo-change-orders which are not exported yet. sFileNameOut = ""; sPathOut = ""; dToday = new Date; sExecDate = Clib.rsprintf("%02d/%02d/%04d", dToday.getMonth()+1, dToday.getDate(), dToday.getFullYear()); sExecDateFile = ""; Clib.strftime(sExecDateFile, "%Y_%m_%d_%H_%M", Clib.localtime(Clib.time()) ); sExec = Clib.rsprintf("%02d.%02d.%04d", dToday.getDate(), dToday.getMonth()+1, dToday.getFullYear()); iCounter = 0; if (sPath.length != 0) { sPathOut = sPath; } else { sPathOut = GetPath(); } sFileNameOut = sPathOut +sExecDateFile+"_REIS"+".txt"; //TGDSCTHO, 20070912 changed boAboChng = TheApplication().GetBusObject("Abochange MOCCA SCS"); bcAboChng = boAboChng.GetBusComp("Abochange MOCCA SCS"); with (bcAboChng) { ActivateField("Abostufe"); //OneCRM R1 SCM 2009-08-24 TGDHIAN4 - BL2: Changed retrieved and written field "Account Number Calc" to "Asset Reference Number SCM" due to Issue 12467 //ActivateField("Account Number Calc"); ActivateField("Asset Reference Number SCM"); ActivateField("Bundles"); ActivateField("Dealer Id"); ActivateField("Exec Date"); ActivateField("Exec Date Calc"); ActivateField("Konsolidierung MM"); ActivateField("MMV"); ActivateField("MSISDN Calc"); ActivateField("Rateplan"); ActivateField("Status"); ActivateField("Target # SCS"); // 03.04.2012; tgdstre0; defect 49217 ActivateField("Mindestvertragsdauer SCM"); ActivateField("Kuendigungsfrist SCM"); ActivateField("Rollover SCM"); ActivateField("Datum SCM"); SetViewMode(AllView); ClearToQuery(); SetSearchExpr("[Status] IS NULL OR [Status] <> 'Exported'"); ExecuteQuery(ForwardOnly); bIsRecord = FirstRecord(); if (bIsRecord) { //create file oFile = Clib.fopen(sFileNameOut, "at+"); //reformat exec date while(bIsRecord) { sTarget=GetFieldValue("Target # SCS"); sTarget = sTarget.replace("BSC:SUB:",""); sRateplan=GetFieldValue("Rateplan"); sBundles=GetFieldValue("Bundles"); sDealerId=GetFieldValue("Dealer Id"); // 03.04.2012; tgdstre0; defect 49217 sOrderDate = GetFieldValue("Datum SCM"); dOrderDate = new Date (sOrderDate); sOrderDate = Clib.rsprintf("%02d%02d%04d", dOrderDate.getDate(), dOrderDate.getMonth()+1, dOrderDate.getFullYear()); Clib.fputs(GetFieldValue("Asset Reference Number SCM") +";" + GetFieldValue("MSISDN Calc") + ";" + sTarget + ";" + GetFieldValue("Mindestvertragsdauer SCM") + "/" + GetFieldValue("Kuendigungsfrist SCM") + "/" + GetFieldValue("Rollover SCM") + ";" + GetFieldValue("Abostufe") + ";" + sExec + ";" + sRateplan + ";" + GetFieldValue("Konsolidierung MM") + ";" + sBundles + ";" + sDealerId + ";"

Abochange SCS
GenerateBatchFile
function GenerateBatchFile(sPath, Outputs) { /*************************************************************************************** ** Name: GenerateBatchFile ** Created: 28.6.2007 ** Created By: Petra Graber ** Description: Generates a batch file for MOCCA ** with all closed Retention orders from Shop and POS which contain ** a Abochange. ** abochange is executed ** Parameters: ** strPath,input Optional path where to store file ** Important: file has to be created one day before the abo change should be executed!! ** ** Update: TGDSCTHO, 20070912 ** Changed file name according to MOCCA design *****************************************************************************************/ //BEGIN OneCRM R1 SCM 2009-02-26 TGDHIAN4 - BL2: New vars to retrieve BC data. var sTarget; var sRateplan; var sBundles; var sDealerId; //END OneCRM R1 SCM 2009-02-26 TGDHIAN4 - BL2: New vars to retrieve BC data. var boAboChng; var bcAboChng; var sFileNameOut; var sPathOut; var dToday; var sExecDate; var sExecDateFile; var sExec; var oFile; var iCounter; var bIsRecord; // 03.04.2012; tgdstre0; defect 49217 var sOrderDate; var dOrderDate; try { //search all abo-change-orders which are not exported yet. sFileNameOut = ""; sPathOut = ""; dToday = new Date; sExecDate = Clib.rsprintf("%02d/%02d/%04d", dToday.getMonth()+1, dToday.getDate(), dToday.getFullYear()); sExecDateFile = ""; Clib.strftime(sExecDateFile, "%Y_%m_%d_%H_%M", Clib.localtime(Clib.time()) ); sExec = Clib.rsprintf("%02d.%02d.%04d", dToday.getDate(), dToday.getMonth()+1, dToday.getFullYear()); iCounter = 0; if (sPath.length != 0) { sPathOut = sPath; } else { sPathOut = GetPath(); } sFileNameOut = sPathOut +sExecDateFile+"_REIS"+".txt"; //TGDSCTHO, 20070912 changed boAboChng = TheApplication().GetBusObject("Abochange MOCCA SCS"); bcAboChng = boAboChng.GetBusComp("Abochange MOCCA SCS"); with (bcAboChng) { ActivateField("Abostufe"); //OneCRM R1 SCM 2009-08-24 TGDHIAN4 - BL2: Changed retrieved and written field "Account Number Calc" to "Asset Reference Number SCM" due to Issue 12467 //ActivateField("Account Number Calc"); ActivateField("Asset Reference Number SCM"); ActivateField("Bundles"); ActivateField("Dealer Id"); ActivateField("Exec Date"); ActivateField("Exec Date Calc"); ActivateField("Konsolidierung MM"); ActivateField("MMV"); ActivateField("MSISDN Calc"); ActivateField("Rateplan"); ActivateField("Status"); ActivateField("Target # SCS"); // 03.04.2012; tgdstre0; defect 49217 ActivateField("Mindestvertragsdauer SCM"); ActivateField("Kuendigungsfrist SCM"); ActivateField("Rollover SCM"); ActivateField("Datum SCM"); SetViewMode(AllView); ClearToQuery(); SetSearchExpr("[Status] IS NULL OR [Status] <> 'Exported'"); ExecuteQuery(ForwardOnly); bIsRecord = FirstRecord(); if (bIsRecord) { //create file oFile = Clib.fopen(sFileNameOut, "at+"); //reformat exec date while(bIsRecord) { sTarget=GetFieldValue("Target # SCS"); sTarget = sTarget.replace("BSC:SUB:",""); sRateplan=GetFieldValue("Rateplan"); sBundles=GetFieldValue("Bundles"); sDealerId=GetFieldValue("Dealer Id"); // 03.04.2012; tgdstre0; defect 49217 sOrderDate = GetFieldValue("Datum SCM"); dOrderDate = new Date (sOrderDate); sOrderDate = Clib.rsprintf("%02d%02d%04d", dOrderDate.getDate(), dOrderDate.getMonth()+1, dOrderDate.getFullYear()); Clib.fputs(GetFieldValue("Asset Reference Number SCM") +";" + GetFieldValue("MSISDN Calc") + ";" + sTarget + ";" + GetFieldValue("Mindestvertragsdauer SCM") + "/" + GetFieldValue("Kuendigungsfrist SCM") + "/" + GetFieldValue("Rollover SCM") + ";" + GetFieldValue("Abostufe") + ";" + sExec + ";" + sRateplan + ";" + GetFieldValue("Konsolidierung MM") + ";" + sBundles + ";" + sDealerId + ";"

Abochange SCS
GetPath
function GetPath() { var sDirectory; try { sDirectory = oApp.utils.SCM_RetrieveACV("OVSD Share"); if (sDirectory.lenght == 0) { sDirectory = "/tmp/"; } else { //check whether at end of path there is already a "/" if (sDirectory.charAt(sDirectory.length - 1) != "/") sDirectory += "/"; //Append MOCCA/ sDirectory += "MOCCA/"; } if (bIsTraceOn) oApp.Trace("MOCCA: Path: "+sDirectory); } catch(e) { if (bIsTraceOn) oApp.Trace("Error within GetPath: " + e.toString() ); sDirectory = "/tmp/"; } return (sDirectory); }

Abochange SCS
GetPath
function GetPath() { var sDirectory; try { sDirectory = oApp.utils.SCM_RetrieveACV("OVSD Share"); if (sDirectory.lenght == 0) { sDirectory = "/tmp/"; } else { //check whether at end of path there is already a "/" if (sDirectory.charAt(sDirectory.length - 1) != "/") sDirectory += "/"; //Append MOCCA/ sDirectory += "MOCCA/"; } if (bIsTraceOn) oApp.Trace("MOCCA: Path: "+sDirectory); } catch(e) { if (bIsTraceOn) oApp.Trace("Error within GetPath: " + e.toString() ); sDirectory = "/tmp/"; } return (sDirectory); }

Abochange SCS
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /***************************************************************** ** Name: Service_PreInvokeMethod ** Created: 28.06.2007 ** Created By: Petra Graber ** Description: *****************************************************************/ var strPath; try { oApp = TheApplication(); // TGDSOAN5 4.02.08 bIsTraceOn = oApp.isTraceON; // TGDSOAN5 4.02.08 switch (MethodName) { case "Generate Batch File": // generates the batch file of all abochanges gathered "today" strPath = Inputs.GetProperty("Path"); GenerateBatchFile(strPath, Outputs); break; } } finally { oApp = null; // TGDSOAN5 4.02.08 } return (CancelOperation); }

Abochange SCS
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /***************************************************************** ** Name: Service_PreInvokeMethod ** Created: 28.06.2007 ** Created By: Petra Graber ** Description: *****************************************************************/ var strPath; try { oApp = TheApplication(); // TGDSOAN5 4.02.08 bIsTraceOn = oApp.isTraceON; // TGDSOAN5 4.02.08 switch (MethodName) { case "Generate Batch File": // generates the batch file of all abochanges gathered "today" strPath = Inputs.GetProperty("Path"); GenerateBatchFile(strPath, Outputs); break; } } finally { oApp = null; // TGDSOAN5 4.02.08 } return (CancelOperation); }

Accept Campaign SCM
Accept_Campaign
/* ** @Author TGDESIS1 ** @Date Creation 01.12.2008 ** Accept Campaign for the received Asset and it create a Service Request ** and a order (for that Service Request) if Service Change is 'Y' (Field Has ** Product of Business Component Contact-Prospect Campaign) */ function Accept_Campaign (MethodName,Inputs, Outputs) { try{ var sAsset_Id = Inputs.GetProperty("sAsset_Id"); var parConID = Inputs.GetProperty("parConID"); var sAccepted = Inputs.GetProperty("sAccepted"); var sActivated = Inputs.GetProperty("sActivated"); var numberAsset = Inputs.GetProperty("numberAsset"); var gsAMTName = Inputs.GetProperty("gsAMTName"); var sAMTId = Inputs.GetProperty("sAMTId"); var strInfoCode; var sSRId = ""; var psInput; var psOutput; var bcSR = null; var change_sr; var CampRespBC = TheApplication().ActiveBusObject().GetBusComp("Contact-Prospect Campaign Response"); var campaignBC = TheApplication().ActiveBusObject().GetBusComp("Contact-Prospect Campaigns"); var bcPickBC; var sAccntId; var sSetAssetNumber; var oBCLoV; var bsService; var strCampaingId; var strLanguageCode; if (campaignBC.GetFieldValue("Has Product") == "Y" && sAsset_Id != null && sAsset_Id !="") { // SCM 2009.08.28 TGDRARO6: bring Language from campaingn for PoS Application. if(TheApplication().GetProfileAttr("ApplicationName")== "Siebel eChannel for CME") { strCampaingId = campaignBC.GetFieldValue("Id"); campaignBC.ActivateField("Account Language Calc SCM"); campaignBC.ClearToQuery(); campaignBC.SetSearchSpec("Id", strCampaingId); campaignBC.ExecuteQuery(ForwardOnly); strLanguageCode = campaignBC.GetFieldValue("Account Language Calc SCM"); } // only create sr if asset id is set and campaign has a product bcSR = TheApplication().ActiveBusObject().GetBusComp("Service Request"); //RAL bcSR.ActivateField("Sub-Area"); bcSR.ActivateField("Status"); bcSR.ActivateField("Info Consult CD Not GUI SCM"); // Active only in PoS Application if(TheApplication().GetProfileAttr("ApplicationName")== "Siebel eChannel for CME") { bcSR.ActivateField("SR Language Code SCM"); } //if a sr exists this var will be set to true (cannot change asset when already set) change_sr = false; bcSR.ClearToQuery(); bcSR.SetSearchSpec("Sub-Area", "Contact in Shop"); bcSR.SetSearchSpec("Status", "Open"); bcSR.SetSearchSpec("Created By", TheApplication().LoginId()); bcSR.SetSearchSpec("Asset Id", sAsset_Id); bcSR.ExecuteQuery(ForwardOnly); if (bcSR.FirstRecord()) { TheApplication().Trace("bef. Alter Record"); change_sr = true; } else { TheApplication().Trace("bef. New Record"); bcSR.NewRecord(NewAfter); } //EORAL bcSR.SetFieldValue("Area", "Modification Order Management"); bcSR.SetFieldValue("Sub-Area", "Contract mutation"); bcSR.SetFieldValue("Info Consult CD Not GUI SCM", "Mutation"); // Write Language in PoS Application if(TheApplication().GetProfileAttr("ApplicationName")== "Siebel eChannel for CME") { bcSR.SetFieldValue("SR Language Code SCM", strLanguageCode); } //SSN Start 19.1.2006: Set Retailer in SR if (MethodName == "ButtonOrderShop"){ if (parConID != null && parConID != ""){ bcSR.SetFieldValue("Retailer Id SCM", parConID); TheApplication().Trace("Set Retailer Id " + parConID + " in SR"); } } //RAL if(!change_sr) { //EORAL bcPickBC = bcSR.GetPicklistBusComp("MSISDN SCM"); with (bcPickBC) { ActivateField("Id"); ActivateField("MSISDN SCM"); SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Id", sAsset_Id); ExecuteQuery(ForwardBackward); if(FirstRecord()) { Pick(); } } bcPickBC = null; //RAL } //EORAL bcSR.WriteRecord(); sSRId = bcSR.GetFieldValue("Id"); sAccntId = bcSR.GetFieldValue("Account Id");

Accept Campaign SCM
Accept_Campaign
/* ** @Author TGDESIS1 ** @Date Creation 01.12.2008 ** Accept Campaign for the received Asset and it create a Service Request ** and a order (for that Service Request) if Service Change is 'Y' (Field Has ** Product of Business Component Contact-Prospect Campaign) */ function Accept_Campaign (MethodName,Inputs, Outputs) { try{ var sAsset_Id = Inputs.GetProperty("sAsset_Id"); var parConID = Inputs.GetProperty("parConID"); var sAccepted = Inputs.GetProperty("sAccepted"); var sActivated = Inputs.GetProperty("sActivated"); var numberAsset = Inputs.GetProperty("numberAsset"); var gsAMTName = Inputs.GetProperty("gsAMTName"); var sAMTId = Inputs.GetProperty("sAMTId"); var strInfoCode; var sSRId = ""; var psInput; var psOutput; var bcSR = null; var change_sr; var CampRespBC = TheApplication().ActiveBusObject().GetBusComp("Contact-Prospect Campaign Response"); var campaignBC = TheApplication().ActiveBusObject().GetBusComp("Contact-Prospect Campaigns"); var bcPickBC; var sAccntId; var sSetAssetNumber; var oBCLoV; var bsService; var strCampaingId; var strLanguageCode; if (campaignBC.GetFieldValue("Has Product") == "Y" && sAsset_Id != null && sAsset_Id !="") { // SCM 2009.08.28 TGDRARO6: bring Language from campaingn for PoS Application. if(TheApplication().GetProfileAttr("ApplicationName")== "Siebel eChannel for CME") { strCampaingId = campaignBC.GetFieldValue("Id"); campaignBC.ActivateField("Account Language Calc SCM"); campaignBC.ClearToQuery(); campaignBC.SetSearchSpec("Id", strCampaingId); campaignBC.ExecuteQuery(ForwardOnly); strLanguageCode = campaignBC.GetFieldValue("Account Language Calc SCM"); } // only create sr if asset id is set and campaign has a product bcSR = TheApplication().ActiveBusObject().GetBusComp("Service Request"); //RAL bcSR.ActivateField("Sub-Area"); bcSR.ActivateField("Status"); bcSR.ActivateField("Info Consult CD Not GUI SCM"); // Active only in PoS Application if(TheApplication().GetProfileAttr("ApplicationName")== "Siebel eChannel for CME") { bcSR.ActivateField("SR Language Code SCM"); } //if a sr exists this var will be set to true (cannot change asset when already set) change_sr = false; bcSR.ClearToQuery(); bcSR.SetSearchSpec("Sub-Area", "Contact in Shop"); bcSR.SetSearchSpec("Status", "Open"); bcSR.SetSearchSpec("Created By", TheApplication().LoginId()); bcSR.SetSearchSpec("Asset Id", sAsset_Id); bcSR.ExecuteQuery(ForwardOnly); if (bcSR.FirstRecord()) { TheApplication().Trace("bef. Alter Record"); change_sr = true; } else { TheApplication().Trace("bef. New Record"); bcSR.NewRecord(NewAfter); } //EORAL bcSR.SetFieldValue("Area", "Modification Order Management"); bcSR.SetFieldValue("Sub-Area", "Contract mutation"); bcSR.SetFieldValue("Info Consult CD Not GUI SCM", "Mutation"); // Write Language in PoS Application if(TheApplication().GetProfileAttr("ApplicationName")== "Siebel eChannel for CME") { bcSR.SetFieldValue("SR Language Code SCM", strLanguageCode); } //SSN Start 19.1.2006: Set Retailer in SR if (MethodName == "ButtonOrderShop"){ if (parConID != null && parConID != ""){ bcSR.SetFieldValue("Retailer Id SCM", parConID); TheApplication().Trace("Set Retailer Id " + parConID + " in SR"); } } //RAL if(!change_sr) { //EORAL bcPickBC = bcSR.GetPicklistBusComp("MSISDN SCM"); with (bcPickBC) { ActivateField("Id"); ActivateField("MSISDN SCM"); SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Id", sAsset_Id); ExecuteQuery(ForwardBackward); if(FirstRecord()) { Pick(); } } bcPickBC = null; //RAL } //EORAL bcSR.WriteRecord(); sSRId = bcSR.GetFieldValue("Id"); sAccntId = bcSR.GetFieldValue("Account Id");

Accept Campaign SCM
Delete_Campaign
/* ** @Author TGDESIS1 ** @Date Creation 02.12.2008 ** Delete this campaign associate to Contact if the client Accept ** (completely o partly) the campaign or if he rejects it */ function Delete_Campaign (idCamp){ try{ var bcContact = TheApplication().ActiveBusObject().GetBusComp("Contact-Prospect Campaigns"); var bcAssetContact = TheApplication().ActiveBusObject().GetBusComp("Asset Contact Campaign SCM"); /*with(bcContact){ ClearToQuery(); SetSearchSpec("Id", idCamp); ExecuteQuery(ForwardOnly); DeleteRecord(); } with(bcAssetContact){ ActivateField("Asset Id SCM"); ActivateField("Id"); SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Campaign Contact Id SCM", idCamp); ExecuteQuery(); if(FirstRecord()){ do{ DeleteRecord(); }while(NextRecord()) } }*/ }catch(e){ TheApplication().Trace(this.Name()+"Error: "+e.toString()); throw e; } finally{ bcContact = null; bcAssetContact = null; } }

Accept Campaign SCM
Delete_Campaign
/* ** @Author TGDESIS1 ** @Date Creation 02.12.2008 ** Delete this campaign associate to Contact if the client Accept ** (completely o partly) the campaign or if he rejects it */ function Delete_Campaign (idCamp){ try{ var bcContact = TheApplication().ActiveBusObject().GetBusComp("Contact-Prospect Campaigns"); var bcAssetContact = TheApplication().ActiveBusObject().GetBusComp("Asset Contact Campaign SCM"); /*with(bcContact){ ClearToQuery(); SetSearchSpec("Id", idCamp); ExecuteQuery(ForwardOnly); DeleteRecord(); } with(bcAssetContact){ ActivateField("Asset Id SCM"); ActivateField("Id"); SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Campaign Contact Id SCM", idCamp); ExecuteQuery(); if(FirstRecord()){ do{ DeleteRecord(); }while(NextRecord()) } }*/ }catch(e){ TheApplication().Trace(this.Name()+"Error: "+e.toString()); throw e; } finally{ bcContact = null; bcAssetContact = null; } }

Accept Campaign SCM
Service_PreInvokeMethod
/* ** @Author TGDESIS1 ** @Date Creation 01.12.2008 ** Business Service for Accept Campaign (completely or partly) or ** delete associate campaign to a contact */ function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { try{ switch(MethodName){ case "AcceptCampaign": Accept_Campaign(MethodName,Inputs,Outputs); return (CancelOperation); break; case "DeleteCampaign": Delete_Campaign(Inputs.GetProperty("idCamp")); return (CancelOperation); break; default: TheApplication().Trace("Default"); return (ContinueOperation); break; } }catch(e){ } }

Accept Campaign SCM
Service_PreInvokeMethod
/* ** @Author TGDESIS1 ** @Date Creation 01.12.2008 ** Business Service for Accept Campaign (completely or partly) or ** delete associate campaign to a contact */ function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { try{ switch(MethodName){ case "AcceptCampaign": Accept_Campaign(MethodName,Inputs,Outputs); return (CancelOperation); break; case "DeleteCampaign": Delete_Campaign(Inputs.GetProperty("idCamp")); return (CancelOperation); break; default: TheApplication().Trace("Default"); return (ContinueOperation); break; } }catch(e){ } }

Account - SAP 46C Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 46C Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 46C Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 46C Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 46C Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 46C Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 46C Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 46C Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send

Account - SAP 46C Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 46C Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 46C Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 46C Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 46C Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send

Account - SAP 46C Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 46C Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 46C Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 46C Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 46C Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send

Account - SAP 46C Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 46C Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 46C Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 46C Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_46CIDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 46C Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_46CIDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 46C Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_46CIDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 46C Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_46CIDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 46C Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_46CIDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 46C Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_46CIDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 46C Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 46C Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 46C Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 46C Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_46CIDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = OrgBusObject.GetBusComp("SAP Organization"); SABusComp.ClearToQuery(); // SABusComp.SetSearchSpec("Back Office Sales Organization", TheApplication().InvokeMethod ("LookupValue", "SAP_SALES_ORG", SalesOrg)); // SABusComp.SetSearchSpec("Back Office Distribution Channel", TheApplication().InvokeMethod ("LookupValue", "SAP_DISTRIBUTION_CHANNEL", DistChannel)); // SABusComp.SetSearchSpec("Back Office Division", TheApplication().InvokeMethod ("LookupValue", "SAP_DIVN_CD", DivCode)); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); SABusComp.ActivateField("Organization Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Organization Id"); } else return null; }

Account - SAP 46C Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_46CIDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = OrgBusObject.GetBusComp("SAP Organization"); SABusComp.ClearToQuery(); // SABusComp.SetSearchSpec("Back Office Sales Organization", TheApplication().InvokeMethod ("LookupValue", "SAP_SALES_ORG", SalesOrg)); // SABusComp.SetSearchSpec("Back Office Distribution Channel", TheApplication().InvokeMethod ("LookupValue", "SAP_DISTRIBUTION_CHANNEL", DistChannel)); // SABusComp.SetSearchSpec("Back Office Division", TheApplication().InvokeMethod ("LookupValue", "SAP_DIVN_CD", DivCode)); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); SABusComp.ActivateField("Organization Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Organization Id"); } else return null; }

Account - SAP 46C Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_46CIDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = OrgBusObject.GetBusComp("SAP Organization"); SABusComp.ClearToQuery(); // SABusComp.SetSearchSpec("Back Office Sales Organization", TheApplication().InvokeMethod ("LookupValue", "SAP_SALES_ORG", SalesOrg)); // SABusComp.SetSearchSpec("Back Office Distribution Channel", TheApplication().InvokeMethod ("LookupValue", "SAP_DISTRIBUTION_CHANNEL", DistChannel)); // SABusComp.SetSearchSpec("Back Office Division", TheApplication().InvokeMethod ("LookupValue", "SAP_DIVN_CD", DivCode)); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); SABusComp.ActivateField("Organization Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Organization Id"); } else return null; }

Account - SAP 46C Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 46C Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 46C Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 46C Maps
ReceiveAccount_46CIDOCToSiebel
function ReceiveAccount_46CIDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 46C Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 46C Customer (DEBMAS05) * E2KNA1M005, E2KNVKM, E2DNVVM005, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 46C Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error??? /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account Status", "Active"); else oAccountComp.

Account - SAP 46C Maps
ReceiveAccount_46CIDOCToSiebel
function ReceiveAccount_46CIDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 46C Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 46C Customer (DEBMAS05) * E2KNA1M005, E2KNVKM, E2DNVVM005, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 46C Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error??? /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account Status", "Active"); else oAccountComp.

Account - SAP 46C Maps
ReceiveAccount_46CIDOCToSiebel
function ReceiveAccount_46CIDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 46C Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 46C Customer (DEBMAS05) * E2KNA1M005, E2KNVKM, E2DNVVM005, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 46C Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error??? /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account Status", "Active"); else oAccountComp.

Account - SAP 46C Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 46C Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 46C Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 46C Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 46C Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 46C Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 46C Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 46C Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 46C Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 46C Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 46C Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 46C Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 46C Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 46C Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 46C Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 46C Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 46C Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR",

Account - SAP 46C Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 46C Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR",

Account - SAP 46C Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 46C Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 46C Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 46C Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 46C Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR",

Account - SAP 46C Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 46C Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 46C Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 46C Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 46C Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 46C Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 46C Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 46C Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 46C Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 46C Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP 46C Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP 46C Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP 46C Maps - History
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 46C Maps - History
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 46C Maps - History
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 46C Maps - History
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP 46C Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP 46C Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP 46C Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */

Account - SAP 46C Maps - History
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP 46C Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP 46C Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP 46C Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */

Account - SAP 46C Maps - History
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP 46C Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP 46C Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP 46C Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */

Account - SAP 46C Maps - History
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP 46C Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP 46C Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP 46C Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("TRANSACTION_GROUP", "0"); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP 46C Maps - History
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP 46C Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP 46C Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP 46C Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("TRANSACTION_GROUP", "0"); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP 46C Maps - History
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP 46C Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP 46C Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP 46C Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP 46C Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("TRANSACTION_GROUP", "0"); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP 46C Maps - History
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP 46C Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP 46C Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP 46C Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP 46C Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp); oOrderOrgComp.SetFieldValue ( "IsPrimaryMVG", "Y"); oOrderOrgComp.CopyFieldValue ( "Organization Id", "SAP Organization Id (MO)"); } } }

Account - SAP 46C Maps - History
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP 46C Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP 46C Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP 46C Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP 46C Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp); oOrderOrgComp.SetFieldValue ( "IsPrimaryMVG", "Y"); oOrderOrgComp.CopyFieldValue ( "Organization Id", "SAP Organization Id (MO)"); } } }

Account - SAP 46C Maps - History
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP 46C Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP 46C Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP 46C Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP 46C Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp); oOrderOrgComp.SetFieldValue ( "IsPrimaryMVG", "Y"); oOrderOrgComp.CopyFieldValue ( "Organization Id", "SAP Organization Id (MO)"); } } }

Account - SAP 46C Maps - History
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 46C Maps - History
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 46C Maps - History
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 46C Maps - History
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account - SAP 46C Maps - History
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account - SAP 46C Maps - History
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account - SAP 47 Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 47 Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 47 Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 47 Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 47 Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 47 Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 47 Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 47 Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send or Re

Account - SAP 47 Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 47 Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 47 Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 47 Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 47 Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send or Re

Account - SAP 47 Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 47 Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 47 Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 47 Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 47 Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send or Re

Account - SAP 47 Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 47 Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 47 Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 47 Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 47 Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 47 Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 47 Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 47 Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 47 Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 47 Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 47 Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 47 Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 47 Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_47IDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("Organizations"); var SABusComp = OrgBusObject.GetBusComp("Organization"); SABusComp.SetViewMode(3); // All Mode SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); // SABusComp.ActivateField("Organization Id"); SABusComp.ActivateField("Party Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { // return SABusComp.GetFieldValue("Organization Id"); return SABusComp.GetFieldValue("Party Id"); } else return null; }

Account - SAP 47 Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_47IDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("Organizations"); var SABusComp = OrgBusObject.GetBusComp("Organization"); SABusComp.SetViewMode(3); // All Mode SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); // SABusComp.ActivateField("Organization Id"); SABusComp.ActivateField("Party Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { // return SABusComp.GetFieldValue("Organization Id"); return SABusComp.GetFieldValue("Party Id"); } else return null; }

Account - SAP 47 Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_47IDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("Organizations"); var SABusComp = OrgBusObject.GetBusComp("Organization"); SABusComp.SetViewMode(3); // All Mode SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); // SABusComp.ActivateField("Organization Id"); SABusComp.ActivateField("Party Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { // return SABusComp.GetFieldValue("Organization Id"); return SABusComp.GetFieldValue("Party Id"); } else return null; }

Account - SAP 47 Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 47 Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 47 Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 47 Maps
ReceiveAccount_47IDOCToSiebel
function ReceiveAccount_47IDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 47 Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 47 Customer (DEBMAS05) * E2KNA1M005, E2KNVKM, E2DNVVM006, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 47 Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error??? /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); var Name = iKNA1MComp.GetFieldValue ("NAME1"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account

Account - SAP 47 Maps
ReceiveAccount_47IDOCToSiebel
function ReceiveAccount_47IDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 47 Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 47 Customer (DEBMAS05) * E2KNA1M005, E2KNVKM, E2DNVVM006, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 47 Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error??? /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); var Name = iKNA1MComp.GetFieldValue ("NAME1"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account

Account - SAP 47 Maps
ReceiveAccount_47IDOCToSiebel
function ReceiveAccount_47IDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 47 Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 47 Customer (DEBMAS05) * E2KNA1M005, E2KNVKM, E2DNVVM006, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 47 Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error??? /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); var Name = iKNA1MComp.GetFieldValue ("NAME1"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account

Account - SAP 47 Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 47 Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 47 Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 47 Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 47 Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 47 Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 47 Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 47 Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 47 Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 47 Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 47 Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR", "In

Account - SAP 47 Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 47 Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR", "In

Account - SAP 47 Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 47 Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 47 Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 47 Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 47 Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR", "In

Account - SAP 47 Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 47 Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 47 Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 47 Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 47 Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 47 Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 47 Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 47 Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 47 Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 47 Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP 47 Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP 47 Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP 47 Maps - History
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 47 Maps - History
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 47 Maps - History
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 47 Maps - History
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP 47 Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP 47 Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oG

Account - SAP 47 Maps - History
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP 47 Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP 47 Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oG

Account - SAP 47 Maps - History
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP 47 Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP 47 Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oG

Account - SAP 47 Maps - History
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP 47 Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP 47 Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP 47 Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("TRANSACTION_GROUP", "0"); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP 47 Maps - History
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP 47 Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP 47 Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP 47 Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("TRANSACTION_GROUP", "0"); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP 47 Maps - History
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP 47 Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP 47 Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP 47 Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("TRANSACTION_GROUP", "0"); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP 47 Maps - History
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP 47 Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP 47 Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP 47 Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP 47 Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp); oOrderOrgComp.SetFieldValue ( "IsPrimaryMVG", "Y"); oOrderOrgComp.CopyFieldValue ( "Organization Id", "SAP Organization Id (MO)"); } } }

Account - SAP 47 Maps - History
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP 47 Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP 47 Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP 47 Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP 47 Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp); oOrderOrgComp.SetFieldValue ( "IsPrimaryMVG", "Y"); oOrderOrgComp.CopyFieldValue ( "Organization Id", "SAP Organization Id (MO)"); } } }

Account - SAP 47 Maps - History
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP 47 Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP 47 Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP 47 Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP 47 Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp); oOrderOrgComp.SetFieldValue ( "IsPrimaryMVG", "Y"); oOrderOrgComp.CopyFieldValue ( "Organization Id", "SAP Organization Id (MO)"); } } }

Account - SAP 47 Maps - History
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 47 Maps - History
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 47 Maps - History
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 47 Maps - History
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account - SAP 47 Maps - History
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account - SAP 47 Maps - History
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account - SAP 50 Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 50 Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 50 Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP 50 Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 50 Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 50 Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 47 Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 47 Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send or Re

Account - SAP 50 Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 50 Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 50 Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 47 Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 47 Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send or Re

Account - SAP 50 Maps
CheckSAPCustomer_CallBAPI
function CheckSAPCustomer_CallBAPI (inputMsg, outputMsg) { /* Referenced in workflow Account - Check SAP 46C Customer * Input Object: * Account - Send or Receive SAP 50 Customer (Siebel 77) * * * Output Object's Integration Components: * Account - Send or Receive SAP 50 Customer (Siebel 77) * set property "customerExists" to true or false in outputMsg * if customer does not exist, set "EAI Sync Error Text" */ // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * temporary variables */ var customerExists = false; var errorType; /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account var oAccountObj; var oAccountComp; iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* * Create new property sets for BAPI call to SAP and create adapter bus service */ var inputBAPI = TheApplication().NewPropertySet(); var outputBAPI = TheApplication().NewPropertySet(); var inputBAPIMsg = EAICreateIntMsgOut (inputBAPI); var iBAPIObj = inputBAPIMsg.CreateIntObj ("Account - Check SAP 47 Customer Existence (BAPI Input)"); inputBAPIMsg.SetArgument ("OutputIntObjectName", "Account - Check SAP 47 Customer Existence (BAPI Output)"); inputBAPIMsg.SetArgument ("SAPAutoError","False"); var bapiAdapter = TheApplication().GetService("EAI SAP BAPI Adapter"); var oBAPIObj; var oBAPIExportComp; var iBAPIImportComp; /* * create top-level integration object */ if (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ iBAPIObj.NewInstance (); iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); iBAPIImportComp = iBAPIObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { var IntId = iAccountComp.GetFieldValue ("Integration Id"); var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ iBAPIImportComp.NewRecord (); iBAPIImportComp.SetFieldValue ("CUSTOMERNO", IntId); /* * Loop over sales orgs, call BAPI for each until one suceeds */ var iSalesAreaAccountComp = iAccountComp.GetIntComp ("SAP 4x Account Sales Area"); while (iSalesAreaAccountComp.NextRecord() ) { /* Copy sales org info */ iBAPIImportComp.SetCopySource ( iSalesAreaAccountComp ); iBAPIImportComp.CopyFieldValue( "SALES_ORGANIZATION", "Back Office Sales Organization"); iBAPIImportComp.CopyFieldValue( "DISTRIBUTION_CHANNEL", "Back Office Distribution Channel"); iBAPIImportComp.CopyFieldValue( "DIVISION", "Back Office Sales Area Division Code"); // call BAPI bapiAdapter.InvokeMethod ("Execute", inputBAPI, outputBAPI); // test output oBAPIExportComp = ((outputBAPI.GetChild(0)).GetChild(0)).GetChild(0); errorType = oBAPIExportComp.GetProperty ("RETURN-TYPE"); if (errorType != "E") { customerExists = true; break; } outputBAPI.Reset(); } // endloop iSalesAreaAccountComp.NextRecord() } // endif iAccountComp.NextRecord() } // endif iAccountObj.NextInstance() oAccountObj = outputMsg.CreateIntObj ("Account - Send or Re

Account - SAP 50 Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 50 Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 50 Maps
CreateDummyBAPICommit
function CreateDummyBAPICommit (inputMsg, outputMsg) { // not currently used /* * Set up EAI Output Message Objects */ var oCommitObj; // BAPI instance var oCommitComp; // BAPI Component oCommitObj = outputMsg.CreateIntObj ("SAP 4x BAPI_TRANSACTION_COMMIT (BAPI Input)"); oCommitObj.NewInstance(); oCommitComp = oCommitObj.CreatePrimaryIntComp ("Import Parameters"); oCommitComp.NewRecord (); }

Account - SAP 50 Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 50 Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 50 Maps
GetAccountName
function GetAccountName (Int_ID) {// referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", Int_ID); AccBusComp.ActivateField("Name"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 50 Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 50 Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 50 Maps
GetAccountStatus
function GetAccountStatus (oIntId) { // referenced by script ReceiveAccount_47IDOCToSiebel var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Integration Id", oIntId); AccBusComp.ActivateField("Account Status"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { return AccBusComp.GetFieldValue("Account Status"); } else return null; }

Account - SAP 50 Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 50 Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 50 Maps
GetLangIndCode
function GetLangIndCode (Type, DisplayVal) { var CatBusObject = TheApplication().GetBusObject("PickList Generic"); var SABusComp = CatBusObject.GetBusComp("PickList Generic"); SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Type", Type); SABusComp.SetSearchSpec("Value", DisplayVal); SABusComp.ActivateField("Name"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { return SABusComp.GetFieldValue("Name"); } else return null; }

Account - SAP 50 Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_47IDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("Organizations"); var SABusComp = OrgBusObject.GetBusComp("Organization"); SABusComp.SetViewMode(3); // All Mode SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); // SABusComp.ActivateField("Organization Id"); SABusComp.ActivateField("Party Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { // return SABusComp.GetFieldValue("Organization Id"); return SABusComp.GetFieldValue("Party Id"); } else return null; }

Account - SAP 50 Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_47IDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("Organizations"); var SABusComp = OrgBusObject.GetBusComp("Organization"); SABusComp.SetViewMode(3); // All Mode SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); // SABusComp.ActivateField("Organization Id"); SABusComp.ActivateField("Party Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { // return SABusComp.GetFieldValue("Organization Id"); return SABusComp.GetFieldValue("Party Id"); } else return null; }

Account - SAP 50 Maps
GetSalesArea
function GetSalesArea (SalesOrg, DistChannel, DivCode) { // referenced by script ReceiveAccount_47IDOCToSiebel var OrgBusObject = TheApplication().GetBusObject("Organizations"); var SABusComp = OrgBusObject.GetBusComp("Organization"); SABusComp.SetViewMode(3); // All Mode SABusComp.ClearToQuery(); SABusComp.SetSearchSpec("Back Office Sales Organization", SalesOrg); SABusComp.SetSearchSpec("Back Office Distribution Channel", DistChannel); SABusComp.SetSearchSpec("Back Office Division", DivCode); // SABusComp.ActivateField("Organization Id"); SABusComp.ActivateField("Party Id"); SABusComp.ExecuteQuery(); if(SABusComp.FirstRecord()) { // return SABusComp.GetFieldValue("Organization Id"); return SABusComp.GetFieldValue("Party Id"); } else return null; }

Account - SAP 50 Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 50 Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 50 Maps
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP 50 Maps
ReceiveAccount_47IDOCToSiebel
function ReceiveAccount_47IDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 50 Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 50 Customer (DEBMAS05) * E2KNA1M005, E2KNVKM001, E2DNVVM006, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 50 Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); var Name = iKNA1MComp.GetFieldValue ("NAME1"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account

Account - SAP 50 Maps
ReceiveAccount_47IDOCToSiebel
function ReceiveAccount_47IDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 50 Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 50 Customer (DEBMAS05) * E2KNA1M005, E2KNVKM001, E2DNVVM006, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 50 Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); var Name = iKNA1MComp.GetFieldValue ("NAME1"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account

Account - SAP 50 Maps
ReceiveAccount_47IDOCToSiebel
function ReceiveAccount_47IDOCToSiebel (inputMsg, outputMsg) { // referenced by workflow Account - Receive SAP 50 Customer /* Input Objects' Integration Components * Account - Send or Receive SAP 50 Customer (DEBMAS05) * E2KNA1M005, E2KNVKM001, E2DNVVM006, E2KNKKM001, E2KNVPM002 * Output Object's Integration Components: * Account - Send or Receive SAP 50 Customer (Siebel 77) * Account * Contact * Business Address */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); var defaultOrgLM = EAIGetValueMap ("Default Org", "Siebel Inbound"); var undefinedOrgLM = EAIGetValueMap ("Undefined SAP Org", "Siebel Inbound"); var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Inbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Inbound"); /* Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact var oCustAcctGrp; // Customer Account Group var oIntId; // SAP Customer Number var oAcctSts; // Account Status var regCode; // SAP Country + Region Code (12-90S337) var sapCode; // SAP Region Code (12-90S337) var osiebReg; // Siebel Region (12-90S337) var AcctIntId // Account Integration Id for Contact (12-C34KYN) /* Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (DEBMAS05)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* Misc set up */ // var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only /* Read int object instances from EAI message */ enumObj: while (iIDOCObj.NextInstance ()) { /* Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); if( !iIDOCComp.NextRecord() ) continue enumObj; // TODO: Root component is missing - log an error /* Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M005"); if( !iKNA1MComp.NextRecord() ) continue enumObj; /* Create "Account" object */ oAccountObj.NewInstance (); /* Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* Set Integration Id and Name */ oIntId = iKNA1MComp.GetFieldValue ("KUNNR"); var Name = iKNA1MComp.GetFieldValue ("NAME1"); oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); AcctIntId = oIntId ; // Account Integration Id for Contact (12-C34KYN) oCustAcctGrp = acctGroupLM.Translate (iKNA1MComp.GetFieldValue ("KTOKD")); var AcctGrp = TheApplication().InvokeMethod ("LookupValue", "ACCOUNT_GROUP_TYPE", oCustAcctGrp); oAccountComp.SetFieldValue ("Customer Account Group", AcctGrp); /* Set location to "<City> KUNNR1" If <City> is null, put "No City" */ var location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if customer is Marked for Deletion */ if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") { oAccountComp.SetFieldValue ("Account Status", "Marked For Deletion"); } else { oAcctSts = GetAccountStatus (oIntId); if (oAcctSts == "Marked For Deletion") oAccountComp.SetFieldValue ("Account

Account - SAP 50 Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 50 Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 50 Maps
RequestCustomerNumber_BAPIToSiebel
function RequestCustomerNumber_BAPIToSiebel (inputMsg, outputMsg) { /* Input Objects' Integration Components * BAPI Export (Account - Get SAP 47 Internal Customer Number (BAPI Output)) * Export Parameters (output) * CUSTOMERID * * Output Object's Integration Components: * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * Integration Id, Location, Sync status data (oAccount) */ /* * Set up EAI Input Message objects */ var iBAPIObj; // BAPI object instance var iExportComp; // BAPI Export Parameters // Store inputId for later use var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account /* * Find and create top-level integration object */ iBAPIObj = inputMsg.GetIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); /* * Read int object instances from EAI message */ while (iBAPIObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iExportComp = iBAPIObj.GetPrimaryIntComp ("Export Parameters"); if (iExportComp.NextRecord ()) { oAccountComp.SetCopySource (iExportComp); oAccountComp.CopyFieldValue ("EAI Sync Error Text", "RETURN-MESSAGE"); var ErrorType = iExportComp.GetFieldValue ("RETURN-TYPE"); if (ErrorType != "E") { /* * Update "Account" component */ oAccountComp.CopyFieldValue ("Integration Id", "CUSTOMERID"); var customerno = iExportComp.GetFieldValue ("CUSTOMERID"); var timenow = Timestamp(); var SyncStat = TheApplication().InvokeMethod ("LookupValue", "EAI_ACCOUNT_SYNC_STATUS", "Created in Back Office"); oAccountComp.SetFieldValue ("EAI Sync Status Code", SyncStat); oAccountComp.SetFieldValue ("EAI Sync Date",timenow); /* * Get Address Info to create the location field with * embedded customer number */ var AccBusObject = TheApplication().GetBusObject("Account"); var AccBusComp = AccBusObject.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusComp.SetViewMode(3); AccBusComp.ClearToQuery(); AccBusComp.SetSearchSpec("Id", inputId); AccBusComp.ActivateField("Location"); AccBusComp.ExecuteQuery(); if(AccBusComp.FirstRecord()) { var city = AccBusComp.GetFieldValue("City"); var location = AccBusComp.GetFieldValue("Location"); /* * Site */ if (location == "") { location = AccBusComp.GetFieldValue("City"); } location += " " + customerno; oAccountComp.SetFieldValue ("Location", location ); } } } } // while (iCreateAccountObj.NextInstance ()) } //function RequestCustomerNumber_BAPIToSiebel

Account - SAP 50 Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 47 Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 50 Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 47 Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 50 Maps
RequestCustomerNumber_SiebelToBAPI
function RequestCustomerNumber_SiebelToBAPI (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * Account (Account) * * * Output Object's Integration Components: * Account - Get SAP 47 Internal Customer Number (BAPI Input) */ /* Set up EAI Lookup maps */ var acctGroupLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); /* * Set up EAI Input Message objects */ var iAccountObj; // Account object instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oBAPIObj; // BAPI object instance var oBAPIImportComp; // BAPI Import parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); oBAPIObj = outputMsg.CreateIntObj ("Account - Get SAP 47 Internal Customer Number (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create BAPI object in output message */ oBAPIObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oBAPIImportComp = oBAPIObj.CreatePrimaryIntComp ("Import Parameters"); while (iAccountComp.NextRecord ()) { /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") != "") { var IntId = iAccountComp.GetFieldValue ("Integration Id"); EAIRaiseError(LocalizeMessage("ERR_MSG_ACCOUNT_EXISTS,"+IntId+""));//nbc } /* * Validate Address */ var iAddrComp = iAccountComp.GetIntComp ("Account_Business Address"); var AddressFlag = "N"; if (iAddrComp.Exists ()) { while (iAddrComp.NextRecord()) { if (iAddrComp.GetFieldValue ("IsPrimaryMVG") == "Y") { AddressFlag = "Y"; } } } /* * Return an error if no address is found */ if (AddressFlag == "N") { EAIRaiseError(LocalizeMessage("ERR_MSG_INVALID_ADDRESS," + "")); } /* * Write "Import Parameters" component */ oBAPIImportComp.NewRecord (); oBAPIImportComp.SetFieldValue ("QUANTITY", "1"); var acctGroup = iAccountComp.GetFieldValue("Customer Account Group"); oBAPIImportComp.SetFieldValue ("ACCOUNTGROUP", acctGroupLM.Translate(acctGroup)); } //while (iAccountComp.NextRecord ()) } //while (iAccountObj.NextInstance ()) } //function RequestCustomerNumber_SiebelToBAPI

Account - SAP 50 Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 50 Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM001", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR",

Account - SAP 50 Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 50 Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM001", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR",

Account - SAP 50 Maps
SendAccount_SiebelToDEBMAS05
function SendAccount_SiebelToDEBMAS05 (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Send or Receive SAP 50 Customer (Siebel 77)) * * Output Object's Integration Components: * Customer IDOC (Account - Send or Receive SAP 50 Customer (DEBMAS05)) */ /* Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Outbound"); var languageLM = EAIGetValueMap ("SAP Language 4x", "Siebel Outbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Outbound"); var acctGrpLM = EAIGetValueMap ("SAP Customer Acct Group Code", "Siebel Outbound"); var regCodeLM = EAIGetValueMap ("Back Office Region", "Siebel Outbound"); /* Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iAddrComp; // Address var iContactComp; // Contact /* Set up EAI Output Message objects */ var oIDOCObj; // IDOC instance var oIDOCComp; // top level IDOC segment var oKNA1MComp; // IDOC Customer Header var oComp; // for reading child components /* Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Send or Receive SAP 50 Customer (Siebel 77)"); oIDOCObj = outputMsg.CreateIntObj ("Account - Send or Receive SAP 50 Customer (DEBMAS05)"); /* Misc set up */ var generateMasterRecord = 1; // Set to '0' to generate sub-organization records only var custAccntGrp; var currencyCode; var ctr = 0; var countryCode; var regCode; var sapCode; /* Read int object instances from EAI message */ enumObj: while (iAccountObj.NextInstance ()) { /* Read root Account component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); if( !iAccountComp.NextRecord() ) continue enumObj; /* * Return an error if Integration Id is not null */ if (iAccountComp.GetFieldValue ("Integration Id") == "") { var errMsg = iAccountComp.GetFieldValue ("EAI Sync Error Text"); EAIRaiseError ( errMsg ); } /* Create "IDOC" object */ oIDOCObj.NewInstance (); /* Create "IDOC" component in output message */ oIDOCComp = oIDOCObj.CreatePrimaryIntComp ("Idoc Segments"); oIDOCComp.NewRecord (); oKNA1MComp = oIDOCComp.CreateIntComp ("E2KNA1M005",false); oKNA1MComp.NewRecord (); oKNA1MComp.SetCopySource (iAccountComp); /* Set Integration Id, Name and Account Group*/ oKNA1MComp.CopyFieldValue ("KUNNR", "Integration Id"); oKNA1MComp.CopyFieldValue ("NAME1", "Name"); oKNA1MComp.SetFieldValue ("KTOKD", acctGrpLM.Translate (iAccountComp.GetFieldValue("Customer Account Group"))); /* Set location */ // oKNA1MComp.CopyFieldValue ("ORT01", "Location"); /* Account Status */ // oKNA1MComp.CopyFieldValue ("AUFSD", "Account Status" ); oKNA1MComp.SetFieldValue ("LOEVM", ""); if (iAccountComp.GetFieldValue ("Account Status") == "Marked For Deletion") oKNA1MComp.SetFieldValue ("LOEVM", "X"); /* Primary Industry */ // oKNA1MComp.CopyFieldValue ("BRSCH", "Primary Industry Id"); /* Tax Exempt Number (not created in bus comp for VAT_REGN_NUM yet) */ // oKNA1MComp.CopyFieldValue ("STCEG", "" ); /* Search Term */ oKNA1MComp.CopyFieldValue ("SORTL", "Name"); /* Transportation Zone */ // oKNA1MComp.SetFieldValue ("LZONE", "0000000001"); /* Set language code */ oKNA1MComp.SetFieldValue ("SPRAS", languageLM.Translate (iAccountComp.GetFieldValue ("Language Code"))); /* Set main Phone/FAX numbers */ oKNA1MComp.CopyFieldValue ("TELF1", "Main Phone Number" ); oKNA1MComp.CopyFieldValue ("TELFX", "Main Fax Number" ); /* Read "KNVKM" component */ iContactComp = iAccountComp.GetIntComp ("Contact"); oComp = oKNA1MComp.CreateIntComp ("E2KNVKM001", false); while (iContactComp.NextRecord ()) { /* Write "Contact" component */ oComp.NewRecord (); oComp.SetCopySource (iContactComp); // oComp.CopyFieldValue ("PARNR",

Account - SAP 50 Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 50 Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 50 Maps
Service_InvokeMethod
function Service_InvokeMethod (MethodName, Inputs, Outputs) { }

Account - SAP 50 Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 50 Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 50 Maps
Service_PreCanInvokeMethod
function Service_PreCanInvokeMethod (MethodName, &CanInvoke) { return (ContinueOperation); }

Account - SAP 50 Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 50 Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 50 Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account - SAP 50 Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP 50 Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP 50 Maps
Timestamp()
function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account - SAP Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: P. Lim // // DESCRIPTION // Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: P. Lim // // DESCRIPTION // Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP Maps
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: P. Lim // // DESCRIPTION // Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP Maps
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP Order List (Siebel)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (Siebel)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Get List for Account Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oGLOutputComp.NewRecord (); oGLOutputComp.SetCopySource (iGLExportComp); oGLOutputComp.SetFieldValue ("Input Id", inputId); oGLOutputComp.CopyFieldValue ("Return Code", "RETURN-CODE"); oGLOutputComp.CopyFieldValue ("Return Log Msg No", "RETURN-LOG_MSG_NO"); oGLOutputComp.CopyFieldValue ("Return Log No", "RETURN-LOG_NO"); oGLOutputComp.CopyFieldValue ("Return Message", "RETURN-MESSAGE"); oGLOutputComp.CopyFieldValue ("Return Type", "RETURN-TYPE"); /* * Read "Order Header" component to */ iGLHeaderComp = iGLExportComp.GetIntComp ("Order Header"); oGLHeaderComp = oAccountComp.CreateIntComp ("Get List for Account Header", oAccountComp); while (iGLHeaderComp.NextRecord ()) { oGLHeaderComp.NewRecord (); oGLHeaderComp.SetCopySource (iGLHeaderComp); oGLHeaderComp.SetFieldValue ("Input Id", inputId); oGLHeaderComp.CopyFieldValue ("Currency", "CURRENCY"); oGLHeaderComp.CopyFieldValue ("Distribution Channel", "DISTR_CHAN"); oGLHeaderComp.CopyFieldValue ("Division", "DIVISION"); oGLHeaderComp.CopyFieldValue ("Order Date", "DOC_DATE"); oGLHeaderComp.CopyFieldValue ("Order Number", "SD_DOC"); oGLHeaderComp.CopyFieldValue ("Order Status", "DOC_STATUS"); oGLHeaderComp.CopyFieldValue ("Order Type", "DOC_TYPE"); oGLHeaderComp.CopyFieldValue ("Purchase Order", "PURCH_NO"); oGLHeaderComp.CopyFieldValue ("Sales Organization", "SALES_ORG"

Account - SAP Maps
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP Order List (Siebel)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (Siebel)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Get List for Account Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oGLOutputComp.NewRecord (); oGLOutputComp.SetCopySource (iGLExportComp); oGLOutputComp.SetFieldValue ("Input Id", inputId); oGLOutputComp.CopyFieldValue ("Return Code", "RETURN-CODE"); oGLOutputComp.CopyFieldValue ("Return Log Msg No", "RETURN-LOG_MSG_NO"); oGLOutputComp.CopyFieldValue ("Return Log No", "RETURN-LOG_NO"); oGLOutputComp.CopyFieldValue ("Return Message", "RETURN-MESSAGE"); oGLOutputComp.CopyFieldValue ("Return Type", "RETURN-TYPE"); /* * Read "Order Header" component to */ iGLHeaderComp = iGLExportComp.GetIntComp ("Order Header"); oGLHeaderComp = oAccountComp.CreateIntComp ("Get List for Account Header", oAccountComp); while (iGLHeaderComp.NextRecord ()) { oGLHeaderComp.NewRecord (); oGLHeaderComp.SetCopySource (iGLHeaderComp); oGLHeaderComp.SetFieldValue ("Input Id", inputId); oGLHeaderComp.CopyFieldValue ("Currency", "CURRENCY"); oGLHeaderComp.CopyFieldValue ("Distribution Channel", "DISTR_CHAN"); oGLHeaderComp.CopyFieldValue ("Division", "DIVISION"); oGLHeaderComp.CopyFieldValue ("Order Date", "DOC_DATE"); oGLHeaderComp.CopyFieldValue ("Order Number", "SD_DOC"); oGLHeaderComp.CopyFieldValue ("Order Status", "DOC_STATUS"); oGLHeaderComp.CopyFieldValue ("Order Type", "DOC_TYPE"); oGLHeaderComp.CopyFieldValue ("Purchase Order", "PURCH_NO"); oGLHeaderComp.CopyFieldValue ("Sales Organization", "SALES_ORG"

Account - SAP Maps
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP Order List (Siebel)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (Siebel)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Get List for Account Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oGLOutputComp.NewRecord (); oGLOutputComp.SetCopySource (iGLExportComp); oGLOutputComp.SetFieldValue ("Input Id", inputId); oGLOutputComp.CopyFieldValue ("Return Code", "RETURN-CODE"); oGLOutputComp.CopyFieldValue ("Return Log Msg No", "RETURN-LOG_MSG_NO"); oGLOutputComp.CopyFieldValue ("Return Log No", "RETURN-LOG_NO"); oGLOutputComp.CopyFieldValue ("Return Message", "RETURN-MESSAGE"); oGLOutputComp.CopyFieldValue ("Return Type", "RETURN-TYPE"); /* * Read "Order Header" component to */ iGLHeaderComp = iGLExportComp.GetIntComp ("Order Header"); oGLHeaderComp = oAccountComp.CreateIntComp ("Get List for Account Header", oAccountComp); while (iGLHeaderComp.NextRecord ()) { oGLHeaderComp.NewRecord (); oGLHeaderComp.SetCopySource (iGLHeaderComp); oGLHeaderComp.SetFieldValue ("Input Id", inputId); oGLHeaderComp.CopyFieldValue ("Currency", "CURRENCY"); oGLHeaderComp.CopyFieldValue ("Distribution Channel", "DISTR_CHAN"); oGLHeaderComp.CopyFieldValue ("Division", "DIVISION"); oGLHeaderComp.CopyFieldValue ("Order Date", "DOC_DATE"); oGLHeaderComp.CopyFieldValue ("Order Number", "SD_DOC"); oGLHeaderComp.CopyFieldValue ("Order Status", "DOC_STATUS"); oGLHeaderComp.CopyFieldValue ("Order Type", "DOC_TYPE"); oGLHeaderComp.CopyFieldValue ("Purchase Order", "PURCH_NO"); oGLHeaderComp.CopyFieldValue ("Sales Organization", "SALES_ORG"

Account - SAP Maps
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP Order List (Siebel)) * Account (iAccount) * * Output Object's Integration Components: * BAPI Import (Account - Get SAP Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP Order List (Siebel)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); oGLImportComp.CopyFieldValue ("CUSTOMER_NUMBER", "Integration Id"); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("SALES_ORGANIZATION", ""); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", ""); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", ""); // Empty string means "00000000" } } }

Account - SAP Maps
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP Order List (Siebel)) * Account (iAccount) * * Output Object's Integration Components: * BAPI Import (Account - Get SAP Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP Order List (Siebel)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); oGLImportComp.CopyFieldValue ("CUSTOMER_NUMBER", "Integration Id"); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("SALES_ORGANIZATION", ""); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", ""); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", ""); // Empty string means "00000000" } } }

Account - SAP Maps
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP Order List (Siebel)) * Account (iAccount) * * Output Object's Integration Components: * BAPI Import (Account - Get SAP Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iAccountObj; // Siebel Account instance var iAccountComp; // Account /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP Order List (Siebel)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); oGLImportComp.CopyFieldValue ("CUSTOMER_NUMBER", "Integration Id"); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("SALES_ORGANIZATION", ""); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", ""); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", ""); // Empty string means "00000000" } } }

Account - SAP Maps
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP Order (Get SAP Order List)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP Order (Siebel Order)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP Order (Get SAP Order List)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP Order (Siebel Order)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); oOrderComp.CopyFieldValue ("Order Number", "Order Number"); oOrderComp.SetFieldValue ("Order Type", orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type"))); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderComp.CopyFieldValue ("SAP Sales Area", "SAP Sales Area"); // PLim. ??? Set Organization until we can figure out how to fix dup key index problem // oOrderComp.SetFieldValue ("Organization", "Siebel Administration"); } } }

Account - SAP Maps
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP Order (Get SAP Order List)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP Order (Siebel Order)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP Order (Get SAP Order List)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP Order (Siebel Order)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); oOrderComp.CopyFieldValue ("Order Number", "Order Number"); oOrderComp.SetFieldValue ("Order Type", orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type"))); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderComp.CopyFieldValue ("SAP Sales Area", "SAP Sales Area"); // PLim. ??? Set Organization until we can figure out how to fix dup key index problem // oOrderComp.SetFieldValue ("Organization", "Siebel Administration"); } } }

Account - SAP Maps
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP Order (Get SAP Order List)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP Order (Siebel Order)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP Order (Get SAP Order List)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP Order (Siebel Order)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); oOrderComp.CopyFieldValue ("Order Number", "Order Number"); oOrderComp.SetFieldValue ("Order Type", orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type"))); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); oOrderComp.CopyFieldValue ("SAP Sales Area", "SAP Sales Area"); // PLim. ??? Set Organization until we can figure out how to fix dup key index problem // oOrderComp.SetFieldValue ("Organization", "Siebel Administration"); } } }

Account - SAP Maps
ReceiveSAPCustomer_IDOCToSiebel
function ReceiveSAPCustomer_IDOCToSiebel (inputMsg, outputMsg) { var app = TheApplication(); var msg; /* Input Objects' Integration Components * Customer IDOC (Account - Receive SAP Customer (IDOC Input)) * E2KNA1M * E2KNB1M002 (?) * E2KNVKM (?) * E2KNVVM (?) * * Output Object's Integration Components: * Account Object (Account - Receive SAP Customer (Siebel)) * Account (oAccount) * Contact * Business Address */ /* * Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact /* * Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Receive SAP Customer (IDOC Input)"); oAccountObj = outputMsg.CreateIntObj ("Account - Receive SAP Customer (Siebel)"); /* * Read int object instances from EAI message */ while (iIDOCObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); // app.MsgBox("foo"); /* * Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); iIDOCComp.NextRecord (); /* * Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M"); if (iKNA1MComp.NextRecord ()) { /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* * Set Integration Id and Name */ oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); /* * Set location to "<City> KUNNR1" * If <City> is null, put "No City" */ var location; location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if product is marked as deleted */ /* P Lim. 3/16/00. Deletes not supported in this release. Next release: Add a column to show that the item is marked for deletion. */ // if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") // { /* The customer is marked as deleted: delete the account from Siebel */ // oAccountComp.SetFieldValue ("operation", "delete"); // continue; // } // Set operation to "upsert" since we are using the "Execute" method. oAccountComp.SetFieldValue ("operation", "upsert"); /* * Set telephone numbers */ oAccountComp.CopyFieldValue ("Main Phone Number", "TELF1"); oAccountComp.CopyFieldValue ("Main Fax Number", "TELFX"); /* * Set other fields */ // Defaults from buscomp: // oAccountComp.CopyFieldValue (account, "Account Status", "Active"); // oAccountComp.CopyFieldValue (account, "Disable DataCleansing", "N"); oAccountComp.CopyFieldValue ("Row Status", "Y"); /* * Set language code */ oAccountComp.

Account - SAP Maps
ReceiveSAPCustomer_IDOCToSiebel
function ReceiveSAPCustomer_IDOCToSiebel (inputMsg, outputMsg) { var app = TheApplication(); var msg; /* Input Objects' Integration Components * Customer IDOC (Account - Receive SAP Customer (IDOC Input)) * E2KNA1M * E2KNB1M002 (?) * E2KNVKM (?) * E2KNVVM (?) * * Output Object's Integration Components: * Account Object (Account - Receive SAP Customer (Siebel)) * Account (oAccount) * Contact * Business Address */ /* * Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact /* * Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Receive SAP Customer (IDOC Input)"); oAccountObj = outputMsg.CreateIntObj ("Account - Receive SAP Customer (Siebel)"); /* * Read int object instances from EAI message */ while (iIDOCObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); // app.MsgBox("foo"); /* * Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); iIDOCComp.NextRecord (); /* * Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M"); if (iKNA1MComp.NextRecord ()) { /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* * Set Integration Id and Name */ oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); /* * Set location to "<City> KUNNR1" * If <City> is null, put "No City" */ var location; location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if product is marked as deleted */ /* P Lim. 3/16/00. Deletes not supported in this release. Next release: Add a column to show that the item is marked for deletion. */ // if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") // { /* The customer is marked as deleted: delete the account from Siebel */ // oAccountComp.SetFieldValue ("operation", "delete"); // continue; // } // Set operation to "upsert" since we are using the "Execute" method. oAccountComp.SetFieldValue ("operation", "upsert"); /* * Set telephone numbers */ oAccountComp.CopyFieldValue ("Main Phone Number", "TELF1"); oAccountComp.CopyFieldValue ("Main Fax Number", "TELFX"); /* * Set other fields */ // Defaults from buscomp: // oAccountComp.CopyFieldValue (account, "Account Status", "Active"); // oAccountComp.CopyFieldValue (account, "Disable DataCleansing", "N"); oAccountComp.CopyFieldValue ("Row Status", "Y"); /* * Set language code */ oAccountComp.

Account - SAP Maps
ReceiveSAPCustomer_IDOCToSiebel
function ReceiveSAPCustomer_IDOCToSiebel (inputMsg, outputMsg) { var app = TheApplication(); var msg; /* Input Objects' Integration Components * Customer IDOC (Account - Receive SAP Customer (IDOC Input)) * E2KNA1M * E2KNB1M002 (?) * E2KNVKM (?) * E2KNVVM (?) * * Output Object's Integration Components: * Account Object (Account - Receive SAP Customer (Siebel)) * Account (oAccount) * Contact * Business Address */ /* * Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact /* * Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Receive SAP Customer (IDOC Input)"); oAccountObj = outputMsg.CreateIntObj ("Account - Receive SAP Customer (Siebel)"); /* * Read int object instances from EAI message */ while (iIDOCObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); // app.MsgBox("foo"); /* * Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); iIDOCComp.NextRecord (); /* * Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M"); if (iKNA1MComp.NextRecord ()) { /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* * Set Integration Id and Name */ oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); /* * Set location to "<City> KUNNR1" * If <City> is null, put "No City" */ var location; location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if product is marked as deleted */ /* P Lim. 3/16/00. Deletes not supported in this release. Next release: Add a column to show that the item is marked for deletion. */ // if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") // { /* The customer is marked as deleted: delete the account from Siebel */ // oAccountComp.SetFieldValue ("operation", "delete"); // continue; // } // Set operation to "upsert" since we are using the "Execute" method. oAccountComp.SetFieldValue ("operation", "upsert"); /* * Set telephone numbers */ oAccountComp.CopyFieldValue ("Main Phone Number", "TELF1"); oAccountComp.CopyFieldValue ("Main Fax Number", "TELFX"); /* * Set other fields */ // Defaults from buscomp: // oAccountComp.CopyFieldValue (account, "Account Status", "Active"); // oAccountComp.CopyFieldValue (account, "Disable DataCleansing", "N"); oAccountComp.CopyFieldValue ("Row Status", "Y"); /* * Set language code */ oAccountComp.

Account - SAP Maps
ReceiveSAPCustomer_IDOCToSiebel_4x
function ReceiveSAPCustomer_IDOCToSiebel_4x (inputMsg, outputMsg) { var app = TheApplication(); var msg; /* Input Objects' Integration Components * Customer IDOC (Account - Receive SAP Customer (4x IDOC Input)) * E2KNA1M * E2KNB1M002 (?) * E2KNVKM (?) * E2KNVVM (?) * * Output Object's Integration Components: * Account Object (Account - Receive SAP Customer (Siebel)) * Account (oAccount) * Contact * Business Address */ /* * Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact /* * Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Receive SAP Customer (4x IDOC Input)"); oAccountObj = outputMsg.CreateIntObj ("Account - Receive SAP Customer (Siebel)"); /* * Read int object instances from EAI message */ while (iIDOCObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); // app.MsgBox("foo"); /* * Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); iIDOCComp.NextRecord (); /* * Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M"); if (iKNA1MComp.NextRecord ()) { /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* * Set Integration Id and Name */ oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); /* * Set location to "<City> KUNNR1" * If <City> is null, put "No City" */ var location; location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if product is marked as deleted */ /* P Lim. 3/16/00. Deletes not supported in this release. Next release: Add a column to show that the item is marked for deletion. */ // if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") // { /* The customer is marked as deleted: delete the account from Siebel */ // oAccountComp.SetFieldValue ("operation", "delete"); // continue; // } // Set operation to "upsert" since we are using the "Execute" method. oAccountComp.SetFieldValue ("operation", "upsert"); /* * Set telephone numbers */ oAccountComp.CopyFieldValue ("Main Phone Number", "TELF1"); oAccountComp.CopyFieldValue ("Main Fax Number", "TELFX"); /* * Set other fields */ // Defaults from buscomp: // oAccountComp.CopyFieldValue (account, "Account Status", "Active"); // oAccountComp.CopyFieldValue (account, "Disable DataCleansing", "N"); oAccountComp.CopyFieldValue ("Row Status", "Y"); /* * Set language code */ oAcc

Account - SAP Maps
ReceiveSAPCustomer_IDOCToSiebel_4x
function ReceiveSAPCustomer_IDOCToSiebel_4x (inputMsg, outputMsg) { var app = TheApplication(); var msg; /* Input Objects' Integration Components * Customer IDOC (Account - Receive SAP Customer (4x IDOC Input)) * E2KNA1M * E2KNB1M002 (?) * E2KNVKM (?) * E2KNVVM (?) * * Output Object's Integration Components: * Account Object (Account - Receive SAP Customer (Siebel)) * Account (oAccount) * Contact * Business Address */ /* * Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact /* * Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Receive SAP Customer (4x IDOC Input)"); oAccountObj = outputMsg.CreateIntObj ("Account - Receive SAP Customer (Siebel)"); /* * Read int object instances from EAI message */ while (iIDOCObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); // app.MsgBox("foo"); /* * Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); iIDOCComp.NextRecord (); /* * Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M"); if (iKNA1MComp.NextRecord ()) { /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* * Set Integration Id and Name */ oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); /* * Set location to "<City> KUNNR1" * If <City> is null, put "No City" */ var location; location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if product is marked as deleted */ /* P Lim. 3/16/00. Deletes not supported in this release. Next release: Add a column to show that the item is marked for deletion. */ // if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") // { /* The customer is marked as deleted: delete the account from Siebel */ // oAccountComp.SetFieldValue ("operation", "delete"); // continue; // } // Set operation to "upsert" since we are using the "Execute" method. oAccountComp.SetFieldValue ("operation", "upsert"); /* * Set telephone numbers */ oAccountComp.CopyFieldValue ("Main Phone Number", "TELF1"); oAccountComp.CopyFieldValue ("Main Fax Number", "TELFX"); /* * Set other fields */ // Defaults from buscomp: // oAccountComp.CopyFieldValue (account, "Account Status", "Active"); // oAccountComp.CopyFieldValue (account, "Disable DataCleansing", "N"); oAccountComp.CopyFieldValue ("Row Status", "Y"); /* * Set language code */ oAcc

Account - SAP Maps
ReceiveSAPCustomer_IDOCToSiebel_4x
function ReceiveSAPCustomer_IDOCToSiebel_4x (inputMsg, outputMsg) { var app = TheApplication(); var msg; /* Input Objects' Integration Components * Customer IDOC (Account - Receive SAP Customer (4x IDOC Input)) * E2KNA1M * E2KNB1M002 (?) * E2KNVKM (?) * E2KNVVM (?) * * Output Object's Integration Components: * Account Object (Account - Receive SAP Customer (Siebel)) * Account (oAccount) * Contact * Business Address */ /* * Set up EAI Lookup maps */ var currencyLM = EAIGetValueMap ("SAP Currency Code", "Siebel Inbound"); var languageLM = EAIGetValueMap ("SAP Language", "Siebel Inbound"); var countryLM = EAIGetValueMap ("SAP Country", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iIDOCObj; // IDOC instance var iIDOCComp; // top level IDOC segment var iKNA1MComp; // IDOC Customer Header var iComp; // for reading child components /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Account instance var oAccountComp; // Account var oAddrComp; // Address var oContactComp; // Contact /* * Find and create top-level integration object */ iIDOCObj = inputMsg.GetIntObj ("Account - Receive SAP Customer (4x IDOC Input)"); oAccountObj = outputMsg.CreateIntObj ("Account - Receive SAP Customer (Siebel)"); /* * Read int object instances from EAI message */ while (iIDOCObj.NextInstance ()) { /* * Create "Account" object */ oAccountObj.NewInstance (); // app.MsgBox("foo"); /* * Read virtual root component that IDOC RFC Adapter populates */ iIDOCComp = iIDOCObj.GetPrimaryIntComp ("Idoc Segments"); iIDOCComp.NextRecord (); /* * Read "KNA1M" component */ iKNA1MComp = iIDOCComp.GetIntComp ("E2KNA1M"); if (iKNA1MComp.NextRecord ()) { /* * Create "Account" component in output message */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); oAccountComp.SetCopySource (iKNA1MComp); /* * Set Integration Id and Name */ oAccountComp.CopyFieldValue ("Integration Id", "KUNNR"); oAccountComp.CopyFieldValue ("Name", "NAME1"); /* * Set location to "<City> KUNNR1" * If <City> is null, put "No City" */ var location; location = iKNA1MComp.GetFieldValue ("ORT01"); if (location == null) location = "No City"; location += " " + iKNA1MComp.GetFieldValue ("KUNNR"); oAccountComp.SetFieldValue ("Location", location); /* Check if product is marked as deleted */ /* P Lim. 3/16/00. Deletes not supported in this release. Next release: Add a column to show that the item is marked for deletion. */ // if (iKNA1MComp.GetFieldValue ("LOEVM") == "X") // { /* The customer is marked as deleted: delete the account from Siebel */ // oAccountComp.SetFieldValue ("operation", "delete"); // continue; // } // Set operation to "upsert" since we are using the "Execute" method. oAccountComp.SetFieldValue ("operation", "upsert"); /* * Set telephone numbers */ oAccountComp.CopyFieldValue ("Main Phone Number", "TELF1"); oAccountComp.CopyFieldValue ("Main Fax Number", "TELFX"); /* * Set other fields */ // Defaults from buscomp: // oAccountComp.CopyFieldValue (account, "Account Status", "Active"); // oAccountComp.CopyFieldValue (account, "Disable DataCleansing", "N"); oAccountComp.CopyFieldValue ("Row Status", "Y"); /* * Set language code */ oAcc

Account - SAP Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap (MethodName, Inputs, Outputs); }

Account - SAP Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap (MethodName, Inputs, Outputs); }

Account - SAP Maps
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap (MethodName, Inputs, Outputs); }

Account - SAP Maps (MO)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP Maps (MO)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP Maps (MO)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 1999, Siebel Systems, Inc., All rights reserved. // // $Revision: 4 $ // $Date: 12/10/99 10:29a $ // $Author: Achaudhr $ of last update // // CREATOR: R.Lankinen // // DESCRIPTION // Multi-organization Javascript maps from Siebel Account to SAP entities // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account - SAP Maps (MO)
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oGLOutputComp.

Account - SAP Maps (MO)
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oGLOutputComp.

Account - SAP Maps (MO)
GetSAPOrderList_BAPIToSiebel
function GetSAPOrderList_BAPIToSiebel (inputMsg, outputMsg) { /* * Input Objects' Integration Components * BAPI Export (Account - Get SAP Order List (BAPI Output)) * Export Parameters (output) * Order Header (header) * Order Item (item) * * Output Object's Integration Components: * Account Object (Account - Get SAP Order List (MO)) * Account (oAccount) * Get List for Account Output * Get List for Account Header * Get List for Account Item */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var iGLOrderObj; // BAPI Order instance var iGLExportComp; // BAPI Export Parameters var iGLHeaderComp; // BAPI Order Header var iGLItemComp; // BAPI Order Item // Store inputId (ROW_ID) to be denormalized to all RFC table rows var inputId = inputMsg.GetArgument ("Siebel Account Id"); /* * Set up EAI Output Message objects */ var oAccountObj; // Siebel Order instance var oAccountComp; // Account var oGLOutputComp; // Get List Output var oGLHeaderComp; // Get List Header var oGLItemComp; // Get List Item var theApp = TheApplication(); /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Get SAP Order List (BAPI Output)"); oAccountObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (MO)"); /* * Read int object instances from EAI message */ while (iGLOrderObj.NextInstance ()) { /* * Create "Account" object in output message */ oAccountObj.NewInstance (); /* * Create "Account" component */ oAccountComp = oAccountObj.CreatePrimaryIntComp ("Account"); oAccountComp.NewRecord (); // Set "Id" so Siebel Adapter can synchronize oAccountComp.SetFieldValue ("Id", inputId); // Get Primary Sales Area of the account var SalesOrg; var SalesChn; var SalesDiv; var AccBusObj = theApp.GetBusObject("Account"); var AccBusCmp = AccBusObj.GetBusComp("Account"); // Set View Mode to 3 (or AllView) AccBusCmp.SetViewMode(3); AccBusCmp.ClearToQuery(); AccBusCmp.SetSearchSpec("Id", inputId); AccBusCmp.ActivateField("Primary Organization Id"); AccBusCmp.ExecuteQuery(); if(AccBusCmp.FirstRecord()) { var PrimOrg = AccBusCmp.GetFieldValue("Primary Organization Id"); var OrgBusObj = theApp.GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", PrimOrg); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ActivateField("Back Office Distribution Channel"); OrgBusCmp.ActivateField("Back Office Division"); OrgBusCmp.ExecuteQuery(); // get saleOrg, distChnl and division of the primary SA if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); var SalesChn = OrgBusCmp.GetFieldValue("Back Office Distribution Channel"); var SalesDiv = OrgBusCmp.GetFieldValue("Back Office Division"); } // else // { // EAIRaiseError("Unable to get sales area info for the primary organization"); // } } // else // { // EAIRaiseError("Invalid account"); // } /* * Read "Export Parameters" component */ iGLExportComp = iGLOrderObj.GetPrimaryIntComp ("Export Parameters"); oGLOutputComp = oAccountComp.CreateIntComp ("Account - Get SAP Order List Output", oAccountComp); if (iGLExportComp.NextRecord ()) { /* * Write "Get List for Account Output" component */ oGLOutputComp.

Account - SAP Maps (MO)
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP Maps (MO)
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP Maps (MO)
GetSAPOrderList_SiebelToBAPI
function GetSAPOrderList_SiebelToBAPI (inputMsg, outputMsg) { /* Input Objects' Integration Components * Account Object (Account - Get SAP Order List (MO)) * Account (iAccount) * Get List for Account Header * * Output Object's Integration Components: * BAPI Import (Account - Get SAP Order List (BAPI Input)) * Import Parameters (output) */ /* * Set up EAI Lookup objects */ /* * Set up EAI Input Message objects */ var theApp = TheApplication(); // nbc var iAccountObj; // Siebel Account instance var iAccountComp; // Account var iHeaderComp; // Account Header /* * Set up EAI Output Message objects */ var oGLObj; // BAPI instance var oGLImportComp; // Import Parameters /* * Find and create top-level integration object */ iAccountObj = inputMsg.GetIntObj ("Account - Get SAP Order List (MO)"); oGLObj = outputMsg.CreateIntObj ("Account - Get SAP Order List (BAPI Input)"); /* * Read int object instances from EAI message */ while (iAccountObj.NextInstance ()) { /* * Create "Get List for Account" object */ oGLObj.NewInstance (); /* * Read "Account" component */ iAccountComp = iAccountObj.GetPrimaryIntComp ("Account"); oGLImportComp = oGLObj.CreatePrimaryIntComp ("Import Parameters"); if (iAccountComp.NextRecord ()) { /* * Write "Import Parameters" component */ oGLImportComp.NewRecord (); oGLImportComp.SetCopySource (iAccountComp); var intId = iAccountComp.GetFieldValue( "Integration Id" ); var fromDate = iAccountComp.GetFieldValue( "Back Office Order Query Start Dt" ); //nbc var toDate = iAccountComp.GetFieldValue( "Back Office Order Query End Dt" ); //nbc oGLImportComp.SetFieldValue ("CUSTOMER_NUMBER",intId ); oGLImportComp.SetFieldValue ("MATERIAL", ""); oGLImportComp.SetFieldValue ("PURCHASE_ORDER", ""); // "Peter 1"; oGLImportComp.SetFieldValue ("DOCUMENT_DATE", fromDate ); // Empty string means "00000000" oGLImportComp.SetFieldValue ("DOCUMENT_DATE_TO", toDate ); // Empty string means "00000000" // Read the primary sales area var primOrgId = iAccountComp.GetFieldValue("Primary Organization Id"); var OrgBusObj = TheApplication().GetBusObject("Organizations"); var OrgBusCmp = OrgBusObj.GetBusComp("Organization"); // Set View Mode to 3 (or AllView) OrgBusCmp.SetViewMode(3); OrgBusCmp.ClearToQuery(); OrgBusCmp.SetSearchSpec("Id", primOrgId); OrgBusCmp.ActivateField("Back Office Sales Organization"); OrgBusCmp.ExecuteQuery(); if(OrgBusCmp.FirstRecord()) { var SalesOrg = OrgBusCmp.GetFieldValue("Back Office Sales Organization"); // Write "Import Parameters" component oGLImportComp.SetFieldValue( "SALES_ORGANIZATION", SalesOrg ); } } } }

Account - SAP Maps (MO)
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ /* * Get ActiveBusComp & RowID */ // var CurBC = TheApplication().ActiveBusComp(); // var rowid = CurBC.GetFieldValue("Id"); //nbc while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx // oOrderComp.CopyFieldValue ("Order Number", "Order Number"); //nbcxx // oOrderComp.CopyFieldValue ("Order Number", rowid); //nbc // oOrderComp.SetFieldValue ("Order Type", // orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type"))); var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); // oOrderComp.CopyFieldValue ("Primary Organization Id", "SAP Organization Id (MO)"); // PLim. ??? Set Organization until we can figure out how to fix dup key index problem // was: oOrderComp.CopyFieldValue ("Organization", "Organization"); // oOrderComp.CopyFieldValue ("Account Location", "Account Location"); // } // oOrderOrgComp.NewInstance (); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); // while (iGLOrderComp.NextRecord ()) // { oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp);

Account - SAP Maps (MO)
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ /* * Get ActiveBusComp & RowID */ // var CurBC = TheApplication().ActiveBusComp(); // var rowid = CurBC.GetFieldValue("Id"); //nbc while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx // oOrderComp.CopyFieldValue ("Order Number", "Order Number"); //nbcxx // oOrderComp.CopyFieldValue ("Order Number", rowid); //nbc // oOrderComp.SetFieldValue ("Order Type", // orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type"))); var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); // oOrderComp.CopyFieldValue ("Primary Organization Id", "SAP Organization Id (MO)"); // PLim. ??? Set Organization until we can figure out how to fix dup key index problem // was: oOrderComp.CopyFieldValue ("Organization", "Organization"); // oOrderComp.CopyFieldValue ("Account Location", "Account Location"); // } // oOrderOrgComp.NewInstance (); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); // while (iGLOrderComp.NextRecord ()) // { oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp);

Account - SAP Maps (MO)
ImportSAPOrder_GetSAPOrderListToSiebelOrder
function ImportSAPOrder_GetSAPOrderListToSiebelOrder (inputMsg, outputMsg) { /* * Input Objects' Integration Components * Import Get List for Account (Account - Import SAP Order (Get SAP Order List) (MO)) * Get List for Account Header * * Output Object's Integration Components: * Import (Account - Import SAP Order (Siebel Order) (MO)) * Order (oOrder) */ /* * Set up EAI Lookup maps */ var orderTypeLM = EAIGetValueMap ("SAP Order Types", "Siebel Inbound"); /* * Set up EAI Input Message objects */ var iGLOrderObj; // Get List instance var iGLOrderComp; // Get List Order /* * Set up EAI Output Message objects */ var oOrderObj; // Siebel Order instance var oOrderComp; // Order var oOrderOrgComp; // Order Organization /* * Find and create top-level integration object */ iGLOrderObj = inputMsg.GetIntObj ("Account - Import SAP Order (Get SAP Order List) (MO)"); oOrderObj = outputMsg.CreateIntObj ("Account - Import SAP Order (Siebel Order) (MO)"); /* * Read int object instances from EAI message */ /* * Get ActiveBusComp & RowID */ // var CurBC = TheApplication().ActiveBusComp(); // var rowid = CurBC.GetFieldValue("Id"); //nbc while (iGLOrderObj.NextInstance ()) { /* * Create "Order" object */ oOrderObj.NewInstance (); /* * Read "Get List Order" component */ iGLOrderComp = iGLOrderObj.GetPrimaryIntComp ("Get List for Account Header"); oOrderComp = oOrderObj.CreatePrimaryIntComp ("Order"); while (iGLOrderComp.NextRecord ()) { /* * Write "Order" component */ oOrderComp.NewRecord (); oOrderComp.SetCopySource (iGLOrderComp); var SiebOrdNo = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx if (SiebOrdNo == "") //xx { //xx var OrdNumber = iGLOrderComp.GetFieldValue("Order Number"); //xx } //xx else { //xx var OrdNumber = iGLOrderComp.GetFieldValue ("Siebel Order Number");//xx } //xx oOrderComp.SetFieldValue ("Order Number", OrdNumber);//xx // oOrderComp.CopyFieldValue ("Order Number", "Order Number"); //nbcxx // oOrderComp.CopyFieldValue ("Order Number", rowid); //nbc // oOrderComp.SetFieldValue ("Order Type", // orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type"))); var oTypeSAP = orderTypeLM.Translate (iGLOrderComp.GetFieldValue ("Order Type")); var oType = TheApplication().InvokeMethod ("LookupValue", "FS_ORDER_TYPE", oTypeSAP); oOrderComp.SetFieldValue ("Order Type", oType); oOrderComp.CopyFieldValue ("Order Date", "Order Date"); oOrderComp.CopyFieldValue ("Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Bill To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Ship To Account Integration Id", "Sold To Customer"); oOrderComp.CopyFieldValue ("Integration Id", "Order Number"); // oOrderComp.CopyFieldValue ("Primary Organization Id", "SAP Organization Id (MO)"); // PLim. ??? Set Organization until we can figure out how to fix dup key index problem // was: oOrderComp.CopyFieldValue ("Organization", "Organization"); // oOrderComp.CopyFieldValue ("Account Location", "Account Location"); // } // oOrderOrgComp.NewInstance (); oOrderOrgComp = oOrderComp.CreateIntComp("Order Entry - Orders_Organization"); // while (iGLOrderComp.NextRecord ()) // { oOrderOrgComp.NewRecord(); oOrderOrgComp.SetCopySource (iGLOrderComp);

Account - SAP Maps (MO)
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP Maps (MO)
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP Maps (MO)
LocalizeMessage
function LocalizeMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ERR_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ERR_MSG"; var LOVType = "CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account - SAP Maps (MO)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account - SAP Maps (MO)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account - SAP Maps (MO)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { var result = EAIExecuteMap (MethodName, Inputs, Outputs); return result; }

Account BS SCM
(declarations)
var oApp : Application; var bIsTraceOn : bool;

Account BS SCM
(declarations)
var oApp : Application; var bIsTraceOn : bool;

Account BS SCM
BCActivateRecord
function BCActivateRecord(&BCAdd, bActivate:bool) { /***************************************************************************** * Function: BCActivateRecord * Purpose : Function to activate necessary records in BC * 'Account Address Ligth SCM' before EceuteQuery it is called from * 'DuplicateAccountSearchCompany' and 'DuplicateAccountSearchPerson' * Params : BCAdd - a reference to the above BC * bActivate - if true activate the fields *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ------------------------------------------------- * 2009-11-04 Gema Torres created * 2010-07-26 Gema Torres CR 412 Required to display Id Type and Id # * 2011-08-29 tgdstre0 defect # 40504 * 2012-02-16 TGDHURO9 new header added; defect 46847 PROD: Duplicate * check shows the wrong main address. *****************************************************************************/ try { if (bActivate) { BCAdd.ActivateField("Account Contact First Name SCM"); BCAdd.ActivateField("Account Phonetic Name SCM"); BCAdd.ActivateField("Strassennummer"); BCAdd.ActivateField("Account Contact BirhtDate SCM"); BCAdd.ActivateField("Primary Account Postal Code SCM"); BCAdd.ActivateField("Primary Account City SCM"); BCAdd.ActivateField("Residence Description SCM"); BCAdd.ActivateField("Location Supplement SCM"); BCAdd.ActivateField("Account Grobsegment SCM"); BCAdd.ActivateField("Primary Account Street Address SCM"); BCAdd.ActivateField("Calculated Duplicate Name SCM"); BCAdd.ActivateField("Account Sub Type SCM"); BCAdd.ActivateField("Account Status SCM"); BCAdd.ActivateField("Location Id denormalized SCM"); BCAdd.ActivateField("Account Swisscom Customer Number SCM"); BCAdd.ActivateField("Parent Grobsegment SCM"); BCAdd.ActivateField("Prepayment Flag SCM"); BCAdd.ActivateField("Account Id"); //CR 412 TGDTOGE3 26.07.2010 Required to display Id Type and Id # BCAdd.ActivateField("Id Type SCM"); BCAdd.ActivateField("Id # SCM"); BCAdd.ActivateField("Address Relation Type SCM"); // 2011-08-29; tgdstre0; defect # 40504 BCAdd.ActivateField("Address Status SCM"); // 2012-02-16 TGDHURO9 Defect 46847 } BCAdd.SetViewMode(AllView); BCAdd.ClearToQuery(); // SCM 2012-02-16 TGDHURO9 Defect 46847 var INACTIVE = "'" + oApp.InvokeMethod("LookupValue", "ACCT_ADD_TYPE", "Inactive") + "'"; var DELETED = "'" + oApp.InvokeMethod("LookupValue", "ACCT_ADD_TYPE", "Deleted") + "'"; var f = "Address Status SCM"; BCAdd.SetSearchSpec(f, " <> " + INACTIVE + " AND [" + f + "] <> " + DELETED); } catch(e) { oApp.RaiseErrorText(e.toString()); } }

Account BS SCM
BCActivateRecord
function BCActivateRecord(&BCAdd, bActivate:bool) { /***************************************************************************** * Function: BCActivateRecord * Purpose : Function to activate necessary records in BC * 'Account Address Ligth SCM' before EceuteQuery it is called from * 'DuplicateAccountSearchCompany' and 'DuplicateAccountSearchPerson' * Params : BCAdd - a reference to the above BC * bActivate - if true activate the fields *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ------------------------------------------------- * 2009-11-04 Gema Torres created * 2010-07-26 Gema Torres CR 412 Required to display Id Type and Id # * 2011-08-29 tgdstre0 defect # 40504 * 2012-02-16 TGDHURO9 new header added; defect 46847 PROD: Duplicate * check shows the wrong main address. *****************************************************************************/ try { if (bActivate) { BCAdd.ActivateField("Account Contact First Name SCM"); BCAdd.ActivateField("Account Phonetic Name SCM"); BCAdd.ActivateField("Strassennummer"); BCAdd.ActivateField("Account Contact BirhtDate SCM"); BCAdd.ActivateField("Primary Account Postal Code SCM"); BCAdd.ActivateField("Primary Account City SCM"); BCAdd.ActivateField("Residence Description SCM"); BCAdd.ActivateField("Location Supplement SCM"); BCAdd.ActivateField("Account Grobsegment SCM"); BCAdd.ActivateField("Primary Account Street Address SCM"); BCAdd.ActivateField("Calculated Duplicate Name SCM"); BCAdd.ActivateField("Account Sub Type SCM"); BCAdd.ActivateField("Account Status SCM"); BCAdd.ActivateField("Location Id denormalized SCM"); BCAdd.ActivateField("Account Swisscom Customer Number SCM"); BCAdd.ActivateField("Parent Grobsegment SCM"); BCAdd.ActivateField("Prepayment Flag SCM"); BCAdd.ActivateField("Account Id"); //CR 412 TGDTOGE3 26.07.2010 Required to display Id Type and Id # BCAdd.ActivateField("Id Type SCM"); BCAdd.ActivateField("Id # SCM"); BCAdd.ActivateField("Address Relation Type SCM"); // 2011-08-29; tgdstre0; defect # 40504 BCAdd.ActivateField("Address Status SCM"); // 2012-02-16 TGDHURO9 Defect 46847 } BCAdd.SetViewMode(AllView); BCAdd.ClearToQuery(); // SCM 2012-02-16 TGDHURO9 Defect 46847 var INACTIVE = "'" + oApp.InvokeMethod("LookupValue", "ACCT_ADD_TYPE", "Inactive") + "'"; var DELETED = "'" + oApp.InvokeMethod("LookupValue", "ACCT_ADD_TYPE", "Deleted") + "'"; var f = "Address Status SCM"; BCAdd.SetSearchSpec(f, " <> " + INACTIVE + " AND [" + f + "] <> " + DELETED); } catch(e) { oApp.RaiseErrorText(e.toString()); } }

Account BS SCM
BCHasRecord
/******************************************************* ** Name:noed: 14.03.2009 ** Created By: Iñaki R. Zabalegui ** Description: Generic script to check if the applet is displaying ** any record. Normally used to activate or inactivate buttons in the ** precaninvoke method. -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function BCHasRecord(&oBC) { try { var cId = oBC.GetFieldValue("Id"); return(true); } catch(e) { return(false); } finally { } }

Account BS SCM
BCHasRecord
/******************************************************* ** Name:noed: 14.03.2009 ** Created By: Iñaki R. Zabalegui ** Description: Generic script to check if the applet is displaying ** any record. Normally used to activate or inactivate buttons in the ** precaninvoke method. -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function BCHasRecord(&oBC) { try { var cId = oBC.GetFieldValue("Id"); return(true); } catch(e) { return(false); } finally { } }

Account BS SCM
ChangeHQFlg
function ChangeHQFlg(){ /******************************************************* ** Name: ChangeHQFlg ** Created: 17.07.2008 ** Created By: Rosalyn Ramùrez ** Description: ** -------------------- Modifications --------------------- ** Modification 21.9.2010 tgdlabr1 Added LookupMessage X_NO_CHANGE_HEADQUARTER_FOR_PREPAID_SCM ******************************************************/ var BOAccnt:BusObject = null; var BOServiceRequest:BusObject = null; var BCAccnt:BusComp = null; var BCSA:BusComp = null; var BCSR:BusComp = null; var svc:Service; var psInputs:PropertySet; var psOutputs:PropertySet; var strCMAId:chars = ""; var strPrepayment:chars = ""; var strOldSAId:chars = ""; var strSAId:chars = ""; var SRId:chars = ""; try{ if(bIsTraceOn)oApp.Trace(this.Name() + ".ChangeHQFlg START"); BOAccnt = TheApplication().ActiveBusObject(); BCAccnt = BOAccnt.GetBusComp("Account"); strCMAId =BCAccnt.GetFieldValue("Id"); BCSA = BOAccnt.GetBusComp("Service Account SCM"); strPrepayment = BCAccnt.GetFieldValue("Prepayment Flag SCM"); strOldSAId =BCAccnt.GetFieldValue("Primary Service Account Id SCM"); strSAId = BCSA.GetFieldValue("Id"); if(strPrepayment == "N"){ //Neccesary properties and variables svc = TheApplication().GetService("Workflow Process Manager"); psInputs = TheApplication().NewPropertySet(); psOutputs = TheApplication().NewPropertySet(); //Set the properties psInputs.SetProperty("ProcessName", "Automatic SR Creation SCM"); psInputs.SetProperty("Object Id", strSAId); //LIC of the desired Area psInputs.SetProperty("Area", "Customer Data"); psInputs.SetProperty("Sub-Area", "09.13 Maintain customer struct"); psInputs.SetProperty("Detail", "change headquarter"); psInputs.SetProperty("Entity", "Customer"); //Invoke the workflow svc.InvokeMethod("RunProcess", psInputs, psOutputs); //Get the Id of the SR that has just been created SRId = psOutputs.GetProperty("Siebel Operation Object Id"); //The Headquater change must be done after the SR creation BCAccnt.SetFieldValue("Primary Service Account Id SCM",strSAId); BCAccnt.WriteRecord(); //Get BC Service Request BOServiceRequest = TheApplication().GetBusObject("Service Request"); BCSR = BOServiceRequest.GetBusComp("Service Request"); //Look for the SR recently created BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id", SRId); BCSR.ExecuteQuery(ForwardOnly); BCSR.WriteRecord(); //The SR must be submitted*/ BCSR.InvokeMethod("SubmitSR"); //2014-06-02 TGDGEMAM: added due to DROP Aug14 MaintainFGPAssets("Transfer", strOldSAId, strSAId); } else{ if(bIsTraceOn)oApp.Trace(this.Name() + ".ChangeHQFlg ERROR X_NO_CHANGE_HEADQUARTER_FOR_PREPAID_SCM"); TheApplication().RaiseError("X_NO_CHANGE_HEADQUARTER_FOR_PREPAID_SCM"); } } catch(e){ if(bIsTraceOn)oApp.Trace(this.Name() + ".ChangeHQFlg ERROR: " + e.message); throw(e) } finally{ strCMAId = null; strPrepayment = null; strSAId = null; SRId = null; BCSR = null; BOServiceRequest = null; BCSA = null; BCAccnt = null; BOAccnt = null; psOutputs = null; psInputs = null; svc = null; } }

Account BS SCM
ChangeHQFlg
function ChangeHQFlg(){ /******************************************************* ** Name: ChangeHQFlg ** Created: 17.07.2008 ** Created By: Rosalyn Ramùrez ** Description: ** -------------------- Modifications --------------------- ** Modification 21.9.2010 tgdlabr1 Added LookupMessage X_NO_CHANGE_HEADQUARTER_FOR_PREPAID_SCM ******************************************************/ var BOAccnt:BusObject = null; var BOServiceRequest:BusObject = null; var BCAccnt:BusComp = null; var BCSA:BusComp = null; var BCSR:BusComp = null; var svc:Service; var psInputs:PropertySet; var psOutputs:PropertySet; var strCMAId:chars = ""; var strPrepayment:chars = ""; var strOldSAId:chars = ""; var strSAId:chars = ""; var SRId:chars = ""; try{ if(bIsTraceOn)oApp.Trace(this.Name() + ".ChangeHQFlg START"); BOAccnt = TheApplication().ActiveBusObject(); BCAccnt = BOAccnt.GetBusComp("Account"); strCMAId =BCAccnt.GetFieldValue("Id"); BCSA = BOAccnt.GetBusComp("Service Account SCM"); strPrepayment = BCAccnt.GetFieldValue("Prepayment Flag SCM"); strOldSAId =BCAccnt.GetFieldValue("Primary Service Account Id SCM"); strSAId = BCSA.GetFieldValue("Id"); if(strPrepayment == "N"){ //Neccesary properties and variables svc = TheApplication().GetService("Workflow Process Manager"); psInputs = TheApplication().NewPropertySet(); psOutputs = TheApplication().NewPropertySet(); //Set the properties psInputs.SetProperty("ProcessName", "Automatic SR Creation SCM"); psInputs.SetProperty("Object Id", strSAId); //LIC of the desired Area psInputs.SetProperty("Area", "Customer Data"); psInputs.SetProperty("Sub-Area", "09.13 Maintain customer struct"); psInputs.SetProperty("Detail", "change headquarter"); psInputs.SetProperty("Entity", "Customer"); //Invoke the workflow svc.InvokeMethod("RunProcess", psInputs, psOutputs); //Get the Id of the SR that has just been created SRId = psOutputs.GetProperty("Siebel Operation Object Id"); //The Headquater change must be done after the SR creation BCAccnt.SetFieldValue("Primary Service Account Id SCM",strSAId); BCAccnt.WriteRecord(); //Get BC Service Request BOServiceRequest = TheApplication().GetBusObject("Service Request"); BCSR = BOServiceRequest.GetBusComp("Service Request"); //Look for the SR recently created BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id", SRId); BCSR.ExecuteQuery(ForwardOnly); BCSR.WriteRecord(); //The SR must be submitted*/ BCSR.InvokeMethod("SubmitSR"); //2014-06-02 TGDGEMAM: added due to DROP Aug14 MaintainFGPAssets("Transfer", strOldSAId, strSAId); } else{ if(bIsTraceOn)oApp.Trace(this.Name() + ".ChangeHQFlg ERROR X_NO_CHANGE_HEADQUARTER_FOR_PREPAID_SCM"); TheApplication().RaiseError("X_NO_CHANGE_HEADQUARTER_FOR_PREPAID_SCM"); } } catch(e){ if(bIsTraceOn)oApp.Trace(this.Name() + ".ChangeHQFlg ERROR: " + e.message); throw(e) } finally{ strCMAId = null; strPrepayment = null; strSAId = null; SRId = null; BCSR = null; BOServiceRequest = null; BCSA = null; BCAccnt = null; BOAccnt = null; psOutputs = null; psInputs = null; svc = null; } }

Account BS SCM
ChangeInStructuring
/* ** Name of the Method: OneCRM Change in Structuring ** Description: This method changes the Owner Account Id relation in the asset, from one CMA to anoher one. */ /*-------------------- Modifications --------------------- ** Date: 26.7.2011 ** Changed By: TGDLABR1 ** Description: remove check if old cma is not set on SR anymore ** ** Date: 25.6.2013 ** Changed By: TGDGEMAM ** Description: added function call "RefreshSAContracts" ** ******************************************************/ function ChangeInStructuring(Inputs,Outputs) { var BOAcc; var BOActiveSR; var BCSR; var BCAcc; var BOAsset; var BCAsset; // TGDHAKA8 01.09.2010 CR 342 var BCInvoiceProfile; var SRId=""; var strSAId=""; var strCMAId=""; var strHQSAId=""; var searchSpec=""; //Added CDM tgdpima25.08.2010 var svcBS; var InputPS; var OutputPS; // TGDHAKA8 20.09.2010 Project CDM var aBOAccount=null; var bBOAccount=null; var aBCAccount=null; var aBCAccountContact=null; var bBCAccountContact=null; var bBCContactRole=null; var isRecord; try{ BOActiveSR = oApp.GetBusObject("EAI Plain Entity Model (Service Request) SCM"); BCSR = BOActiveSR.GetBusComp("Service Request"); SRId = Inputs.GetProperty("SRId"); BCSR.ActivateField("Account Id"); BCSR.ActivateField("Secondary Account Id SCM"); BCSR.SetViewMode(AllView); BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id",SRId); BCSR.ExecuteQuery(ForwardOnly); strSAId = BCSR.GetFieldValue("Account Id"); /* 24.02.10: Begin - issue# 20264*/ BOAcc = TheApplication().GetBusObject("Account"); //BOAcc = TheApplication().GetBusObject("EAI Account Asset IO SCM"); //End - issue# 20264 BCAcc = BOAcc.GetBusComp("Account"); /* 22.02.10: Begin - issue# 20099 BCAcc.ActivateField("Parent Account Id");*/ BCAcc.ActivateField("Calculated CMA Account Id SCM"); //End - issue# 20099 BCAcc.ActivateField("Customer Master Account Id SCM"); //TGDGEMAM 2014-06-02: added due to DROP Aug14 BCAcc.ActivateField("Parent Primary SA Id SCM"); BCAcc.SetViewMode(AllView); BCAcc.ClearToQuery(); BCAcc.SetSearchSpec("Id",strSAId); BCAcc.ExecuteQuery(ForwardOnly); if (BCAcc.FirstRecord()){ /* 24.02.10: Begin - issue# 20099 strCMAId = BCAcc.GetFieldValue("Parent Account Id");*/ strCMAId = BCAcc.GetFieldValue("Calculated CMA Account Id SCM"); //End - issue# 20099 //TGDGEMAM 2014-06-02: added due to DROP Aug14 strHQSAId = BCAcc.GetFieldValue("Parent Primary SA Id SCM"); /*24.02.10: Begin - issue# 20264 BCAsset = BOAcc.GetBusComp("Asset Mgmt - Subscription Asset SCM"); old: BOAsset = TheApplication().GetBusObject("Asset Management"); old: BCAsset = BOAsset.GetBusComp("Asset Mgmt - Asset"); */ //End - issue# 20264 // 10.09.13: Begin - issue# 73327 // changed BO/BC due to class-based readonly side-effects BOAsset = TheApplication().GetBusObject("Asset Lite SCM"); BCAsset = BOAsset.GetBusComp("Asset Lite SCM"); //End - issue# 73327 /*24.02.10: Begin - issue# 20264 BCAsset.ActivateField("Owner Account Id SCM");*/ BCAsset.ActivateField("Owner Account Id"); //End - issue# 20264 BCAsset.SetViewMode(AllView); BCAsset.ClearToQuery(); /*24.02.10: Begin - issue# 20264 old: BCAsset.SetSearchSpec("Service Account Id",strSAId); new: searchSpec="[Service Account Id]='"+strSAId+"' and [Parent Asset Id] IS NULL"; */ //End - issue# 20264 /*10.09.13: Begin - issue# 73327 old: searchSpec="[Service Account Id]='"+strSAId+"' and [Parent Asset Id] IS NULL"; new: searchSpec="[Service Account Id]='"+strSAId+"'"; */ searchSpec="[Service Account Id]='"+strSAId+"'"; //End - issue# 73327 BCAsset.SetSearchExpr(searchSpec); BCAsset.ExecuteQuery(ForwardOnly); if (BCAsset.FirstRecord()){ do{ /*24.02.10: Begin - issue# 20264 BCAsset.SetFieldValue("Owner Account Id SCM", strCMAId);*/ BCAsset.SetFieldValue("Owner Account Id", strCMAId); //End - issue# 20264 BCAsset.WriteRecord(); } while(BCAsset.NextRecord())

Account BS SCM
ChangeInStructuring
/* ** Name of the Method: OneCRM Change in Structuring ** Description: This method changes the Owner Account Id relation in the asset, from one CMA to anoher one. */ /*-------------------- Modifications --------------------- ** Date: 26.7.2011 ** Changed By: TGDLABR1 ** Description: remove check if old cma is not set on SR anymore ** ** Date: 25.6.2013 ** Changed By: TGDGEMAM ** Description: added function call "RefreshSAContracts" ** ******************************************************/ function ChangeInStructuring(Inputs,Outputs) { var BOAcc; var BOActiveSR; var BCSR; var BCAcc; var BOAsset; var BCAsset; // TGDHAKA8 01.09.2010 CR 342 var BCInvoiceProfile; var SRId=""; var strSAId=""; var strCMAId=""; var strHQSAId=""; var searchSpec=""; //Added CDM tgdpima25.08.2010 var svcBS; var InputPS; var OutputPS; // TGDHAKA8 20.09.2010 Project CDM var aBOAccount=null; var bBOAccount=null; var aBCAccount=null; var aBCAccountContact=null; var bBCAccountContact=null; var bBCContactRole=null; var isRecord; try{ BOActiveSR = oApp.GetBusObject("EAI Plain Entity Model (Service Request) SCM"); BCSR = BOActiveSR.GetBusComp("Service Request"); SRId = Inputs.GetProperty("SRId"); BCSR.ActivateField("Account Id"); BCSR.ActivateField("Secondary Account Id SCM"); BCSR.SetViewMode(AllView); BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id",SRId); BCSR.ExecuteQuery(ForwardOnly); strSAId = BCSR.GetFieldValue("Account Id"); /* 24.02.10: Begin - issue# 20264*/ BOAcc = TheApplication().GetBusObject("Account"); //BOAcc = TheApplication().GetBusObject("EAI Account Asset IO SCM"); //End - issue# 20264 BCAcc = BOAcc.GetBusComp("Account"); /* 22.02.10: Begin - issue# 20099 BCAcc.ActivateField("Parent Account Id");*/ BCAcc.ActivateField("Calculated CMA Account Id SCM"); //End - issue# 20099 BCAcc.ActivateField("Customer Master Account Id SCM"); //TGDGEMAM 2014-06-02: added due to DROP Aug14 BCAcc.ActivateField("Parent Primary SA Id SCM"); BCAcc.SetViewMode(AllView); BCAcc.ClearToQuery(); BCAcc.SetSearchSpec("Id",strSAId); BCAcc.ExecuteQuery(ForwardOnly); if (BCAcc.FirstRecord()){ /* 24.02.10: Begin - issue# 20099 strCMAId = BCAcc.GetFieldValue("Parent Account Id");*/ strCMAId = BCAcc.GetFieldValue("Calculated CMA Account Id SCM"); //End - issue# 20099 //TGDGEMAM 2014-06-02: added due to DROP Aug14 strHQSAId = BCAcc.GetFieldValue("Parent Primary SA Id SCM"); /*24.02.10: Begin - issue# 20264 BCAsset = BOAcc.GetBusComp("Asset Mgmt - Subscription Asset SCM"); old: BOAsset = TheApplication().GetBusObject("Asset Management"); old: BCAsset = BOAsset.GetBusComp("Asset Mgmt - Asset"); */ //End - issue# 20264 // 10.09.13: Begin - issue# 73327 // changed BO/BC due to class-based readonly side-effects BOAsset = TheApplication().GetBusObject("Asset Lite SCM"); BCAsset = BOAsset.GetBusComp("Asset Lite SCM"); //End - issue# 73327 /*24.02.10: Begin - issue# 20264 BCAsset.ActivateField("Owner Account Id SCM");*/ BCAsset.ActivateField("Owner Account Id"); //End - issue# 20264 BCAsset.SetViewMode(AllView); BCAsset.ClearToQuery(); /*24.02.10: Begin - issue# 20264 old: BCAsset.SetSearchSpec("Service Account Id",strSAId); new: searchSpec="[Service Account Id]='"+strSAId+"' and [Parent Asset Id] IS NULL"; */ //End - issue# 20264 /*10.09.13: Begin - issue# 73327 old: searchSpec="[Service Account Id]='"+strSAId+"' and [Parent Asset Id] IS NULL"; new: searchSpec="[Service Account Id]='"+strSAId+"'"; */ searchSpec="[Service Account Id]='"+strSAId+"'"; //End - issue# 73327 BCAsset.SetSearchExpr(searchSpec); BCAsset.ExecuteQuery(ForwardOnly); if (BCAsset.FirstRecord()){ do{ /*24.02.10: Begin - issue# 20264 BCAsset.SetFieldValue("Owner Account Id SCM", strCMAId);*/ BCAsset.SetFieldValue("Owner Account Id", strCMAId); //End - issue# 20264 BCAsset.WriteRecord(); } while(BCAsset.NextRecord())

Account BS SCM
CheckPrimarySA
/******************************************************* ** Name: Primary_Contact_Search ** Created: 30.08.2008 ** Created By: F. Javier Gomez Ayerbe / Gema Torres ** Description: ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function CheckPrimarySA() { var BOActiveAccount; var BCActiveAccount; var sSubType; var AccId; var ParAccId; var BOParAccount; var BCParAccount; var sPrimarySA; try { //Get Active BO, BCs from the context BOActiveAccount = TheApplication().ActiveBusObject(); BCActiveAccount = BOActiveAccount.GetBusComp("Account"); sSubType = BCActiveAccount.GetFieldValue("Sub Type SCM"); if(sSubType == TheApplication().InvokeMethod("LookupValue","ACCOUNT_SUB_TYPE_SCM","SA")) { AccId = BCActiveAccount.GetFieldValue("Id"); ParAccId = BCActiveAccount.GetFieldValue("Parent Account Id"); //Get the SA Parent Account from DB BOParAccount = TheApplication().GetBusObject("Account"); BCParAccount = BOParAccount.GetBusComp("Account"); BCParAccount.ActivateField("Primary Service Account Id SCM"); BCParAccount.ClearToQuery(); BCParAccount.SetSearchSpec("Id",ParAccId); //BCParAccount.SetSearchSpec("Sub Type SCM", TheApplication().InvokeMethod("LookupValue","ACCOUNT_SUB_TYPE_SCM","CMA")); BCParAccount.ExecuteQuery(ForwardOnly); if (BCParAccount.FirstRecord()) { sPrimarySA = BCParAccount.GetFieldValue("Primary Service Account Id SCM"); //Check if the active SA is the primary SA to delete this relationship if (sPrimarySA == AccId){ BCParAccount.SetFieldValue("Primary Service Account Id SCM", ""); BCParAccount.WriteRecord(); } } } } catch(e){ TheApplication().RaiseErrorText(e.toString()); } finally{ BCParAccount = null; BOParAccount = null; BCActiveAccount = null; BOActiveAccount = null; AccId = null; ParAccId = null; } }

Account BS SCM
CheckPrimarySA
/******************************************************* ** Name: Primary_Contact_Search ** Created: 30.08.2008 ** Created By: F. Javier Gomez Ayerbe / Gema Torres ** Description: ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function CheckPrimarySA() { var BOActiveAccount; var BCActiveAccount; var sSubType; var AccId; var ParAccId; var BOParAccount; var BCParAccount; var sPrimarySA; try { //Get Active BO, BCs from the context BOActiveAccount = TheApplication().ActiveBusObject(); BCActiveAccount = BOActiveAccount.GetBusComp("Account"); sSubType = BCActiveAccount.GetFieldValue("Sub Type SCM"); if(sSubType == TheApplication().InvokeMethod("LookupValue","ACCOUNT_SUB_TYPE_SCM","SA")) { AccId = BCActiveAccount.GetFieldValue("Id"); ParAccId = BCActiveAccount.GetFieldValue("Parent Account Id"); //Get the SA Parent Account from DB BOParAccount = TheApplication().GetBusObject("Account"); BCParAccount = BOParAccount.GetBusComp("Account"); BCParAccount.ActivateField("Primary Service Account Id SCM"); BCParAccount.ClearToQuery(); BCParAccount.SetSearchSpec("Id",ParAccId); //BCParAccount.SetSearchSpec("Sub Type SCM", TheApplication().InvokeMethod("LookupValue","ACCOUNT_SUB_TYPE_SCM","CMA")); BCParAccount.ExecuteQuery(ForwardOnly); if (BCParAccount.FirstRecord()) { sPrimarySA = BCParAccount.GetFieldValue("Primary Service Account Id SCM"); //Check if the active SA is the primary SA to delete this relationship if (sPrimarySA == AccId){ BCParAccount.SetFieldValue("Primary Service Account Id SCM", ""); BCParAccount.WriteRecord(); } } } } catch(e){ TheApplication().RaiseErrorText(e.toString()); } finally{ BCParAccount = null; BOParAccount = null; BCActiveAccount = null; BOActiveAccount = null; AccId = null; ParAccId = null; } }

Account BS SCM
ContactBelongsToCustomer
/******************************************************* ** Name:noed: 03.11.2009 ** Created By: TGDTOGE3 ** Description: method that checks if a contact belongs to other customer ** This script is invoked when a customer is inactivated. If the contact ** which is customer is not related to any other customer then the contact ** should have the status inactive. ** ** In case contact is not found function returns false. -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function ContactBelongsToCustomer(Inputs, Outputs) { var strAccountId; var strPrimContact; var BOAccContact; var BCAccContact; var BCAccContactInter; var searchExpr=""; try { strAccountId = Inputs.GetProperty("Account Id"); strPrimContact = Inputs.GetProperty("Contact Id"); //Intance of Business Component Account Contact SCM BOAccContact = TheApplication().GetBusObject("Contact"); BCAccContact = BOAccContact.GetBusComp("Contact"); BCAccContactInter = BOAccContact.GetBusComp("Account Contact SCM"); BCAccContact.SetViewMode(AllView); BCAccContact.ActivateField("Status"); BCAccContact.ClearToQuery(); BCAccContact.SetSearchSpec("Id", strPrimContact); BCAccContact.ExecuteQuery(ForwardOnly); if (BCAccContact.FirstRecord()) { searchExpr= BCAccContactInter.GetSearchExpr(); if (searchExpr != null && searchExpr != "") { //TGDBEJA6 03.09.2010 Project CDM //searchExpr=searchExpr+" AND [Accnt Id] <> '"+strAccountId+"'"; searchExpr=searchExpr+" AND [Accnt Id] <> '"+strAccountId+"' AND [End Date SCM] IS NULL"; } else { //TGDBEJA6 03.09.2010 Project CDM //searchExpr="[Accnt Id] <> '"+strAccountId+"' AND"; searchExpr="[Accnt Id] <> '"+strAccountId+"' AND [End Date SCM] IS NULL"; } BCAccContactInter.ClearToQuery(); BCAccContactInter.SetSearchExpr (searchExpr); BCAccContactInter.ExecuteQuery(ForwardOnly); if (BCAccContactInter.FirstRecord()) {//If a record is found that means the contact is related to other customer. Outputs.SetProperty("ContactCustomer", "TRUE");//This property set is used to display a custom browser script in the applet return false; } else { //TGDBEJA6 03.09.2010 Project CDM Remove Inactivation of Contact //BCAccContact.SetFieldValue("Status", TheApplication().InvokeMethod("LookupValue", "CONTACT_STATUS", "Inactive")); //BCAccContact.WriteRecord(); //This property set is used to display a custom browser script in the applet Outputs.SetProperty("ContactCustomer", "FALSE"); return true; } } else //In case the contact is not found. return false; } catch(e) { TheApplication().RaiseErrorText(e.toString()); } finally { searchExpr=null; strAccountId=null; strPrimContact = null; BCAccContact = null; BCAccContactInter = null; BOAccContact = null; } }

Account BS SCM
ContactBelongsToCustomer
/******************************************************* ** Name:noed: 03.11.2009 ** Created By: TGDTOGE3 ** Description: method that checks if a contact belongs to other customer ** This script is invoked when a customer is inactivated. If the contact ** which is customer is not related to any other customer then the contact ** should have the status inactive. ** ** In case contact is not found function returns false. -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function ContactBelongsToCustomer(Inputs, Outputs) { var strAccountId; var strPrimContact; var BOAccContact; var BCAccContact; var BCAccContactInter; var searchExpr=""; try { strAccountId = Inputs.GetProperty("Account Id"); strPrimContact = Inputs.GetProperty("Contact Id"); //Intance of Business Component Account Contact SCM BOAccContact = TheApplication().GetBusObject("Contact"); BCAccContact = BOAccContact.GetBusComp("Contact"); BCAccContactInter = BOAccContact.GetBusComp("Account Contact SCM"); BCAccContact.SetViewMode(AllView); BCAccContact.ActivateField("Status"); BCAccContact.ClearToQuery(); BCAccContact.SetSearchSpec("Id", strPrimContact); BCAccContact.ExecuteQuery(ForwardOnly); if (BCAccContact.FirstRecord()) { searchExpr= BCAccContactInter.GetSearchExpr(); if (searchExpr != null && searchExpr != "") { //TGDBEJA6 03.09.2010 Project CDM //searchExpr=searchExpr+" AND [Accnt Id] <> '"+strAccountId+"'"; searchExpr=searchExpr+" AND [Accnt Id] <> '"+strAccountId+"' AND [End Date SCM] IS NULL"; } else { //TGDBEJA6 03.09.2010 Project CDM //searchExpr="[Accnt Id] <> '"+strAccountId+"' AND"; searchExpr="[Accnt Id] <> '"+strAccountId+"' AND [End Date SCM] IS NULL"; } BCAccContactInter.ClearToQuery(); BCAccContactInter.SetSearchExpr (searchExpr); BCAccContactInter.ExecuteQuery(ForwardOnly); if (BCAccContactInter.FirstRecord()) {//If a record is found that means the contact is related to other customer. Outputs.SetProperty("ContactCustomer", "TRUE");//This property set is used to display a custom browser script in the applet return false; } else { //TGDBEJA6 03.09.2010 Project CDM Remove Inactivation of Contact //BCAccContact.SetFieldValue("Status", TheApplication().InvokeMethod("LookupValue", "CONTACT_STATUS", "Inactive")); //BCAccContact.WriteRecord(); //This property set is used to display a custom browser script in the applet Outputs.SetProperty("ContactCustomer", "FALSE"); return true; } } else //In case the contact is not found. return false; } catch(e) { TheApplication().RaiseErrorText(e.toString()); } finally { searchExpr=null; strAccountId=null; strPrimContact = null; BCAccContact = null; BCAccContactInter = null; BOAccContact = null; } }

Account BS SCM
CreateHQ
/*** ** Name: CreateHQ ** Created: 27.07.2010, Created By: TGDTOGE3 ** Description: New method to create automatically the HQ SA when the company CMA is created ***/ function CreateHQ(Inputs,Outputs) { var BOAcc; //Main Vbles var BCAcc; var BCAdd; var strCMAId; var strPrimaryName; var strMainAddId; var strAddSA; var strSAId; var strName; //Account Vbles var strName1; var strName2; var strDetSegment; var strSubSegment; var strCorrLang; var strCorrLangCode; var strDesc; var strLettSal; var strTitle; var strItPlat; //Address Vbles var strMasterId; var strPostalCode; var strCity; var strAddType; var strAddId; var strAdd; var strAssStatus; var strLocSup; var strResDes; var strAddNum; var strAddSup; var strApNum; var strCOName; var strCountry; var strFloor; var strGeoflg; var strLangGaia; var strLocId; var strStreetId; var strValStatus; var strPostalExt; var strIntId; var strPhone; //Company Main Contact Vbles var strCellPhone; var strFax; var strEmailAddr; var strSpokLang; var strSpokLangCode; var strSupplierCode; // TAADAPE2 14.01.2015 - fix for defect #95906 - Populate SA Account with Supplier Code from CMA var BSCAM; var Input; var Output; var sAccStatus:chars; try { // defect # 70443 sAccStatus = ""; if (Inputs.PropertyExists("Account Status")) { sAccStatus = Inputs.GetProperty("Account Status"); } if (sAccStatus == "") { sAccStatus = oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Active"); } Input = TheApplication().NewPropertySet(); Output = TheApplication().NewPropertySet(); //Get Active BO and Account BC from the context BOAcc = oApp.GetBusObject("Account"); BCAcc = BOAcc.GetBusComp("Account"); BCAdd = BOAcc.GetBusComp("Account Address Usage SCM"); //get Id of the company CMA strCMAId = Inputs.GetProperty("CMAId"); //Search company CMA BCAcc.ActivateField("Primary Name Id SCM"); BCAcc.ActivateField("Primary Usage Address Id SCM"); BCAcc.ActivateField("Name"); BCAcc.ActivateField("Customer Name 1 SCM"); BCAcc.ActivateField("Customer Name 2 SCM"); BCAcc.ActivateField("DetailedSegment SCM"); BCAcc.ActivateField("Subfine Segment SCM"); BCAcc.ActivateField("Correspondence Language SCM"); BCAcc.ActivateField("Correspondence Language Code SCM"); BCAcc.ActivateField("Language"); BCAcc.ActivateField("Language Code"); BCAcc.ActivateField("Comment SCM"); //SCM 29.09.2010 Project CDM: Data Model Change, following fields do not exist any more in BC Account //BCAcc.ActivateField("Touch Point SCM"); //BCAcc.ActivateField("Main VoIP Identification SCM"); //BCAcc.ActivateField("Preferred Communication Method"); //BCAcc.ActivateField("Suppress Proku Flag SCM"); //END CDM BCAcc.ActivateField("Letter Salutation SCM"); BCAcc.ActivateField("Title SCM"); BCAcc.ActivateField("IT PlatForm SCM"); BCAcc.ActivateField("Master Account Id"); //TGDBEJA6 02.09.2010 Project CDM:Create default Contact in the HQ SA BCAcc.ActivateField("Account Company Main Contact Cell Phone # SCM"); BCAcc.ActivateField("Account Company Main Contact Email Address SCM"); BCAcc.ActivateField("Account Company Main Contact Fax SCM"); BCAcc.ActivateField("Account Company Main Contact Phone # SCM"); BCAcc.SetViewMode(AllView); BCAcc.ClearToQuery(); BCAcc.SetSearchSpec("Id",strCMAId); BCAcc.ExecuteQuery(ForwardOnly); //Get CMA data strPrimaryName = BCAcc.GetFieldValue("Primary Name Id SCM"); strMainAddId = BCAcc.GetFieldValue("Primary Usage Address Id SCM"); strName = BCAcc.GetFieldValue("Name"); strName1 = BCAcc.GetFieldValue("Customer Name 1 SCM"); strName2 = BCAcc.GetFieldValue("Customer Name 2 SCM"); strDetSegment = BCAcc.GetFieldValue("DetailedSegment SCM"); strSubSegment = BCAcc.GetFieldValue("Subfine Segment SCM"); strCorrLang = BCAcc.GetFieldValue("Correspondence Language SCM"); strCorrLangCode = BCAcc.GetFieldValue("Correspondence Language Code SCM"); strDesc = BCAcc.GetFieldValu

Account BS SCM
CreateHQ
/*** ** Name: CreateHQ ** Created: 27.07.2010, Created By: TGDTOGE3 ** Description: New method to create automatically the HQ SA when the company CMA is created -------------------- Modifications --------------------- ** Date Changed By Description ** 20161215 TAACONU1 Defect # 1144 ***/ function CreateHQ(Inputs,Outputs) { var BOAcc; //Main Vbles var BCAcc; var BCAdd; var strCMAId; var strPrimaryName; var strMainAddId; var strAddSA; var strSAId; var strName; //Account Vbles var strName1; var strName2; var strDetSegment; var strSubSegment; var strCorrLang; var strCorrLangCode; var strDesc; var strLettSal; var strTitle; var strItPlat; //Address Vbles var strMasterId; var strPostalCode; var strCity; var strAddType; var strAddId; var strAdd; var strAssStatus; var strLocSup; var strResDes; var strAddNum; var strAddSup; var strApNum; var strCOName; var strCountry; var strFloor; var strGeoflg; var strLangGaia; var strLocId; var strStreetId; var strValStatus; var strPostalExt; var strIntId; var strPhone; //Company Main Contact Vbles var strCellPhone; var strFax; var strEmailAddr; var strSpokLang; var strSpokLangCode; var strSupplierCode; // TAADAPE2 14.01.2015 - fix for defect #95906 - Populate SA Account with Supplier Code from CMA var BSCAM; var Input; var Output; var sAccStatus:chars; var loBCAccountPick:BusComp; try { // defect # 70443 sAccStatus = ""; if (Inputs.PropertyExists("Account Status")) { sAccStatus = Inputs.GetProperty("Account Status"); } if (sAccStatus == "") { sAccStatus = oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Active"); } Input = TheApplication().NewPropertySet(); Output = TheApplication().NewPropertySet(); //Get Active BO and Account BC from the context BOAcc = oApp.GetBusObject("Account"); BCAcc = BOAcc.GetBusComp("Account"); BCAdd = BOAcc.GetBusComp("Account Address Usage SCM"); //get Id of the company CMA strCMAId = Inputs.GetProperty("CMAId"); //Search company CMA BCAcc.ActivateField("Primary Name Id SCM"); BCAcc.ActivateField("Primary Usage Address Id SCM"); BCAcc.ActivateField("Name"); BCAcc.ActivateField("Customer Name 1 SCM"); BCAcc.ActivateField("Customer Name 2 SCM"); BCAcc.ActivateField("DetailedSegment SCM"); BCAcc.ActivateField("Subfine Segment SCM"); BCAcc.ActivateField("Correspondence Language SCM"); BCAcc.ActivateField("Correspondence Language Code SCM"); BCAcc.ActivateField("Language"); BCAcc.ActivateField("Language Code"); BCAcc.ActivateField("Comment SCM"); //SCM 29.09.2010 Project CDM: Data Model Change, following fields do not exist any more in BC Account //BCAcc.ActivateField("Touch Point SCM"); //BCAcc.ActivateField("Main VoIP Identification SCM"); //BCAcc.ActivateField("Preferred Communication Method"); //BCAcc.ActivateField("Suppress Proku Flag SCM"); //END CDM BCAcc.ActivateField("Letter Salutation SCM"); BCAcc.ActivateField("Title SCM"); BCAcc.ActivateField("IT PlatForm SCM"); BCAcc.ActivateField("Master Account Id"); //TGDBEJA6 02.09.2010 Project CDM:Create default Contact in the HQ SA BCAcc.ActivateField("Account Company Main Contact Cell Phone # SCM"); BCAcc.ActivateField("Account Company Main Contact Email Address SCM"); BCAcc.ActivateField("Account Company Main Contact Fax SCM"); BCAcc.ActivateField("Account Company Main Contact Phone # SCM"); BCAcc.SetViewMode(AllView); BCAcc.ClearToQuery(); BCAcc.SetSearchSpec("Id",strCMAId); BCAcc.ExecuteQuery(ForwardOnly); //Get CMA data strPrimaryName = BCAcc.GetFieldValue("Primary Name Id SCM"); strMainAddId = BCAcc.GetFieldValue("Primary Usage Address Id SCM"); strName = BCAcc.GetFieldValue("Name"); strName1 = BCAcc.GetFieldValue("Customer Name 1 SCM"); strName2 = BCAcc.GetFieldValue("Customer Name 2 SCM"); strDetSegment = BCAcc.GetFieldValue("DetailedSegment SCM"); strSubSegment = BCAcc.GetFieldValue("Subfine Segment SCM");

Account BS SCM
CreateSASR
function CreateSASR(Inputs,Outputs){ var BOSR:BusObject; var BCSR:BusComp; var BCAcc:BusComp; var strSAId:chars =""; var strOldCMAId:chars = ""; try{ if(bIsTraceOn)oApp.Trace(this.Name() + ".CreateSASR START"); //Get Active BO and Account BC from the context BOSR = TheApplication().GetBusObject("Account"); BCSR = BOSR.GetBusComp("Service Request"); strSAId = Inputs.GetProperty("SAId"); BCAcc = BOSR.GetBusComp("Account"); BCAcc.SetViewMode(AllView); BCAcc.ClearToQuery(); BCAcc.ActivateField("SA Name Id SCM"); BCAcc.SetSearchSpec("Id",strSAId); BCAcc.ExecuteQuery(ForwardOnly); strOldCMAId = BCAcc.GetFieldValue("Parent Account Id"); //Create a new SR BCSR.SetViewMode(AllView); BCSR.NewRecord(NewAfter); BCSR.SetFieldValue("Account Id", strSAId); BCSR.SetFieldValue("Area", "Customer Data"); BCSR.SetFieldValue("Sub-Area", "09.13 Maintain customer struct"); BCSR.SetFieldValue("Info Consult CD Not GUI SCM", "Manage enterprise structure"); BCSR.SetFieldValue("Secondary Account Id SCM",strOldCMAId); BCSR.SetFieldValue("SA Name Id Aux SCM", BCAcc.GetFieldValue("SA Name Id SCM")); BCSR.SetFieldValue("Previous Account Id SCM", strOldCMAId); //TGDLOAL3 OneCRM 2010-05-14:Moved before writerecord because after writing it lose the context. Outputs.SetProperty("SRId", BCSR.GetFieldValue("Id")); BCSR.WriteRecord(); } catch(e){ if(bIsTraceOn)oApp.Trace(this.Name() + ".CreateSASR Error: " + e.message); TheApplication().RaiseErrorText(e.toString()); } finally{ strOldCMAId = null; BCAcc = null; strSAId = null; BCSR = null; BOSR = null; } }

Account BS SCM
CreateSASR
function CreateSASR(Inputs,Outputs){ var BOSR:BusObject; var BCSR:BusComp; var BCAcc:BusComp; var strSAId:chars =""; var strOldCMAId:chars = ""; try{ if(bIsTraceOn)oApp.Trace(this.Name() + ".CreateSASR START"); //Get Active BO and Account BC from the context BOSR = TheApplication().GetBusObject("Account"); BCSR = BOSR.GetBusComp("Service Request"); strSAId = Inputs.GetProperty("SAId"); BCAcc = BOSR.GetBusComp("Account"); BCAcc.SetViewMode(AllView); BCAcc.ClearToQuery(); BCAcc.ActivateField("SA Name Id SCM"); BCAcc.SetSearchSpec("Id",strSAId); BCAcc.ExecuteQuery(ForwardOnly); strOldCMAId = BCAcc.GetFieldValue("Parent Account Id"); //Create a new SR BCSR.SetViewMode(AllView); BCSR.NewRecord(NewAfter); BCSR.SetFieldValue("Account Id", strSAId); BCSR.SetFieldValue("Area", "Customer Data"); BCSR.SetFieldValue("Sub-Area", "09.13 Maintain customer struct"); BCSR.SetFieldValue("Info Consult CD Not GUI SCM", "Manage enterprise structure"); BCSR.SetFieldValue("Secondary Account Id SCM",strOldCMAId); BCSR.SetFieldValue("SA Name Id Aux SCM", BCAcc.GetFieldValue("SA Name Id SCM")); BCSR.SetFieldValue("Previous Account Id SCM", strOldCMAId); //TGDLOAL3 OneCRM 2010-05-14:Moved before writerecord because after writing it lose the context. Outputs.SetProperty("SRId", BCSR.GetFieldValue("Id")); BCSR.WriteRecord(); } catch(e){ if(bIsTraceOn)oApp.Trace(this.Name() + ".CreateSASR Error: " + e.message); TheApplication().RaiseErrorText(e.toString()); } finally{ strOldCMAId = null; BCAcc = null; strSAId = null; BCSR = null; BOSR = null; } }

Account BS SCM
DeleteActiveSR
/******************************************************* ** Name: DuplicateAccountSearch ** Created: 21.08.2008 ** Created By: Gomez Ayerbe, F. Javier ** Description: Deletes the active SR associated to the active customer ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function DeleteActiveSR(Inputs, Outputs) { var BOActiveAccount; var BCActiveSR; var SRId; var BOSR; var BCSR; try { //Get Active BO, BCs from the context in order to get the SR created recently BOActiveAccount = TheApplication().ActiveBusObject(); BCActiveSR = BOActiveAccount.GetBusComp("Service Request"); SRId = BCActiveSR.GetFieldValue("Id"); //Since BC Service Request does not allow to delete records, deletion is done through another BC BOSR = TheApplication().GetBusObject("Service Request EAI SCM"); BCSR = BOSR.GetBusComp("Service Request EAI SCM"); BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id",SRId); BCSR.ExecuteQuery(ForwardOnly); //var numRec = BCSR.CountRecords(); //var strIDToDelete = BCSR.GetFieldValue("Id"); //var strtemp = BCSR.GetFieldValue("Account Id"); BCSR.DeleteRecord(); } catch(e){ throw(e); } finally{ BCSR = null; BOSR = null; SRId = null; BCActiveSR = null; BOActiveAccount = null; } }

Account BS SCM
DeleteActiveSR
/******************************************************* ** Name: DuplicateAccountSearch ** Created: 21.08.2008 ** Created By: Gomez Ayerbe, F. Javier ** Description: Deletes the active SR associated to the active customer ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function DeleteActiveSR(Inputs, Outputs) { var BOActiveAccount; var BCActiveSR; var SRId; var BOSR; var BCSR; try { //Get Active BO, BCs from the context in order to get the SR created recently BOActiveAccount = TheApplication().ActiveBusObject(); BCActiveSR = BOActiveAccount.GetBusComp("Service Request"); SRId = BCActiveSR.GetFieldValue("Id"); //Since BC Service Request does not allow to delete records, deletion is done through another BC BOSR = TheApplication().GetBusObject("Service Request EAI SCM"); BCSR = BOSR.GetBusComp("Service Request EAI SCM"); BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id",SRId); BCSR.ExecuteQuery(ForwardOnly); //var numRec = BCSR.CountRecords(); //var strIDToDelete = BCSR.GetFieldValue("Id"); //var strtemp = BCSR.GetFieldValue("Account Id"); BCSR.DeleteRecord(); } catch(e){ throw(e); } finally{ BCSR = null; BOSR = null; SRId = null; BCActiveSR = null; BOActiveAccount = null; } }

Account BS SCM
DeleteBillingProfileStructure
/******************************************************* ** Name: Karin Haack ** Created: 01.09.2010 ** Description: Delete all Customer Care Support Structure on BP -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function DeleteBillingProfileStructure(Inputs) { var BOAccount; var BCBillingProfile; var BPId; var BCBPContacts; var BCUserAuth; try { BPId = Inputs.GetProperty ("BPId"); /* set Partner Group on BP to Null*/ BOAccount = TheApplication().GetBusObject("Account"); BCBillingProfile = BOAccount.GetBusComp("Com Invoice Profile Lite SCM"); BCBillingProfile.ActivateField("Partner Group Id"); BCBillingProfile.SetViewMode(AllView); BCBillingProfile.ClearToQuery(); BCBillingProfile.SetSearchSpec("Id", BPId); BCBillingProfile.ExecuteQuery(ForwardBackward); if (BCBillingProfile.FirstRecord()) { BCBillingProfile.SetFieldValue("Partner Group Id",""); BCBillingProfile.WriteRecord(); } /* delete all contacts and employee assigned to the BP*/ BCBPContacts = BOAccount.GetBusComp("Contact Invoice Profile Intersection SCM"); BCBPContacts.SetViewMode(AllView); BCBPContacts.ClearToQuery(); BCBPContacts.SetSearchSpec("Billing Profile Id", BPId); BCBPContacts.ExecuteQuery(ForwardBackward); while (BCBPContacts.FirstRecord()) { BCBPContacts.DeleteRecord(); } /* delete all user authorizations assigned to the BP*/ BCUserAuth = BOAccount.GetBusComp("Authorization Billing Profile Intersection SCM"); BCUserAuth.SetViewMode(AllView); BCUserAuth.ClearToQuery(); BCUserAuth.SetSearchSpec("Billing Profile Id", BPId); BCUserAuth.ExecuteQuery(ForwardBackward); while (BCUserAuth.FirstRecord()) { BCUserAuth.DeleteRecord(); } } catch(e) { TheApplication().RaiseErrorText(e.toString()); } finally { BPId = null; BCBillingProfile = null; BCBPContacts = null; BCUserAuth = null; BOAccount = null; } }

Account BS SCM
DeleteBillingProfileStructure
/******************************************************* ** Name: Karin Haack ** Created: 01.09.2010 ** Description: Delete all Customer Care Support Structure on BP -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function DeleteBillingProfileStructure(Inputs) { var BOAccount; var BCBillingProfile; var BPId; var BCBPContacts; var BCUserAuth; try { BPId = Inputs.GetProperty ("BPId"); /* set Partner Group on BP to Null*/ BOAccount = TheApplication().GetBusObject("Account"); BCBillingProfile = BOAccount.GetBusComp("Com Invoice Profile Lite SCM"); BCBillingProfile.ActivateField("Partner Group Id"); BCBillingProfile.SetViewMode(AllView); BCBillingProfile.ClearToQuery(); BCBillingProfile.SetSearchSpec("Id", BPId); BCBillingProfile.ExecuteQuery(ForwardBackward); if (BCBillingProfile.FirstRecord()) { BCBillingProfile.SetFieldValue("Partner Group Id",""); BCBillingProfile.WriteRecord(); } /* delete all contacts and employee assigned to the BP*/ BCBPContacts = BOAccount.GetBusComp("Contact Invoice Profile Intersection SCM"); BCBPContacts.SetViewMode(AllView); BCBPContacts.ClearToQuery(); BCBPContacts.SetSearchSpec("Billing Profile Id", BPId); BCBPContacts.ExecuteQuery(ForwardBackward); while (BCBPContacts.FirstRecord()) { BCBPContacts.DeleteRecord(); } /* delete all user authorizations assigned to the BP*/ BCUserAuth = BOAccount.GetBusComp("Authorization Billing Profile Intersection SCM"); BCUserAuth.SetViewMode(AllView); BCUserAuth.ClearToQuery(); BCUserAuth.SetSearchSpec("Billing Profile Id", BPId); BCUserAuth.ExecuteQuery(ForwardBackward); while (BCUserAuth.FirstRecord()) { BCUserAuth.DeleteRecord(); } } catch(e) { TheApplication().RaiseErrorText(e.toString()); } finally { BPId = null; BCBillingProfile = null; BCBPContacts = null; BCUserAuth = null; BOAccount = null; } }

Account BS SCM
DuplicateAccountSearch
/***************************************************** ** Name: DuplicateAccountSearch ** Created: 28.07.2008 ** Created By: Gomez Ayerbe, F. Javier ** Description: Look for duplicate accounts -------------------- Modifications --------------------- ** Version: <New Version> ** Date: 09.10.2009 ** Changed By: Javier Amor ** Description: Issue 14309. Now duplicate search must only look for New,Customer or Prospect customers ** Scripting was too long for only one file and the process has been split into two differents ** files, one for Companies and another for persons. ******************************************************/ function DuplicateAccountSearch (Inputs, Outputs){ var strCustomerType; //Stores Person, CMA or SA trc(""); try { strCustomerType = Inputs.GetProperty("strCustomerType"); if(strCustomerType == "Person"){ //this.InvokeMethod("DuplicateAccountSearchPerson",Inputs,Outputs); DuplicateAccountSearchPerson(Inputs,Outputs); } else //this.InvokeMethod("DuplicateAccountSearchCompany",Inputs,Outputs); DuplicateAccountSearchCompany(Inputs,Outputs); } catch(e){ trc(e.toString()); TheApplication().RaiseErrorText(e.toString()); } finally{ strCustomerType = null; } }

Account BS SCM
DuplicateAccountSearch
/***************************************************** ** Name: DuplicateAccountSearch ** Created: 28.07.2008 ** Created By: Gomez Ayerbe, F. Javier ** Description: Look for duplicate accounts -------------------- Modifications --------------------- ** Version: <New Version> ** Date: 09.10.2009 ** Changed By: Javier Amor ** Description: Issue 14309. Now duplicate search must only look for New,Customer or Prospect customers ** Scripting was too long for only one file and the process has been split into two differents ** files, one for Companies and another for persons. ******************************************************/ function DuplicateAccountSearch (Inputs, Outputs){ var strCustomerType; //Stores Person, CMA or SA trc(""); try { strCustomerType = Inputs.GetProperty("strCustomerType"); if(strCustomerType == "Person"){ //this.InvokeMethod("DuplicateAccountSearchPerson",Inputs,Outputs); DuplicateAccountSearchPerson(Inputs,Outputs); } else //this.InvokeMethod("DuplicateAccountSearchCompany",Inputs,Outputs); DuplicateAccountSearchCompany(Inputs,Outputs); } catch(e){ trc(e.toString()); TheApplication().RaiseErrorText(e.toString()); } finally{ strCustomerType = null; } }

Account BS SCM
DuplicateAccountSearchCompany
/***************************************************************************** * Function: DuplicateAccountSearchCompany * Purpose : Issue 14309. Now duplicate search must only look for New,Customer * or Prospect customers. * And only New and Acive customers for SAs. * Scripting was too long for only one file and the process has been * split into two differents files, one for Companies and another * for persons. A new searchspec has been added in every query * This script is only for Companies. * Params : Inputs * Outputs *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ------------------------------------------------- * 2009-10-09 Javier Amor created *****************************************************************************/ function DuplicateAccountSearchCompany (Inputs, Outputs){ var BOAccount; var BCAccount; var strName; //CMA Company Name var strCommercialReg; var strGeoId; var strGeoNum; var strParentAccId; var strCustomerType; //Stores Person, CMA or SA var strZipCode; var strStreet; var strParCompIndexNum; var row; var doNextQuery = false; var strSearchSpec; //SCM 2009.10.09 TGDAMJA1.Issue 14309. var strSearchSpecSA; var strSearchSpec2; var strSearchSpecSA2; var BOAdd; var BCAdd; trc(""); try { BOAccount = oApp.GetBusObject("Account"); BCAccount = BOAccount.GetBusComp("Account Lite SCM"); BCAccount.ActivateField("Phonetic Search Name SCM"); BCAccount.ActivateField("Commercial Registry Number SCM"); BCAccount.ActivateField("Primary Account Postal Code SCM"); BCAccount.ActivateField("Primary Account City SCM"); BCAccount.ActivateField("Residence Description SCM"); BCAccount.ActivateField("Location Supplement SCM"); BCAccount.ActivateField("Grobsegment SCM"); BCAccount.ActivateField("Account Status"); BCAccount.ActivateField("Account Nr."); BCAccount.ActivateField("Calculated Duplicate Name SCM"); BCAccount.ActivateField("Sub Type SCM"); BCAccount.ActivateField("Location Id denormalized SCM"); BCAccount.ActivateField("Parent Grobsegment SCM"); //Issue 10827 BCAccount.ActivateField("Prepayment Flag SCM"); BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); strName = Inputs.GetProperty("strName"); strCommercialReg = Inputs.GetProperty("strCommercialReg"); strGeoId = Inputs.GetProperty("strGeoId"); strGeoNum = Inputs.GetProperty("strGeoNum"); strParentAccId = Inputs.GetProperty("strParentAccId"); strCustomerType = Inputs.GetProperty("strCustomerType"); strZipCode = Inputs.GetProperty("strZipCode"); strStreet = Inputs.GetProperty("strStreet"); strParCompIndexNum = Inputs.GetProperty("strParCompIndexNum"); BOAdd = oApp.GetBusObject("Account"); BCAdd = BOAdd.GetBusComp("Account Address Ligth SCM"); //SCM 2009.10.09 TGDAMJA1.Issue 14309. Create the new search spec for CMAs and SAs.By doing this //here instead of in the setsearchspec command, lookupvalue is invoked only once instead of every time a query is done. strSearchSpec = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Customer")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; strSearchSpecSA = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Active")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; strSearchSpec2 = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Customer")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; strSearchSpecSA2 = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Active")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_ST

Account BS SCM
DuplicateAccountSearchCompany
/***************************************************************************** * Function: DuplicateAccountSearchCompany * Purpose : Issue 14309. Now duplicate search must only look for New,Customer * or Prospect customers. * And only New and Acive customers for SAs. * Scripting was too long for only one file and the process has been * split into two differents files, one for Companies and another * for persons. A new searchspec has been added in every query * This script is only for Companies. * Params : Inputs * Outputs *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ------------------------------------------------- * 2009-10-09 Javier Amor created *****************************************************************************/ function DuplicateAccountSearchCompany (Inputs, Outputs){ var BOAccount; var BCAccount; var strName; //CMA Company Name var strCommercialReg; var strGeoId; var strGeoNum; var strParentAccId; var strCustomerType; //Stores Person, CMA or SA var strZipCode; var strStreet; var strParCompIndexNum; var row; var doNextQuery = false; var strSearchSpec; //SCM 2009.10.09 TGDAMJA1.Issue 14309. var strSearchSpecSA; var strSearchSpec2; var strSearchSpecSA2; var BOAdd; var BCAdd; trc(""); try { BOAccount = oApp.GetBusObject("Account"); BCAccount = BOAccount.GetBusComp("Account Lite SCM"); BCAccount.ActivateField("Phonetic Search Name SCM"); BCAccount.ActivateField("Commercial Registry Number SCM"); BCAccount.ActivateField("Primary Account Postal Code SCM"); BCAccount.ActivateField("Primary Account City SCM"); BCAccount.ActivateField("Residence Description SCM"); BCAccount.ActivateField("Location Supplement SCM"); BCAccount.ActivateField("Grobsegment SCM"); BCAccount.ActivateField("Account Status"); BCAccount.ActivateField("Account Nr."); BCAccount.ActivateField("Calculated Duplicate Name SCM"); BCAccount.ActivateField("Sub Type SCM"); BCAccount.ActivateField("Location Id denormalized SCM"); BCAccount.ActivateField("Parent Grobsegment SCM"); //Issue 10827 BCAccount.ActivateField("Prepayment Flag SCM"); BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); strName = Inputs.GetProperty("strName"); strCommercialReg = Inputs.GetProperty("strCommercialReg"); strGeoId = Inputs.GetProperty("strGeoId"); strGeoNum = Inputs.GetProperty("strGeoNum"); strParentAccId = Inputs.GetProperty("strParentAccId"); strCustomerType = Inputs.GetProperty("strCustomerType"); strZipCode = Inputs.GetProperty("strZipCode"); strStreet = Inputs.GetProperty("strStreet"); strParCompIndexNum = Inputs.GetProperty("strParCompIndexNum"); BOAdd = oApp.GetBusObject("Account"); BCAdd = BOAdd.GetBusComp("Account Address Ligth SCM"); //SCM 2009.10.09 TGDAMJA1.Issue 14309. Create the new search spec for CMAs and SAs.By doing this //here instead of in the setsearchspec command, lookupvalue is invoked only once instead of every time a query is done. strSearchSpec = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Customer")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; strSearchSpecSA = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Active")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; strSearchSpec2 = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Customer")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; strSearchSpecSA2 = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Active")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_ST

Account BS SCM
DuplicateAccountSearchPerson
/** ** Name: 09.10.2009 ** Created By: Javier Amor ** Description: Issue 14309. Now duplicate search must only look for New,Customer or Prospect ** Scripting was too long and the process has been split into two differents one for Companies other for persons ** This script is only for Persons. - Modifications - ** Changed By: Gema Torres (30.10.2009) ** Description: Due to Performance issue, the number of queries in algorithm has been reduced and BC 'Account Address Ligth SCM' used to perform queries on 'Location Id' or 'ZipCode' **/ function DuplicateAccountSearchPerson (Inputs, Outputs){ var BOAccount; var BCAccount; var strBirthDate; var strGeoId; var strGeoNum; var strParentAccId; var strFirstName; var strLastName; var strZipCode; var strStreet; var row; var doNextQuery = false; var strSearchSpec;//SCM 2009.10.09 TGDAMJA1.Issue 14309 var strSearchSpec2; var srLevelOfQuality = "2"; var BOAdd; var BCAdd; trc(""); try { BOAccount = oApp.GetBusObject("Account"); BCAccount = BOAccount.GetBusComp("Account Lite SCM"); BCAccount.ActivateField("Phonetic Search Name SCM"); BCAccount.ActivateField("Account Contact Birth Date"); BCAccount.ActivateField("Primary Account Postal Code SCM"); BCAccount.ActivateField("Primary Account City SCM"); BCAccount.ActivateField("Residence Description SCM"); BCAccount.ActivateField("Location Supplement SCM"); BCAccount.ActivateField("Grobsegment SCM"); BCAccount.ActivateField("Account Status"); BCAccount.ActivateField("Calculated Duplicate Name SCM"); BCAccount.ActivateField("Sub Type SCM"); BCAccount.ActivateField("Location Id denormalized SCM"); BCAccount.ActivateField("Account Nr."); BCAccount.ActivateField("Prepayment Flag SCM");//TGDGAAND 24.11.2009 Issue 17352, Avoid Prepaid Customer BCAccount.ActivateField("Account Contact Id # SCM"); //CR412 TGDTOGE3 26.07.2010 BCAccount.ActivateField("Account Contact Id Typ SCM"); //CR412 TGDTOGE3 26.07.2010 BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); strBirthDate = Inputs.GetProperty("strBirthDate"); strGeoId = Inputs.GetProperty("strGeoId"); strGeoNum = Inputs.GetProperty("strGeoNum"); strParentAccId = Inputs.GetProperty("strParentAccId"); strFirstName = Inputs.GetProperty("strFirstName"); strLastName = Inputs.GetProperty("strLastName"); strZipCode = Inputs.GetProperty("strZipCode"); strStreet = Inputs.GetProperty("strStreet"); BOAdd = oApp.GetBusObject("Account"); BCAdd = BOAdd.GetBusComp("Account Address Ligth SCM"); //SCM 2009.10.09 TGDAMJA1.Issue 14309. Create the new search spec for Persons.By doing this //here instead of in the setsearchspec command, lookupvalue is invoked only once instead of every time a query is done. strSearchSpec = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Customer")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; strSearchSpec2 = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Customer")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; srLevelOfQuality = oApp.utils.SCM_RetrieveACV("LevelOfDuplicateQuality"); //When a query finds matches then the rest of the queries do not take place. if (strGeoId == "Y"){ if (strBirthDate != "01/01/1900"){//Step1 BCAccount.SetSearchSpec("Id", " <> '" + strParentAccId + "'"); BCAccount.SetSearchSpec("Phonetic Search Name SCM", strLastName+"*"+strFirstName+"*"); //Issue 15409, TGDTOGE3 26.10.2009 change field 'Account Contact Birth Date SCM' which is multivaluated field to 'Account Contact Birth Date' joined BCAccount.SetSearchSpec("Account Contact Birth Date", strBirthDate); BCAccount.

Account BS SCM
DuplicateAccountSearchPerson
/** ** Name: 09.10.2009 ** Created By: Javier Amor ** Description: Issue 14309. Now duplicate search must only look for New,Customer or Prospect ** Scripting was too long and the process has been split into two differents one for Companies other for persons ** This script is only for Persons. - Modifications - ** Changed By: Gema Torres (30.10.2009) ** Description: Due to Performance issue, the number of queries in algorithm has been reduced and BC 'Account Address Ligth SCM' used to perform queries on 'Location Id' or 'ZipCode' **/ function DuplicateAccountSearchPerson (Inputs, Outputs){ var BOAccount; var BCAccount; var strBirthDate; var strGeoId; var strGeoNum; var strParentAccId; var strFirstName; var strLastName; var strZipCode; var strStreet; var row; var doNextQuery = false; var strSearchSpec;//SCM 2009.10.09 TGDAMJA1.Issue 14309 var strSearchSpec2; var srLevelOfQuality = "2"; var BOAdd; var BCAdd; trc(""); try { BOAccount = oApp.GetBusObject("Account"); BCAccount = BOAccount.GetBusComp("Account Lite SCM"); BCAccount.ActivateField("Phonetic Search Name SCM"); BCAccount.ActivateField("Account Contact Birth Date"); BCAccount.ActivateField("Primary Account Postal Code SCM"); BCAccount.ActivateField("Primary Account City SCM"); BCAccount.ActivateField("Residence Description SCM"); BCAccount.ActivateField("Location Supplement SCM"); BCAccount.ActivateField("Grobsegment SCM"); BCAccount.ActivateField("Account Status"); BCAccount.ActivateField("Calculated Duplicate Name SCM"); BCAccount.ActivateField("Sub Type SCM"); BCAccount.ActivateField("Location Id denormalized SCM"); BCAccount.ActivateField("Account Nr."); BCAccount.ActivateField("Prepayment Flag SCM");//TGDGAAND 24.11.2009 Issue 17352, Avoid Prepaid Customer BCAccount.ActivateField("Account Contact Id # SCM"); //CR412 TGDTOGE3 26.07.2010 BCAccount.ActivateField("Account Contact Id Typ SCM"); //CR412 TGDTOGE3 26.07.2010 BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); strBirthDate = Inputs.GetProperty("strBirthDate"); strGeoId = Inputs.GetProperty("strGeoId"); strGeoNum = Inputs.GetProperty("strGeoNum"); strParentAccId = Inputs.GetProperty("strParentAccId"); strFirstName = Inputs.GetProperty("strFirstName"); strLastName = Inputs.GetProperty("strLastName"); strZipCode = Inputs.GetProperty("strZipCode"); strStreet = Inputs.GetProperty("strStreet"); BOAdd = oApp.GetBusObject("Account"); BCAdd = BOAdd.GetBusComp("Account Address Ligth SCM"); //SCM 2009.10.09 TGDAMJA1.Issue 14309. Create the new search spec for Persons.By doing this //here instead of in the setsearchspec command, lookupvalue is invoked only once instead of every time a query is done. strSearchSpec = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Customer")+"' OR [Account Status]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; strSearchSpec2 = "'"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Prospect")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","Customer")+"' OR [Account Status SCM]='"+oApp.InvokeMethod("LookupValue","ACCOUNT_STATUS","New")+"'"; srLevelOfQuality = oApp.utils.SCM_RetrieveACV("LevelOfDuplicateQuality"); //When a query finds matches then the rest of the queries do not take place. if (strGeoId == "Y"){ if (strBirthDate != "01/01/1900"){//Step1 BCAccount.SetSearchSpec("Id", " <> '" + strParentAccId + "'"); BCAccount.SetSearchSpec("Phonetic Search Name SCM", strLastName+"*"+strFirstName+"*"); //Issue 15409, TGDTOGE3 26.10.2009 change field 'Account Contact Birth Date SCM' which is multivaluated field to 'Account Contact Birth Date' joined BCAccount.SetSearchSpec("Account Contact Birth Date", strBirthDate); BCAccount.

Account BS SCM
DuplicateCustomerCheck
function DuplicateCustomerCheck(Inputs, Outputs) { var oBOSource : BusObject; var oBCSource : BusComp; var oBOSearch : BusObject; var oBCSearch : BusComp; // var bsPhonetic : Service; // 2012-06-28; tgdstre0, defect # 55061 - obsolete // var psIn : PropertySet; // var psOut : PropertySet; var asQuery : Array; var iQueryMax : Number; var iQuery : Number; var iNotGeo : Number; // 2012-06-28; tgdstre0, defect # 55061 var bNotGeo : bool; // ... var bNotFound : bool; var sSearchId : chars; var sAccountId : chars; var sNameLast : chars; var sNameFirst : chars; var sStreet : chars; var sHouseNo : chars; var sZipCode : chars; var sCity : chars; var sBirthday : chars; var sReturnCode : chars; var sReturnText : chars; var sId : chars; var sNotGeo : chars; // ... var sQueryBase : chars; // 2012-09-24; tgdstre0; defect # 57792 try { oBCSource = null; sReturnCode = "N/A"; sReturnText = "undefined"; sSearchId = ""; sAccountId = ""; bNotFound = true; bNotGeo = false; iNotGeo = 5; sNotGeo = ""; // 2012-06-28; tgdstre0, defect # 55061 if (Inputs.PropertyExists("NotGeo")) { sNotGeo = Inputs.GetProperty("NotGeo"); if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: Property 'NotGeo' = '" + sNotGeo + "'"); if (sNotGeo == "Y") { bNotGeo = true; } } if (Inputs.PropertyExists("Quote Id")) { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: Property 'Quote Id' found"); sSearchId = Inputs.GetProperty("Quote Id"); oBOSource = oApp.GetBusObject("Quote Lite SCM"); oBCSource = oBOSource.GetBusComp("Quote Lite SCM"); } else if (Inputs.PropertyExists("SR Id")) { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: Property 'SR Id' found"); sSearchId = Inputs.GetProperty("SR Id"); oBOSource = oApp.GetBusObject("Service Request Query Light SCM"); oBCSource = oBOSource.GetBusComp("Service Request Query Light SCM"); } if (sSearchId == "") { sReturnCode = "NOK"; sReturnText = "Missing Input Quote/SR Id"; } else { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: sSearchId = '" + sSearchId + "'"); sReturnCode = "NOK"; sReturnText = "Account not found"; oBCSource.SetViewMode(AllView); oBCSource.ClearToQuery(); oBCSource.SetSearchSpec("Id", sSearchId); oBCSource.ExecuteQuery(ForwardOnly); if (oBCSource.FirstRecord()) { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: found record"); sAccountId = oBCSource.GetFieldValue("Account Id"); } if (sAccountId.length > 0) { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: sAccountId = '" + sAccountId + "'"); sReturnCode = "NOK"; sReturnText = "SourceAddress not found"; oBOSearch = oApp.GetBusObject("EAI Search Customer SCM"); oBCSearch = oBOSearch.GetBusComp("EAI Search Customer SCM"); oBCSearch.ActivateField("Contact Last Name"); oBCSearch.ActivateField("Contact First Name"); oBCSearch.ActivateField("Address Street"); oBCSearch.ActivateField("Address House Num"); oBCSearch.ActivateField("Address City"); oBCSearch.ActivateField("Address Zip Code"); oBCSearch.ActivateField("Contact Birth Date"); oBCSearch.SetViewMode(AllView); oBCSearch.ClearToQuery(); oBCSearch.SetSearchSpec("Customer Id", sAccountId); oBCSearch.ExecuteQuery(ForwardOnly); if (oBCSearch.FirstRecord()) { if (bIsTraceOn) oApp.Trace("Dupli

Account BS SCM
DuplicateCustomerCheck
function DuplicateCustomerCheck(Inputs, Outputs) { var oBOSource : BusObject; var oBCSource : BusComp; var oBOSearch : BusObject; var oBCSearch : BusComp; // var bsPhonetic : Service; // 2012-06-28; tgdstre0, defect # 55061 - obsolete // var psIn : PropertySet; // var psOut : PropertySet; var asQuery : Array; var iQueryMax : Number; var iQuery : Number; var iNotGeo : Number; // 2012-06-28; tgdstre0, defect # 55061 var bNotGeo : bool; // ... var bNotFound : bool; var sSearchId : chars; var sAccountId : chars; var sNameLast : chars; var sNameFirst : chars; var sStreet : chars; var sHouseNo : chars; var sZipCode : chars; var sCity : chars; var sBirthday : chars; var sReturnCode : chars; var sReturnText : chars; var sId : chars; var sNotGeo : chars; // ... var sQueryBase : chars; // 2012-09-24; tgdstre0; defect # 57792 try { oBCSource = null; sReturnCode = "N/A"; sReturnText = "undefined"; sSearchId = ""; sAccountId = ""; bNotFound = true; bNotGeo = false; iNotGeo = 5; sNotGeo = ""; // 2012-06-28; tgdstre0, defect # 55061 if (Inputs.PropertyExists("NotGeo")) { sNotGeo = Inputs.GetProperty("NotGeo"); if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: Property 'NotGeo' = '" + sNotGeo + "'"); if (sNotGeo == "Y") { bNotGeo = true; } } if (Inputs.PropertyExists("Quote Id")) { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: Property 'Quote Id' found"); sSearchId = Inputs.GetProperty("Quote Id"); oBOSource = oApp.GetBusObject("Quote Lite SCM"); oBCSource = oBOSource.GetBusComp("Quote Lite SCM"); } else if (Inputs.PropertyExists("SR Id")) { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: Property 'SR Id' found"); sSearchId = Inputs.GetProperty("SR Id"); oBOSource = oApp.GetBusObject("Service Request Query Light SCM"); oBCSource = oBOSource.GetBusComp("Service Request Query Light SCM"); } if (sSearchId == "") { sReturnCode = "NOK"; sReturnText = "Missing Input Quote/SR Id"; } else { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: sSearchId = '" + sSearchId + "'"); sReturnCode = "NOK"; sReturnText = "Account not found"; oBCSource.SetViewMode(AllView); oBCSource.ClearToQuery(); oBCSource.SetSearchSpec("Id", sSearchId); oBCSource.ExecuteQuery(ForwardOnly); if (oBCSource.FirstRecord()) { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: found record"); sAccountId = oBCSource.GetFieldValue("Account Id"); } if (sAccountId.length > 0) { if (bIsTraceOn) oApp.Trace("DuplicateCustomerCheck: sAccountId = '" + sAccountId + "'"); sReturnCode = "NOK"; sReturnText = "SourceAddress not found"; oBOSearch = oApp.GetBusObject("EAI Search Customer SCM"); oBCSearch = oBOSearch.GetBusComp("EAI Search Customer SCM"); oBCSearch.ActivateField("Contact Last Name"); oBCSearch.ActivateField("Contact First Name"); oBCSearch.ActivateField("Address Street"); oBCSearch.ActivateField("Address House Num"); oBCSearch.ActivateField("Address City"); oBCSearch.ActivateField("Address Zip Code"); oBCSearch.ActivateField("Contact Birth Date"); oBCSearch.SetViewMode(AllView); oBCSearch.ClearToQuery(); oBCSearch.SetSearchSpec("Customer Id", sAccountId); oBCSearch.ExecuteQuery(ForwardOnly); if (oBCSearch.FirstRecord()) { if (bIsTraceOn) oApp.Trace("Dupli

Account BS SCM
GetAccountId
/******************************************************* ** Name: Get_Account_ID ** Created: 11.08.2008 ** Created By: Rosalyn Ramírez ** Description: Returns Account Id from SR Id. ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function GetAccountId(Inputs, Outputs) { var BOSR; var BCSR; var strSRNumber; try { strSRNumber = Inputs.GetProperty("SRId"); //Get the SR Id. BOSR = TheApplication().GetBusObject("Account"); BCSR = BOSR.GetBusComp("Service Request"); BCSR.ClearToQuery(); BCSR.ActivateField("Asset Owner Account Id SCM"); BCSR.SetSearchSpec("SR Id",strSRNumber); BCSR.ExecuteQuery(ForwardOnly); if(BCSR.FirstRecord()) { Outputs.SetProperty("AccountId", BCSR.GetFieldValue("Account Id")); Outputs.SetProperty("AssetId", BCSR.GetFieldValue("Asset Id")); Outputs.SetProperty("OwnerAsset", BCSR.GetFieldValue("Asset Owner Account Id SCM")); } else { TheApplication().RaiseErrorText("Error: No string set as Output Parameter"); } } catch(e) { } finally { BCSR = null; BOSR = null; } }

Account BS SCM
GetAccountId
/******************************************************* ** Name: Get_Account_ID ** Created: 11.08.2008 ** Created By: Rosalyn Ramírez ** Description: Returns Account Id from SR Id. ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function GetAccountId(Inputs, Outputs) { var BOSR; var BCSR; var strSRNumber; try { strSRNumber = Inputs.GetProperty("SRId"); //Get the SR Id. BOSR = TheApplication().GetBusObject("Account"); BCSR = BOSR.GetBusComp("Service Request"); BCSR.ClearToQuery(); BCSR.ActivateField("Asset Owner Account Id SCM"); BCSR.SetSearchSpec("SR Id",strSRNumber); BCSR.ExecuteQuery(ForwardOnly); if(BCSR.FirstRecord()) { Outputs.SetProperty("AccountId", BCSR.GetFieldValue("Account Id")); Outputs.SetProperty("AssetId", BCSR.GetFieldValue("Asset Id")); Outputs.SetProperty("OwnerAsset", BCSR.GetFieldValue("Asset Owner Account Id SCM")); } else { TheApplication().RaiseErrorText("Error: No string set as Output Parameter"); } } catch(e) { } finally { BCSR = null; BOSR = null; } }

Account BS SCM
GetAddressId
/******************************************************* ** Name: Get_Adress_ID ** Created: 19.08.2008 ** Created By: Rosalyn Ramírez ** Description: Returns Address Id and Normalized Fields. ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function GetAddressId(Inputs, Outputs) { var strAccountId; var BOAccount; var BCAccntAddr; try { strAccountId = Inputs.GetProperty("AccountId"); BOAccount = TheApplication().GetBusObject("Account"); BCAccntAddr = BOAccount.GetBusComp("Account Address Usage SCM"); BCAccntAddr.ClearToQuery(); BCAccntAddr.ActivateField("Address Id SCM"); BCAccntAddr.ActivateField("Address Geovalidated Flag denormalized SCM"); BCAccntAddr.ActivateField("City denormalized SCM"); BCAccntAddr.ActivateField("Country denormalized SCM"); BCAccntAddr.ActivateField("Language Code GAIA denormalized SCM"); BCAccntAddr.ActivateField("Location Id denormalized SCM"); BCAccntAddr.ActivateField("Location Supplement denormalized SCM"); BCAccntAddr.ActivateField("PO Box denormalized SCM"); BCAccntAddr.ActivateField("Postal Code Extension denormalized SCM"); BCAccntAddr.ActivateField("Postal Code denormalized SCM"); BCAccntAddr.ActivateField("Residence Description denormalized SCM"); BCAccntAddr.ActivateField("Street Address denormalized SCM"); BCAccntAddr.ActivateField("Street Nr. denormalized SCM"); BCAccntAddr.ActivateField("Validation Status denormalized SCM"); BCAccntAddr.SetSearchSpec("Account Id SCM", strAccountId); BCAccntAddr.ExecuteQuery(ForwardOnly); Outputs.SetProperty("AddressId", BCAccntAddr.GetFieldValue("Address Id SCM")); Outputs.SetProperty("AddressGeo", BCAccntAddr.GetFieldValue("Address Geovalidated Flag denormalized SCM")); Outputs.SetProperty("City", BCAccntAddr.GetFieldValue("City denormalized SCM")); Outputs.SetProperty("Country", BCAccntAddr.GetFieldValue("Country denormalized SCM")); Outputs.SetProperty("LanguageCode", BCAccntAddr.GetFieldValue("Language Code GAIA denormalized SCM")); Outputs.SetProperty("LocationId", BCAccntAddr.GetFieldValue("Location Id denormalized SCM")); Outputs.SetProperty("LocationSu", BCAccntAddr.GetFieldValue("Location Supplement denormalized SCM")); Outputs.SetProperty("POBox", BCAccntAddr.GetFieldValue("PO Box denormalized SCM")); Outputs.SetProperty("PCodeExt", BCAccntAddr.GetFieldValue("Postal Code Extension denormalized SCM")); Outputs.SetProperty("PCode", BCAccntAddr.GetFieldValue("Postal Code denormalized SCM")); Outputs.SetProperty("Residence", BCAccntAddr.GetFieldValue("Residence Description denormalized SCM")); Outputs.SetProperty("Street", BCAccntAddr.GetFieldValue("Street Address denormalized SCM")); Outputs.SetProperty("StreetNr", BCAccntAddr.GetFieldValue("Street Nr. denormalized SCM")); Outputs.SetProperty("ValidationStatus", BCAccntAddr.GetFieldValue("Validation Status denormalized SCM")); } catch(e) { } finally { BCAccntAddr = null; BOAccount = null; } }

Account BS SCM
GetAddressId
/******************************************************* ** Name: Get_Adress_ID ** Created: 19.08.2008 ** Created By: Rosalyn Ramírez ** Description: Returns Address Id and Normalized Fields. ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function GetAddressId(Inputs, Outputs) { var strAccountId; var BOAccount; var BCAccntAddr; try { strAccountId = Inputs.GetProperty("AccountId"); BOAccount = TheApplication().GetBusObject("Account"); BCAccntAddr = BOAccount.GetBusComp("Account Address Usage SCM"); BCAccntAddr.ClearToQuery(); BCAccntAddr.ActivateField("Address Id SCM"); BCAccntAddr.ActivateField("Address Geovalidated Flag denormalized SCM"); BCAccntAddr.ActivateField("City denormalized SCM"); BCAccntAddr.ActivateField("Country denormalized SCM"); BCAccntAddr.ActivateField("Language Code GAIA denormalized SCM"); BCAccntAddr.ActivateField("Location Id denormalized SCM"); BCAccntAddr.ActivateField("Location Supplement denormalized SCM"); BCAccntAddr.ActivateField("PO Box denormalized SCM"); BCAccntAddr.ActivateField("Postal Code Extension denormalized SCM"); BCAccntAddr.ActivateField("Postal Code denormalized SCM"); BCAccntAddr.ActivateField("Residence Description denormalized SCM"); BCAccntAddr.ActivateField("Street Address denormalized SCM"); BCAccntAddr.ActivateField("Street Nr. denormalized SCM"); BCAccntAddr.ActivateField("Validation Status denormalized SCM"); BCAccntAddr.SetSearchSpec("Account Id SCM", strAccountId); BCAccntAddr.ExecuteQuery(ForwardOnly); Outputs.SetProperty("AddressId", BCAccntAddr.GetFieldValue("Address Id SCM")); Outputs.SetProperty("AddressGeo", BCAccntAddr.GetFieldValue("Address Geovalidated Flag denormalized SCM")); Outputs.SetProperty("City", BCAccntAddr.GetFieldValue("City denormalized SCM")); Outputs.SetProperty("Country", BCAccntAddr.GetFieldValue("Country denormalized SCM")); Outputs.SetProperty("LanguageCode", BCAccntAddr.GetFieldValue("Language Code GAIA denormalized SCM")); Outputs.SetProperty("LocationId", BCAccntAddr.GetFieldValue("Location Id denormalized SCM")); Outputs.SetProperty("LocationSu", BCAccntAddr.GetFieldValue("Location Supplement denormalized SCM")); Outputs.SetProperty("POBox", BCAccntAddr.GetFieldValue("PO Box denormalized SCM")); Outputs.SetProperty("PCodeExt", BCAccntAddr.GetFieldValue("Postal Code Extension denormalized SCM")); Outputs.SetProperty("PCode", BCAccntAddr.GetFieldValue("Postal Code denormalized SCM")); Outputs.SetProperty("Residence", BCAccntAddr.GetFieldValue("Residence Description denormalized SCM")); Outputs.SetProperty("Street", BCAccntAddr.GetFieldValue("Street Address denormalized SCM")); Outputs.SetProperty("StreetNr", BCAccntAddr.GetFieldValue("Street Nr. denormalized SCM")); Outputs.SetProperty("ValidationStatus", BCAccntAddr.GetFieldValue("Validation Status denormalized SCM")); } catch(e) { } finally { BCAccntAddr = null; BOAccount = null; } }

Account BS SCM
GetDuplicateCustomers
/******************************************************* ** Name: GetDuplicateCustomers ** Created: 30.10.2009 ** Created By: Gema Torres ** Description: performance issue, BS instead of Siebel OPeration in wf Customer Validation SCM ** in orden to perform one query in Duplicate VBC instead of two queries because of SO ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function GetDuplicateCustomers(Inputs,Outputs) { /*var strAttribs; var BCDups; var BSDup; BSDup = TheApplication().GetService("Account BS SCM"); BSDup.InvokeMethod("DuplicateAccountSearch", strAttribs, BCDups); */ var BOAcc; var BCDup; try { BOAcc = oApp.ActiveBusObject(); BCDup = BOAcc.GetBusComp("Duplicate Customer Candidate VBC SCM"); BCDup.SetViewMode(AllView); BCDup.ClearToQuery(); BCDup.ExecuteQuery(ForwardOnly); if(BCDup.FirstRecord()) Outputs.SetProperty("Duplicate Customers", "3"); else Outputs.SetProperty("Duplicate Customers", "0"); } catch(e){ oApp.RaiseErrorText(e.toString()); } finally{ BCDup = null; BOAcc = null; } }

Account BS SCM
GetDuplicateCustomers
/******************************************************* ** Name: GetDuplicateCustomers ** Created: 30.10.2009 ** Created By: Gema Torres ** Description: performance issue, BS instead of Siebel OPeration in wf Customer Validation SCM ** in orden to perform one query in Duplicate VBC instead of two queries because of SO ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function GetDuplicateCustomers(Inputs,Outputs) { /*var strAttribs; var BCDups; var BSDup; BSDup = TheApplication().GetService("Account BS SCM"); BSDup.InvokeMethod("DuplicateAccountSearch", strAttribs, BCDups); */ var BOAcc; var BCDup; try { BOAcc = oApp.ActiveBusObject(); BCDup = BOAcc.GetBusComp("Duplicate Customer Candidate VBC SCM"); BCDup.SetViewMode(AllView); BCDup.ClearToQuery(); BCDup.ExecuteQuery(ForwardOnly); if(BCDup.FirstRecord()) Outputs.SetProperty("Duplicate Customers", "3"); else Outputs.SetProperty("Duplicate Customers", "0"); } catch(e){ oApp.RaiseErrorText(e.toString()); } finally{ BCDup = null; BOAcc = null; } }

Account BS SCM
GoToViewAccount
/******************************************************* ** Name: NameChange ** Created: 21.07.2008 ** Created By: Gomez Ayerbe, Javier ** Description: Creates the Change Name SR and navigates ** to the SR Toggle Account View SCM ** -------------------- Modifications --------------------- ** Version: ** Date: 19.01.2009 ** Changed By: Gema Torres ** Description: For Shop application if a Sr Contact In Shop exits open for the agent, it is reused and renamed to the one of change name ******************************************************/ function GoToViewAccount(Inputs, Outputs){ var BOServiceRequest; var BCServiceRequest; var BCAccount; var BCSRe; var AccountSearchSpec; var SRId; var svc; var Input; var Output; try { if(TheApplication().GetProfileAttr("ApplicationName") == "Siebel eChannel") //Shop Application { // Initializing the BO and BC BOServiceRequest = TheApplication().GetBusObject("Service Request"); BCServiceRequest = BOServiceRequest.GetBusComp("Service Request"); BCAccount = BOServiceRequest.GetBusComp("Account Lite SCM"); BCSRe = BOServiceRequest.GetBusComp("Service Request"); // Input Account Row Id AccountSearchSpec = Inputs.GetProperty("Row Id"); svc = TheApplication().GetService("Workflow Process Manager"); Input = TheApplication().NewPropertySet(); Output = TheApplication().NewPropertySet(); BCSRe.ClearToQuery(); BCSRe.SetSearchSpec("Status", "Open"); //BCSRe.SetSearchSpec("Sub-Area", "Contact in Shop"); BCSRe.SetSearchSpec("Sub-Area", "Contact in Shop1");//TAASAAI2 02.12.2015 SO2676 - SR Tree reorganization BCSRe.SetSearchSpec("Account Id", AccountSearchSpec); BCSRe.SetSearchSpec("Created By Name", TheApplication().GetProfileAttr("Login Name")); BCSRe.ExecuteQuery(ForwardOnly); //SR 'Contact in Shop' exits, it has to be rehused if(BCSRe.FirstRecord()) { BCSRe.SetFieldValue("Area","Customer Data"); BCSRe.SetFieldValue("Sub-Area","Name change"); BCSRe.SetFieldValue("Info Consult CD Not GUI SCM","mutation"); SRId = BCSRe.GetFieldValue("Id"); BCSRe.WriteRecord(); //Search SR to refresh SR applet if(SRId != "") { BCSRe.ClearToQuery(); BCSRe.SetSearchSpec("Id", SRId); BCSRe.ExecuteQuery(ForwardOnly); // BC - Account Lite BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", AccountSearchSpec); BCAccount.ExecuteQuery(ForwardOnly); } } else //New SR has to be created { // SR (Type: Customer Data; SubType: Change of Name; Detail: Mutation) creation Input.SetProperty("ProcessName", "Automatic SR Creation SCM"); //WF Create a SR automaticaaly and generate error if already exists one Input.SetProperty("Area", "Customer Data"); //Customer Data Input.SetProperty("Sub-Area", "Name change"); //Name Change Input.SetProperty("Detail", "mutation"); Input.SetProperty("Object Id",AccountSearchSpec); //To asociate the SR to the active client Input.SetProperty("Entity", "Customer"); svc.InvokeMethod("RunProcess", Input, Output); SRId = Output.GetProperty("Siebel Operation Object Id"); // Build the BO if(SRId != "") { // BC - Service Request BCServiceRequest.SetViewMode(AllView); BCServiceRequest.ClearToQuery(); BCServiceRequest.SetSearchSpec("Id", SRId); BCServiceRequest.ExecuteQuery(ForwardOnly); // BC - Account Lite BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", AccountSearchSpec); BCAccount.ExecuteQuery(ForwardOnly); } } //TheApplication().GotoView("SR Toggle Account View SCM", BOServiceRequest); //SCM 2010.08.25 TGDTOGE3 -- CR22419 --Change name now based on SR TheApplication().GotoView("SR To

Account BS SCM
GoToViewAccount
/******************************************************* ** Name: NameChange ** Created: 21.07.2008 ** Created By: Gomez Ayerbe, Javier ** Description: Creates the Change Name SR and navigates ** to the SR Toggle Account View SCM ** -------------------- Modifications --------------------- ** Version: ** Date: 19.01.2009 ** Changed By: Gema Torres ** Description: For Shop application if a Sr Contact In Shop exits open for the agent, it is reused and renamed to the one of change name ******************************************************/ function GoToViewAccount(Inputs, Outputs){ var BOServiceRequest; var BCServiceRequest; var BCAccount; var BCSRe; var AccountSearchSpec; var SRId; var svc; var Input; var Output; try { if(TheApplication().GetProfileAttr("ApplicationName") == "Siebel eChannel") //Shop Application { // Initializing the BO and BC BOServiceRequest = TheApplication().GetBusObject("Service Request"); BCServiceRequest = BOServiceRequest.GetBusComp("Service Request"); BCAccount = BOServiceRequest.GetBusComp("Account Lite SCM"); BCSRe = BOServiceRequest.GetBusComp("Service Request"); // Input Account Row Id AccountSearchSpec = Inputs.GetProperty("Row Id"); svc = TheApplication().GetService("Workflow Process Manager"); Input = TheApplication().NewPropertySet(); Output = TheApplication().NewPropertySet(); BCSRe.ClearToQuery(); BCSRe.SetSearchSpec("Status", "Open"); //BCSRe.SetSearchSpec("Sub-Area", "Contact in Shop"); BCSRe.SetSearchSpec("Sub-Area", "Contact in Shop1");//TAASAAI2 02.12.2015 SO2676 - SR Tree reorganization BCSRe.SetSearchSpec("Account Id", AccountSearchSpec); BCSRe.SetSearchSpec("Created By Name", TheApplication().GetProfileAttr("Login Name")); BCSRe.ExecuteQuery(ForwardOnly); //SR 'Contact in Shop' exits, it has to be rehused if(BCSRe.FirstRecord()) { BCSRe.SetFieldValue("Area","Customer Data"); BCSRe.SetFieldValue("Sub-Area","Name change"); BCSRe.SetFieldValue("Info Consult CD Not GUI SCM","mutation"); SRId = BCSRe.GetFieldValue("Id"); BCSRe.WriteRecord(); //Search SR to refresh SR applet if(SRId != "") { BCSRe.ClearToQuery(); BCSRe.SetSearchSpec("Id", SRId); BCSRe.ExecuteQuery(ForwardOnly); // BC - Account Lite BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", AccountSearchSpec); BCAccount.ExecuteQuery(ForwardOnly); } } else //New SR has to be created { // SR (Type: Customer Data; SubType: Change of Name; Detail: Mutation) creation Input.SetProperty("ProcessName", "Automatic SR Creation SCM"); //WF Create a SR automaticaaly and generate error if already exists one Input.SetProperty("Area", "Customer Data"); //Customer Data Input.SetProperty("Sub-Area", "Name change"); //Name Change Input.SetProperty("Detail", "mutation"); Input.SetProperty("Object Id",AccountSearchSpec); //To asociate the SR to the active client Input.SetProperty("Entity", "Customer"); svc.InvokeMethod("RunProcess", Input, Output); SRId = Output.GetProperty("Siebel Operation Object Id"); // Build the BO if(SRId != "") { // BC - Service Request BCServiceRequest.SetViewMode(AllView); BCServiceRequest.ClearToQuery(); BCServiceRequest.SetSearchSpec("Id", SRId); BCServiceRequest.ExecuteQuery(ForwardOnly); // BC - Account Lite BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", AccountSearchSpec); BCAccount.ExecuteQuery(ForwardOnly); } } //TheApplication().GotoView("SR Toggle Account View SCM", BOServiceRequest); //SCM 2010.08.25 TGDTOGE3 -- CR22419 --Change name now based on SR TheApplication().GotoView("SR To

Account BS SCM
GoToViewCreation
/******************************************************* ** Name: GoToViewCreation ** Created: 20.01.2009 ** Created By: Torres Campos, Gema ** Description: This script navigate to the Customer Creation View for Person Customers or Company Customers -------------------- Modifications --------------------- ** Version: <New Version> ** Date: ** Changed By: ** Description: ******************************************************/ function GoToViewCreation (Inputs) { var BOAcc; var BCAcc; try { BOAcc = TheApplication().GetBusObject("Account"); BCAcc = BOAcc.GetBusComp("Account"); //This query is to make the customer creation view empty. //Without this empty query the agent will see a customer until the browser script //is triggered. BCAcc.ClearToQuery(); BCAcc.SetSearchSpec("Id", "nothing"); BCAcc.ExecuteQuery(ForwardBackward); // TheApplication().SetProfileAttr("CustomerCreation","Y"); TheApplication().SetProfileAttr("CustomerTypeToCreate",Inputs.GetProperty("CustomerType")); TheApplication().SetProfileAttr("SearchInCenterDone","N"); TheApplication().GotoView(Inputs.GetProperty("ViewName"), BOAcc); return (ContinueOperation); } catch(e){ //throw(e); TheApplication().RaiseErrorText(e.toString()); } finally { BOAcc = null; BCAcc = null; } }

Account BS SCM
GoToViewCreation
/******************************************************* ** Name: GoToViewCreation ** Created: 20.01.2009 ** Created By: Torres Campos, Gema ** Description: This script navigate to the Customer Creation View for Person Customers or Company Customers -------------------- Modifications --------------------- ** Version: <New Version> ** Date: ** Changed By: ** Description: ******************************************************/ function GoToViewCreation (Inputs) { var BOAcc; var BCAcc; try { BOAcc = TheApplication().GetBusObject("Account"); BCAcc = BOAcc.GetBusComp("Account"); //This query is to make the customer creation view empty. //Without this empty query the agent will see a customer until the browser script //is triggered. BCAcc.ClearToQuery(); BCAcc.SetSearchSpec("Id", "nothing"); BCAcc.ExecuteQuery(ForwardBackward); // TheApplication().SetProfileAttr("CustomerCreation","Y"); TheApplication().SetProfileAttr("CustomerTypeToCreate",Inputs.GetProperty("CustomerType")); TheApplication().SetProfileAttr("SearchInCenterDone","N"); TheApplication().GotoView(Inputs.GetProperty("ViewName"), BOAcc); return (ContinueOperation); } catch(e){ //throw(e); TheApplication().RaiseErrorText(e.toString()); } finally { BOAcc = null; BCAcc = null; } }

Account BS SCM
GoToViewDuplicate
/******************************************************* ** Name: GoToViewDuplicate ** Created: 21.07.2008 ** Created By: Gomez Ayerbe, Javier ** Description: Navigates to the Duplicate Customer ** Candidate View SCM with the new customer selected ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function GoToViewDuplicate(Inputs, Outputs){ var BOAccountActive; var BCAccountActive; var svc; var Input; var Output; try { BOAccountActive = TheApplication().ActiveBusObject(); BCAccountActive = BOAccountActive.GetBusComp("Account"); //BCAccountActive.WriteRecord(); svc = TheApplication().GetService("Workflow Process Manager"); Input = TheApplication().NewPropertySet(); Output = TheApplication().NewPropertySet(); // Input.SetProperty("ProcessName", "Customer Validation SCM"); //Input.SetProperty("View", "Duplicate Customer Candidate VBC SCM"); svc.InvokeMethod("RunProcess", Input, Output); //var SRId = Output.GetProperty("Siebel Operation Object Id"); /*old // Initializing the BO and BC var BOAccountActive = TheApplication().ActiveBusObject(); var BCAccountActive = BOAccountActive.GetBusComp("Account"); BCAccountActive.WriteRecord(); var strAccId = BCAccountActive.GetFieldValue("Id"); //Get BO and BC Account var BOAccount = TheApplication().GetBusObject("Account"); var BCAccount = BOAccount.GetBusComp("Account"); //Query the Active Account to navigate BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id",strAccId); BCAccount.ExecuteQuery(ForwardOnly); TheApplication().GotoView("Duplicate Customer Candidate View SCM", BOAccount); */ } catch(e) { TheApplication().RaiseErrorText(e); //TheApplication().RaiseErrorText("Exp: "); } finally { Output = null; Input = null; svc = null; BCAccountActive = null; BOAccountActive = null; //strAccId = null; } }

Account BS SCM
GoToViewDuplicate
/******************************************************* ** Name: GoToViewDuplicate ** Created: 21.07.2008 ** Created By: Gomez Ayerbe, Javier ** Description: Navigates to the Duplicate Customer ** Candidate View SCM with the new customer selected ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function GoToViewDuplicate(Inputs, Outputs){ var BOAccountActive; var BCAccountActive; var svc; var Input; var Output; try { BOAccountActive = TheApplication().ActiveBusObject(); BCAccountActive = BOAccountActive.GetBusComp("Account"); //BCAccountActive.WriteRecord(); svc = TheApplication().GetService("Workflow Process Manager"); Input = TheApplication().NewPropertySet(); Output = TheApplication().NewPropertySet(); // Input.SetProperty("ProcessName", "Customer Validation SCM"); //Input.SetProperty("View", "Duplicate Customer Candidate VBC SCM"); svc.InvokeMethod("RunProcess", Input, Output); //var SRId = Output.GetProperty("Siebel Operation Object Id"); /*old // Initializing the BO and BC var BOAccountActive = TheApplication().ActiveBusObject(); var BCAccountActive = BOAccountActive.GetBusComp("Account"); BCAccountActive.WriteRecord(); var strAccId = BCAccountActive.GetFieldValue("Id"); //Get BO and BC Account var BOAccount = TheApplication().GetBusObject("Account"); var BCAccount = BOAccount.GetBusComp("Account"); //Query the Active Account to navigate BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id",strAccId); BCAccount.ExecuteQuery(ForwardOnly); TheApplication().GotoView("Duplicate Customer Candidate View SCM", BOAccount); */ } catch(e) { TheApplication().RaiseErrorText(e); //TheApplication().RaiseErrorText("Exp: "); } finally { Output = null; Input = null; svc = null; BCAccountActive = null; BOAccountActive = null; //strAccId = null; } }

Account BS SCM
InactivateAccount
/******************************************************* ** Name: InactivateAccount ** Created: 03.11.2008 ** Created By: Torres Campos, Gema ** Description: Creates the Inactivate SR, navigates ** to the SR Toggle Account View SCM and invokes the workflow "Inactivation Process Validation SCM" ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function InactivateAccount(Inputs, Outputs) { try { // Initializing the BO and BC var BOServiceRequest = TheApplication().GetBusObject("Service Request"); var BCServiceRequest = BOServiceRequest.GetBusComp("Service Request"); var BCAccount = BOServiceRequest.GetBusComp("Account Lite SCM"); // Input Account Row Id var AccountSearchSpec = Inputs.GetProperty("Row Id"); var svc = TheApplication().GetService("Workflow Process Manager"); var Input = TheApplication().NewPropertySet(); var Output = TheApplication().NewPropertySet(); // SR (Type: Customer Data; SubType: Change of Name; Detail: Mutation) creation Input.SetProperty("ProcessName", "Automatic SR Creation SCM"); //WF Create a SR automaticaaly and generate error if already exists one Input.SetProperty("Area", "Customer Data"); //Customer Data Input.SetProperty("Sub-Area", "Customer data maintenance"); Input.SetProperty("Detail", "Inactivate"); Input.SetProperty("Object Id", AccountSearchSpec); //To asociate the SR to the active client Input.SetProperty("Entity", "Customer"); svc.InvokeMethod("RunProcess", Input, Output); var SRId = Output.GetProperty("Siebel Operation Object Id"); // Build the BO if(SRId != "") { // BC - Service Request BCServiceRequest.SetViewMode(AllView); BCServiceRequest.ClearToQuery(); BCServiceRequest.SetSearchSpec("Id", SRId); BCServiceRequest.ExecuteQuery(ForwardOnly); // BC - Account Lite BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", AccountSearchSpec); BCAccount.ExecuteQuery(ForwardOnly); } //Invokes the workflow //Navigate TheApplication().GotoView("SR Toggle Account View SCM", BOServiceRequest); } catch(e) { TheApplication().RaiseErrorText(e.toString()); //TheApplication().RaiseErrorText("Exp: It was not possible to create the Serviec Request"); } finally { SRId = null; Input = null; Output = null; svc = null; AccountSearchSpec = null; BCAccount = null; BCServiceRequest = null; BOServiceRequest = null; } }

Account BS SCM
InactivateAccount
/******************************************************* ** Name: InactivateAccount ** Created: 03.11.2008 ** Created By: Torres Campos, Gema ** Description: Creates the Inactivate SR, navigates ** to the SR Toggle Account View SCM and invokes the workflow "Inactivation Process Validation SCM" ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function InactivateAccount(Inputs, Outputs) { try { // Initializing the BO and BC var BOServiceRequest = TheApplication().GetBusObject("Service Request"); var BCServiceRequest = BOServiceRequest.GetBusComp("Service Request"); var BCAccount = BOServiceRequest.GetBusComp("Account Lite SCM"); // Input Account Row Id var AccountSearchSpec = Inputs.GetProperty("Row Id"); var svc = TheApplication().GetService("Workflow Process Manager"); var Input = TheApplication().NewPropertySet(); var Output = TheApplication().NewPropertySet(); // SR (Type: Customer Data; SubType: Change of Name; Detail: Mutation) creation Input.SetProperty("ProcessName", "Automatic SR Creation SCM"); //WF Create a SR automaticaaly and generate error if already exists one Input.SetProperty("Area", "Customer Data"); //Customer Data Input.SetProperty("Sub-Area", "Customer data maintenance"); Input.SetProperty("Detail", "Inactivate"); Input.SetProperty("Object Id", AccountSearchSpec); //To asociate the SR to the active client Input.SetProperty("Entity", "Customer"); svc.InvokeMethod("RunProcess", Input, Output); var SRId = Output.GetProperty("Siebel Operation Object Id"); // Build the BO if(SRId != "") { // BC - Service Request BCServiceRequest.SetViewMode(AllView); BCServiceRequest.ClearToQuery(); BCServiceRequest.SetSearchSpec("Id", SRId); BCServiceRequest.ExecuteQuery(ForwardOnly); // BC - Account Lite BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", AccountSearchSpec); BCAccount.ExecuteQuery(ForwardOnly); } //Invokes the workflow //Navigate TheApplication().GotoView("SR Toggle Account View SCM", BOServiceRequest); } catch(e) { TheApplication().RaiseErrorText(e.toString()); //TheApplication().RaiseErrorText("Exp: It was not possible to create the Serviec Request"); } finally { SRId = null; Input = null; Output = null; svc = null; AccountSearchSpec = null; BCAccount = null; BCServiceRequest = null; BOServiceRequest = null; } }

Account BS SCM
MaintainFGPAssets
function MaintainFGPAssets() { /***************************************************************************** * Function: MaintainFGPAssets * Purpose : Function to maintain FGP asset (service type = "Platform") of HQ SAs * * For a given customer A * -> "Check": check whether one or more active FGP asset(s) exist(s) * -> "Inactivate": inactive one or more active FGP asset(s) * -> "Transfer": move one or more FGP asset(s) to customer B * if it is not already active there => transfer, else => inactivate * * Params : 0 ¦ Action Code : Check, Inactivate or Transfer * 1 ¦ Source HQ SA : ROW_ID of source HQ SA * 2 ¦ Target HQ SA : ROW_ID of target HQ SA * 3 ¦ Outputs : PropertySet *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ------------------------------------------------- * 2014-05-30 TGDGEMAM Initial Version - DROP Aug14 *****************************************************************************/ var objBO, objBOTgt: BusObject; var objBCAccnt, objBCAsset, objBCTgtAccnt, objBCTgtAsset: BusComp; var isRecord, isOutput: bool; var strTgtCMAId, strError, strStatus: String; try { strStatus = "Ok"; // source HQ SA objBO = oApp.GetBusObject("Account"); objBCAccnt = objBO.GetBusComp("Account"); // target HQ SA objBOTgt = oApp.GetBusObject("Account"); objBCTgtAccnt = objBOTgt.GetBusComp("Account"); if (defined(arguments[3])) {isOutput = true;} else {isOutput = false;} if (arguments[0].toString() == "Transfer" && arguments[2].toString() == "") { strError = "Please set <Target HQ SA> as input parameter"; oApp.RaiseErrorText(strError); } if (arguments[0].toString() == "Transfer") // in case of "Transfer" retrieve the target CMA Id with (objBCTgtAccnt) { ActivateField("Calculated CMA Account Id SCM"); SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Id", arguments[2]); ExecuteQuery(ForwardOnly); if (FirstRecord()) { strTgtCMAId = GetFieldValue("Calculated CMA Account Id SCM"); objBCTgtAsset = objBOTgt.GetBusComp("Asset Mgmt - Asset (Order Mgmt)"); } else { strError = "Target CMA could not be found!"; oApp.RaiseErrorText(strError); } } with (objBCAccnt) { // move cursor on HQ SA SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Id", arguments[1]); ExecuteQuery(ForwardOnly); isRecord = FirstRecord(); } if (isRecord) { // if account was found execute the requested action objBCAsset = objBO.GetBusComp("Asset Mgmt - Asset (Order Mgmt)"); with (objBCAsset) { ActivateField("Service Type"); ActivateField("Status"); ActivateField("Owner Account Id"); // cma ActivateField("Service Account Id"); // hq sa ActivateField("Product Id"); SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Service Type", oApp.InvokeMethod("LookupValue","UT_SERVICE_TYPE","Platform")); ExecuteQuery(ForwardOnly); isRecord = FirstRecord(); } switch (arguments[0].toString()) { case "Check": // check whether active FGP assets exist if (isOutput) arguments[3].SetProperty("Return", false); while(isRecord) { if (objBCAsset.GetFieldValue("Status") == oApp.InvokeMethod("LookupValue","IMPL_PHASE","Active")) { if (isOutput) arguments[3].SetProperty("Return", true); return (true); } isRecord = objBCAsset.NextRecord(); } return (false); break; case "Inactivate": // inactivate all active FGP assets while(isRecord) { if (objBCAsset.GetFieldValue("Status") == oApp.InvokeMethod("LookupValue","IMPL_PHASE","Active")) { objBCAsset.SetFieldValue("Status", oApp.InvokeMethod("LookupValue","IMPL_PHASE","Inactive")); objBCAsset.WriteRecord(); } isRecord = objBCAsset.NextRecord(); } break; case "Transfer": //

Account BS SCM
MaintainFGPAssets
function MaintainFGPAssets() { /***************************************************************************** * Function: MaintainFGPAssets * Purpose : Function to maintain FGP asset (service type = "Platform") of HQ SAs * * For a given customer A * -> "Check": check whether one or more active FGP asset(s) exist(s) * -> "Inactivate": inactive one or more active FGP asset(s) * -> "Transfer": move one or more FGP asset(s) to customer B * if it is not already active there => transfer, else => inactivate * * Params : 0 ¦ Action Code : Check, Inactivate or Transfer * 1 ¦ Source HQ SA : ROW_ID of source HQ SA * 2 ¦ Target HQ SA : ROW_ID of target HQ SA * 3 ¦ Outputs : PropertySet *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ------------------------------------------------- * 2014-05-30 TGDGEMAM Initial Version - DROP Aug14 *****************************************************************************/ var objBO, objBOTgt: BusObject; var objBCAccnt, objBCAsset, objBCTgtAccnt, objBCTgtAsset: BusComp; var isRecord, isOutput: bool; var strTgtCMAId, strError, strStatus: String; try { strStatus = "Ok"; // source HQ SA objBO = oApp.GetBusObject("Account"); objBCAccnt = objBO.GetBusComp("Account"); // target HQ SA objBOTgt = oApp.GetBusObject("Account"); objBCTgtAccnt = objBOTgt.GetBusComp("Account"); if (defined(arguments[3])) {isOutput = true;} else {isOutput = false;} if (arguments[0].toString() == "Transfer" && arguments[2].toString() == "") { strError = "Please set <Target HQ SA> as input parameter"; oApp.RaiseErrorText(strError); } if (arguments[0].toString() == "Transfer") // in case of "Transfer" retrieve the target CMA Id with (objBCTgtAccnt) { ActivateField("Calculated CMA Account Id SCM"); SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Id", arguments[2]); ExecuteQuery(ForwardOnly); if (FirstRecord()) { strTgtCMAId = GetFieldValue("Calculated CMA Account Id SCM"); objBCTgtAsset = objBOTgt.GetBusComp("Asset Mgmt - Asset (Order Mgmt)"); } else { strError = "Target CMA could not be found!"; oApp.RaiseErrorText(strError); } } with (objBCAccnt) { // move cursor on HQ SA SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Id", arguments[1]); ExecuteQuery(ForwardOnly); isRecord = FirstRecord(); } if (isRecord) { // if account was found execute the requested action objBCAsset = objBO.GetBusComp("Asset Mgmt - Asset (Order Mgmt)"); with (objBCAsset) { ActivateField("Service Type"); ActivateField("Status"); ActivateField("Owner Account Id"); // cma ActivateField("Service Account Id"); // hq sa ActivateField("Product Id"); SetViewMode(AllView); ClearToQuery(); SetSearchSpec("Service Type", oApp.InvokeMethod("LookupValue","UT_SERVICE_TYPE","Platform")); ExecuteQuery(ForwardOnly); isRecord = FirstRecord(); } switch (arguments[0].toString()) { case "Check": // check whether active FGP assets exist if (isOutput) arguments[3].SetProperty("Return", false); while(isRecord) { if (objBCAsset.GetFieldValue("Status") == oApp.InvokeMethod("LookupValue","IMPL_PHASE","Active")) { if (isOutput) arguments[3].SetProperty("Return", true); return (true); } isRecord = objBCAsset.NextRecord(); } return (false); break; case "Inactivate": // inactivate all active FGP assets while(isRecord) { if (objBCAsset.GetFieldValue("Status") == oApp.InvokeMethod("LookupValue","IMPL_PHASE","Active")) { objBCAsset.SetFieldValue("Status", oApp.InvokeMethod("LookupValue","IMPL_PHASE","Inactive")); objBCAsset.WriteRecord(); } isRecord = objBCAsset.NextRecord(); } break; case "Transfer": //

Account BS SCM
NoMatchDuplicate
function NoMatchDuplicate(Inputs,Outpus){ /******************************************************* ** Name: NoMatchDuplicate ** Created: 11.08.2008 ** Created By: TGDGOFR4 ** Description: The method creates a new SR (Quality Data) before ** a Customer "Forced Creation" is performed ******************************************************/ var BOActiveAccount:BusObject; var BCAccount:BusComp; var BOEmp:BusObject; var BCEmp:BusComp; var BCServiceRequest:BusComp; var strAccId:chars; try { //Get Active BO and Account BC from the context BOActiveAccount = TheApplication().ActiveBusObject(); BCAccount = BOActiveAccount.GetBusComp("Account"); strAccId = BCAccount.GetFieldValue("Id"); //Get Service Request BC from the context BCServiceRequest = BOActiveAccount.GetBusComp("Service Request"); //Create a new SR BCServiceRequest.SetViewMode(AllView); BCServiceRequest.NewRecord(NewAfter); BCServiceRequest.SetFieldValue("Account Id", strAccId); BCServiceRequest.SetFieldValue("Area", "Change"); BCServiceRequest.SetFieldValue("Sub-Area", "Quality of data1"); BCServiceRequest.SetFieldValue("Info Consult CD Not GUI SCM", "resolving doublets"); //SCM 2009.10.20 TGDTOGE3 Issue 16678, SR must be asigned to 'NIT Data Quality Teambox' corresponding to Id '1-119JZT' in s_contact BOEmp = oApp.GetBusObject("Employee"); BCEmp = BOEmp.GetBusComp("Employee"); BCEmp.SetViewMode(AllView); BCEmp.ClearToQuery(); BCEmp.SetSearchSpec("Login Name","UMSEGMENTIERUNG_TEAM"); BCEmp.ExecuteQuery(ForwardOnly); if(BCEmp.FirstRecord()) BCServiceRequest.SetFieldValue("Owned By Id", BCEmp.GetFieldValue("Id")); BCServiceRequest.WriteRecord(); BCServiceRequest.ClearToQuery(); BCServiceRequest.SetSearchSpec("Sub-Area", "New Customer"); BCServiceRequest.SetSearchSpec("Account Id", strAccId); BCServiceRequest.ExecuteQuery(ForwardOnly); } catch(e){ TheApplication().RaiseErrorText(e.toString()); } finally{ BCServiceRequest = null; BCAccount = null; BOActiveAccount = null; BCEmp = null; BOEmp = null; strAccId = null; } }

Account BS SCM
NoMatchDuplicate
function NoMatchDuplicate(Inputs,Outpus){ /******************************************************* ** Name: NoMatchDuplicate ** Created: 11.08.2008 ** Created By: TGDGOFR4 ** Description: The method creates a new SR (Quality Data) before ** a Customer "Forced Creation" is performed ******************************************************/ var BOActiveAccount:BusObject; var BCAccount:BusComp; var BOEmp:BusObject; var BCEmp:BusComp; var BCServiceRequest:BusComp; var strAccId:chars; try { //Get Active BO and Account BC from the context BOActiveAccount = TheApplication().ActiveBusObject(); BCAccount = BOActiveAccount.GetBusComp("Account"); strAccId = BCAccount.GetFieldValue("Id"); //Get Service Request BC from the context BCServiceRequest = BOActiveAccount.GetBusComp("Service Request"); //Create a new SR BCServiceRequest.SetViewMode(AllView); BCServiceRequest.NewRecord(NewAfter); BCServiceRequest.SetFieldValue("Account Id", strAccId); BCServiceRequest.SetFieldValue("Area", "Change"); BCServiceRequest.SetFieldValue("Sub-Area", "Quality of data1"); BCServiceRequest.SetFieldValue("Info Consult CD Not GUI SCM", "resolving doublets"); //SCM 2009.10.20 TGDTOGE3 Issue 16678, SR must be asigned to 'NIT Data Quality Teambox' corresponding to Id '1-119JZT' in s_contact BOEmp = oApp.GetBusObject("Employee"); BCEmp = BOEmp.GetBusComp("Employee"); BCEmp.SetViewMode(AllView); BCEmp.ClearToQuery(); BCEmp.SetSearchSpec("Login Name","UMSEGMENTIERUNG_TEAM"); BCEmp.ExecuteQuery(ForwardOnly); if(BCEmp.FirstRecord()) BCServiceRequest.SetFieldValue("Owned By Id", BCEmp.GetFieldValue("Id")); BCServiceRequest.WriteRecord(); BCServiceRequest.ClearToQuery(); BCServiceRequest.SetSearchSpec("Sub-Area", "New Customer"); BCServiceRequest.SetSearchSpec("Account Id", strAccId); BCServiceRequest.ExecuteQuery(ForwardOnly); } catch(e){ TheApplication().RaiseErrorText(e.toString()); } finally{ BCServiceRequest = null; BCAccount = null; BOActiveAccount = null; BCEmp = null; BOEmp = null; strAccId = null; } }

Account BS SCM
RefreshSAContracts
function RefreshSAContracts(strSAId) /***************************************************************************** * Function: RefreshSAContracts * Purpose : Function to refresh all contracts regarding changed CMA, * agreements and entitlements. Cleans up the entitlement * product relationship and fires repricing as well * Params : strSAId - a reference to a Service Account (Id) *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ------------------------------------------------- * 2013-06-25 TGDGEMAM created *****************************************************************************/ { var svc; var psInputs; var psOutputs; try { svc = oApp.GetService("Agreement BS SCM"); psInputs = oApp.NewPropertySet(); psInputs.SetProperty("Service Account Id", strSAId); psOutputs = oApp.NewPropertySet(); svc.InvokeMethod("RefreshAccountContracts", psInputs, psOutputs); if (psOutputs.GetProperty("Error Message") != "") oApp.RaiseErrorText("RefreshSAContracts - Error: '" + psOutputs.GetProperty("Error Message") + "'"); } catch(e) { oApp.RaiseErrorText(e.toString()); } finally { psInputs = null; psOutputs = null; svc = null; } }

Account BS SCM
RefreshSAContracts
function RefreshSAContracts(strSAId) /***************************************************************************** * Function: RefreshSAContracts * Purpose : Function to refresh all contracts regarding changed CMA, * agreements and entitlements. Cleans up the entitlement * product relationship and fires repricing as well * Params : strSAId - a reference to a Service Account (Id) *----------------------------------------------------------------------------- * History : * Date Name Description * ---------- -------- ------------------------------------------------- * 2013-06-25 TGDGEMAM created *****************************************************************************/ { var svc; var psInputs; var psOutputs; try { svc = oApp.GetService("Agreement BS SCM"); psInputs = oApp.NewPropertySet(); psInputs.SetProperty("Service Account Id", strSAId); psOutputs = oApp.NewPropertySet(); svc.InvokeMethod("RefreshAccountContracts", psInputs, psOutputs); if (psOutputs.GetProperty("Error Message") != "") oApp.RaiseErrorText("RefreshSAContracts - Error: '" + psOutputs.GetProperty("Error Message") + "'"); } catch(e) { oApp.RaiseErrorText(e.toString()); } finally { psInputs = null; psOutputs = null; svc = null; } }

Account BS SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /******************************************************* ** Name: Service_PreInvokeMethod ** Created: 14.07.2008 ** Created By: Javier Amor ** Description: ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ try{ oApp = TheApplication(); bIsTraceOn = oApp.isTraceON; switch (MethodName) { case("UpdateCMA"): UpdateCMA(Inputs, Outputs); break; case("DuplicateAccountSearch"): DuplicateAccountSearch(Inputs, Outputs); //return (CancelOperation); break; case("DuplicateAccountSearchPerson"): DuplicateAccountSearchPerson(Inputs, Outputs); //return (CancelOperation); break; case("DuplicateAccountSearchCompany"): DuplicateAccountSearchCompany(Inputs, Outputs); //return (CancelOperation); break; case "DuplicateCustomerCheck": // 2012-01-11; tgdstre0; Quadrica DuplicateCustomerCheck(Inputs, Outputs); break; case("GoToViewAccount"): GoToViewAccount(Inputs, Outputs); break; case("GoToViewDuplicate"): GoToViewDuplicate(Inputs, Outputs); break; case("GoToViewCreation"): GoToViewCreation(Inputs); break; case("ChangeHQFlg"): ChangeHQFlg(); break; case ("GetAccountId"): GetAccountId(Inputs, Outputs); break; case ("GetAddressId"): GetAddressId(Inputs, Outputs); break; case ("NoMatchDuplicate"): NoMatchDuplicate(Inputs, Outputs); break; case ("ContactBelongsToCustomer"): ContactBelongsToCustomer(Inputs, Outputs); break; case ("CheckPrimarySA"): CheckPrimarySA(); break; case("DeleteActiveSR"): DeleteActiveSR(Inputs, Outputs); //return (CancelOperation); break; case("CreateSASR"): CreateSASR(Inputs,Outputs); break; case("ChangeInStructuring"): ChangeInStructuring(Inputs,Outputs); break; case("SkeyAssignation"): SkeyAssignation(Inputs,Outputs); break; /*SCM TGDTOGE3 2009.10.30 performance issue, BS instead of Siebel OPeration in wf Customer Validation SCM*/ case("GetDuplicateCustomers"): GetDuplicateCustomers(Inputs,Outputs); break; /*SCM TGDGAAND 2010.02.10 New method to set the processing flag */ case("SetProcessFlag"): SetProcessFlag(Inputs); break; /*SCM TGDTOGE3 27.07.2010 -- CR 415 -- New method to create automatically the HQ SA when the company CMA is created*/ case("CreateHQ"): CreateHQ(Inputs, Outputs); break; /*SCM TGDTOGE3 25.08.2010 -- Defect 22419 -- New method to update Name in Account and CMA Name SCM BCs after a Name change*/ case("UpdateAccountName"): UpdateAccountName(Inputs, Outputs); break; /* TGDHAKA8 01.09.2010 -- CR 342: All CBU support structure of a Billing profile is deleted*/ case("DeleteBillingProfileStructure"): DeleteBillingProfileStructure(Inputs); break; /* TGDHAKA8 03.09.2010 -- Project CDM: returns default values for Company Main Contact*/ case("getCompanyMainContactDefaults"): getCompanyMainContactDefaults(Inputs, Outputs); break; /* TGDGEMAM 30.05.2014 -- DROP Aug14: new method to handle FGP assets*/ case ("MaintainFGPAssets"): MaintainFGPAssets( Inputs.GetProperty("Action"), Inputs.GetProperty("Source HQ SA"), Inputs.GetProperty("Target HQ SA"), Outputs); break; default: break; } return (CancelOperation); } finally { oApp = null; } }

Account BS SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /******************************************************* ** Name: Service_PreInvokeMethod ** Created: 14.07.2008 ** Created By: Javier Amor ** Description: ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ try{ oApp = TheApplication(); bIsTraceOn = oApp.isTraceON; switch (MethodName) { case("UpdateCMA"): UpdateCMA(Inputs, Outputs); break; case("DuplicateAccountSearch"): DuplicateAccountSearch(Inputs, Outputs); //return (CancelOperation); break; case("DuplicateAccountSearchPerson"): DuplicateAccountSearchPerson(Inputs, Outputs); //return (CancelOperation); break; case("DuplicateAccountSearchCompany"): DuplicateAccountSearchCompany(Inputs, Outputs); //return (CancelOperation); break; case "DuplicateCustomerCheck": // 2012-01-11; tgdstre0; Quadrica DuplicateCustomerCheck(Inputs, Outputs); break; case("GoToViewAccount"): GoToViewAccount(Inputs, Outputs); break; case("GoToViewDuplicate"): GoToViewDuplicate(Inputs, Outputs); break; case("GoToViewCreation"): GoToViewCreation(Inputs); break; case("ChangeHQFlg"): ChangeHQFlg(); break; case ("GetAccountId"): GetAccountId(Inputs, Outputs); break; case ("GetAddressId"): GetAddressId(Inputs, Outputs); break; case ("NoMatchDuplicate"): NoMatchDuplicate(Inputs, Outputs); break; case ("ContactBelongsToCustomer"): ContactBelongsToCustomer(Inputs, Outputs); break; case ("CheckPrimarySA"): CheckPrimarySA(); break; case("DeleteActiveSR"): DeleteActiveSR(Inputs, Outputs); //return (CancelOperation); break; case("CreateSASR"): CreateSASR(Inputs,Outputs); break; case("ChangeInStructuring"): ChangeInStructuring(Inputs,Outputs); break; case("SkeyAssignation"): SkeyAssignation(Inputs,Outputs); break; /*SCM TGDTOGE3 2009.10.30 performance issue, BS instead of Siebel OPeration in wf Customer Validation SCM*/ case("GetDuplicateCustomers"): GetDuplicateCustomers(Inputs,Outputs); break; /*SCM TGDGAAND 2010.02.10 New method to set the processing flag */ case("SetProcessFlag"): SetProcessFlag(Inputs); break; /*SCM TGDTOGE3 27.07.2010 -- CR 415 -- New method to create automatically the HQ SA when the company CMA is created*/ case("CreateHQ"): CreateHQ(Inputs, Outputs); break; /*SCM TGDTOGE3 25.08.2010 -- Defect 22419 -- New method to update Name in Account and CMA Name SCM BCs after a Name change*/ case("UpdateAccountName"): UpdateAccountName(Inputs, Outputs); break; /* TGDHAKA8 01.09.2010 -- CR 342: All CBU support structure of a Billing profile is deleted*/ case("DeleteBillingProfileStructure"): DeleteBillingProfileStructure(Inputs); break; /* TGDHAKA8 03.09.2010 -- Project CDM: returns default values for Company Main Contact*/ case("getCompanyMainContactDefaults"): getCompanyMainContactDefaults(Inputs, Outputs); break; /* TGDGEMAM 30.05.2014 -- DROP Aug14: new method to handle FGP assets*/ case ("MaintainFGPAssets"): MaintainFGPAssets( Inputs.GetProperty("Action"), Inputs.GetProperty("Source HQ SA"), Inputs.GetProperty("Target HQ SA"), Outputs); break; default: break; } return (CancelOperation); } finally { oApp = null; } }

Account BS SCM
SetProcessFlag
/******************************************************* ** Name:noed: 04.11.2009 ** Created By: Angel Garcia ** Description: Function to Set the Process Flag to Y or N depending on the Action ** Y: When any action is preformed over the customer -> Set when the Service Request is Submitted ** N: Set to N when the Service Request is Closed -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function SetProcessFlag(Inputs) { var BOAccount; var BCAccount; var AccountId; var ProcessFlag=""; try { //AccountId = TheApplication().GetProfileAttr("ProcessAccountId"); //ProcessFlag = TheApplication().GetProfileAttr("SetProcessFlag"); /* Search Customer */ BOAccount = TheApplication().GetBusObject("Account"); BCAccount = BOAccount.GetBusComp("Account"); BCAccount.ActivateField("Processing Flag SCM"); BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id",Inputs.GetProperty("CustomerId")); BCAccount.ExecuteQuery(ForwardBackward); /* Update Process Flag */ if (BCAccount.FirstRecord()) { BCAccount.SetFieldValue("Processing Flag SCM",Inputs.GetProperty("ProcessFlag")); BCAccount.WriteRecord(); } } catch(e) { TheApplication().RaiseErrorText(e.toString()); } finally { AccountId = null; ProcessFlag = null; BCAccount = null; BOAccount = null; } }

Account BS SCM
SetProcessFlag
/******************************************************* ** Name:noed: 04.11.2009 ** Created By: Angel Garcia ** Description: Function to Set the Process Flag to Y or N depending on the Action ** Y: When any action is preformed over the customer -> Set when the Service Request is Submitted ** N: Set to N when the Service Request is Closed -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function SetProcessFlag(Inputs) { var BOAccount; var BCAccount; var AccountId; var ProcessFlag=""; try { //AccountId = TheApplication().GetProfileAttr("ProcessAccountId"); //ProcessFlag = TheApplication().GetProfileAttr("SetProcessFlag"); /* Search Customer */ BOAccount = TheApplication().GetBusObject("Account"); BCAccount = BOAccount.GetBusComp("Account"); BCAccount.ActivateField("Processing Flag SCM"); BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id",Inputs.GetProperty("CustomerId")); BCAccount.ExecuteQuery(ForwardBackward); /* Update Process Flag */ if (BCAccount.FirstRecord()) { BCAccount.SetFieldValue("Processing Flag SCM",Inputs.GetProperty("ProcessFlag")); BCAccount.WriteRecord(); } } catch(e) { TheApplication().RaiseErrorText(e.toString()); } finally { AccountId = null; ProcessFlag = null; BCAccount = null; BOAccount = null; } }

Account BS SCM
SkeyAssignation
/******************************************************* ** Name: SkeyAssignation ** Created: 19.11.2008 ** Created By: Gomez Ayerbe, F. Javier ** Description: This method is going to assign the Skey number ** to the active Customer (CMA) ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function SkeyAssignation(Inputs,Outputs) { var BOActiveAccount; var BCAccount; var BOAccount; var BCSkey; var strSkeyId; var numSkey; var BCServReq; try { // Get the active BO and BC Account BOActiveAccount = TheApplication().ActiveBusObject(); BCAccount = BOActiveAccount.GetBusComp("Account"); // Get SR BC from the context BCServReq = BOActiveAccount.GetBusComp("Service Request"); // Create a new SR BCServReq.SetViewMode(AllView); BCServReq.NewRecord(NewAfter); BCServReq.SetFieldValue("Account Id", BCAccount.GetFieldValue("Id")); BCServReq.SetFieldValue("Area", "Customer Data"); BCServReq.SetFieldValue("Sub-Area", "Assign SKey"); BCServReq.SetFieldValue("Info Consult CD Not GUI SCM", "mutation"); BCServReq.WriteRecord(); // Generate the Skey number BOAccount = TheApplication().GetBusObject("Account"); BCSkey = BOAccount.GetBusComp("Account Skey Number SCM"); BCSkey.SetViewMode(AllView); BCSkey.NewRecord(NewAfter); BCSkey.SetFieldValue("Parent Account Id", BCAccount.GetFieldValue("Id")); BCSkey.WriteRecord(); strSkeyId = BCSkey.GetFieldValue("Id"); BCSkey.ClearToQuery(); BCSkey.SetSearchSpec("Id", strSkeyId); BCSkey.ExecuteQuery(ForwardOnly); numSkey = BCSkey.GetFieldValue("Skey Number SCM"); // Set the Skey Number field with the value from the oracle sequence BCAccount.SetFieldValue("Skey Number SCM", numSkey); BCAccount.WriteRecord(); // Returns the Skey number Outputs.SetProperty("Skey Number", numSkey); //Submit the SR /* BCServReq = BOAccount.GetBusComp("Service Request"); BCServReq.ClearToQuery(); BCServReq.SetSearchSpec("Account Id", BCAccount.GetFieldValue("Id")); BCServReq.SetSearchSpec("Sub-Area", "Assign SKey"); BCServReq.SetSearchSpec("Status", "Open"); BCServReq.ExecuteQuery(ForwardOnly); */ BCServReq.InvokeMethod("SubmitSR"); } catch(e){ TheApplication().RaiseErrorText(e.toString()); } finally{ BCServReq = null; BCSkey = null; BOAccount = null; BCAccount = null; BOActiveAccount = null; } }

Account BS SCM
SkeyAssignation
/******************************************************* ** Name: SkeyAssignation ** Created: 19.11.2008 ** Created By: Gomez Ayerbe, F. Javier ** Description: This method is going to assign the Skey number ** to the active Customer (CMA) ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function SkeyAssignation(Inputs,Outputs) { var BOActiveAccount; var BCAccount; var BOAccount; var BCSkey; var strSkeyId; var numSkey; var BCServReq; try { // Get the active BO and BC Account BOActiveAccount = TheApplication().ActiveBusObject(); BCAccount = BOActiveAccount.GetBusComp("Account"); // Get SR BC from the context BCServReq = BOActiveAccount.GetBusComp("Service Request"); // Create a new SR BCServReq.SetViewMode(AllView); BCServReq.NewRecord(NewAfter); BCServReq.SetFieldValue("Account Id", BCAccount.GetFieldValue("Id")); BCServReq.SetFieldValue("Area", "Customer Data"); BCServReq.SetFieldValue("Sub-Area", "Assign SKey"); BCServReq.SetFieldValue("Info Consult CD Not GUI SCM", "mutation"); BCServReq.WriteRecord(); // Generate the Skey number BOAccount = TheApplication().GetBusObject("Account"); BCSkey = BOAccount.GetBusComp("Account Skey Number SCM"); BCSkey.SetViewMode(AllView); BCSkey.NewRecord(NewAfter); BCSkey.SetFieldValue("Parent Account Id", BCAccount.GetFieldValue("Id")); BCSkey.WriteRecord(); strSkeyId = BCSkey.GetFieldValue("Id"); BCSkey.ClearToQuery(); BCSkey.SetSearchSpec("Id", strSkeyId); BCSkey.ExecuteQuery(ForwardOnly); numSkey = BCSkey.GetFieldValue("Skey Number SCM"); // Set the Skey Number field with the value from the oracle sequence BCAccount.SetFieldValue("Skey Number SCM", numSkey); BCAccount.WriteRecord(); // Returns the Skey number Outputs.SetProperty("Skey Number", numSkey); //Submit the SR /* BCServReq = BOAccount.GetBusComp("Service Request"); BCServReq.ClearToQuery(); BCServReq.SetSearchSpec("Account Id", BCAccount.GetFieldValue("Id")); BCServReq.SetSearchSpec("Sub-Area", "Assign SKey"); BCServReq.SetSearchSpec("Status", "Open"); BCServReq.ExecuteQuery(ForwardOnly); */ BCServReq.InvokeMethod("SubmitSR"); } catch(e){ TheApplication().RaiseErrorText(e.toString()); } finally{ BCServReq = null; BCSkey = null; BOAccount = null; BCAccount = null; BOActiveAccount = null; } }

Account BS SCM
UpdateAccountName
/******************************************************* ** Name: UpdateAccountName ** Created: 25.08.2010 ** Created By: TGDTOGE3 ** Description: Defect 22419 -- New method to update Name in Account and CMA Name SCM BCs after a Name change ** Changed By: TGDHURO9 (Robert Hunziker) ** Changed: 11.04.2011 ** Description: Fix of Defect 35344 PROD: Name change on CMA(Company) Customer. SR goes to failed: ** - for a CMA name change use the names from BC "CMA Name SCM". ** - tab indent corrected ** Changed By: TGDHAKA8 (Karin Schädler) ** Changed: 25.08.2011 ** Description: CR670: ** - Adding handling for CMA name versions marked as to-be-deleted or to-be-inactivated ******************************************************/ function UpdateAccountName(Inputs, Outputs) { var strNameId; var BOAccount:BusObject; var BOSR; var BCName; var strAccId; var strSRId; var BCAccount:BusComp; var BCSR; var strName; var strName1; var strName2; var strSANameId; var strSALangCode; var strSALang; var isrecord; var BCAccountName; var strCMANameLang; var isRecord2; var oDate = new Date; var sTimestamp = ""; var dateCalc; var monthCalc; var BOAccountName; var BCAllNames; var NameLanguage; var pickAnyName:bool=false; var accountActiveName:bool=false; var accountNameLang=""; var accountNameId; var srNameLang=""; var srActiveName:bool=false; var srCompanyName=""; var srName1=""; var srName2=""; try { //Get Account Id strAccId = Inputs.GetProperty("AccountId"); trcVar("AccountId", strAccId); //Get SR Id strSRId = Inputs.GetProperty("SRId"); trcVar("SRId", strSRId); BOAccount = oApp.GetBusObject("Account"); BCAccount = BOAccount.GetBusComp("Account Lite SCM"); BOSR = oApp.GetBusObject("Service Request"); BCSR = BOSR.GetBusComp("Service Request"); //Query on Account BCAccount.ActivateField("Name 1 SCM"); BCAccount.ActivateField("Type"); BCAccount.ActivateField("Sub Type SCM"); BCAccount.ActivateField("Primary Name Id SCM"); BCAccount.ActivateField("Primary CMA Name Language Code SCM"); BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", strAccId); BCAccount.ExecuteQuery(ForwardOnly); //Query on SR BCSR.ActivateField("Account Name SCM"); BCSR.ActivateField("Account Name 1 SCM"); BCSR.ActivateField("Account Name 2 SCM"); BCSR.ActivateField("Primary Name Id Aux SCM"); BCSR.ActivateField("SA Name Id Aux SCM"); BCSR.ActivateField("SA Company Index Language SCM"); BCSR.ActivateField("SA Company Index Language Code SCM"); BCSR.SetViewMode(AllView); BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id", strSRId); BCSR.SetSearchSpec("Sub-Area", "Name change"); BCSR.ExecuteQuery(ForwardOnly); //Get SR values if(BCSR.FirstRecord()) { strName = BCSR.GetFieldValue("Account Name SCM"); strName1 = BCSR.GetFieldValue("Account Name 1 SCM"); strName2 = BCSR.GetFieldValue("Account Name 2 SCM"); strNameId = BCSR.GetFieldValue("Primary Name Id Aux SCM"); strSANameId = BCSR.GetFieldValue("SA Name Id Aux SCM"); if(strSANameId != "") { strSALang = BCSR.GetFieldValue("SA Company Index Language SCM"); strSALangCode = BCSR.GetFieldValue("SA Company Index Language Code SCM"); } trcVar("Account Name SCM", strName); trcVar("Account Name 1 SCM", strName1); trcVar("Account Name 2 SCM", strName2); trcVar("Primary Name Id Aux SCM", strNameId); trcVar("SA Name Id Aux SCM", strSANameId); // Get the Account associated to the SR if(BCAccount.FirstRecord()) { if (BCAccount.GetFieldValue("Type")==oApp.InvokeMethod("LookupValue", "ACCOUNT_TYPE", "Company")) { if(BCAccount.GetFieldValue("Sub Type SCM")==oApp.InvokeMethod("LookupValue", "ACCOUNT_SUB_TYPE_SCM", "CMA")) { // Get CMA language and current Primary Name Id accountNameLang = BCAccount.GetFieldValue("Primary CMA Name Language Code SCM");

Account BS SCM
UpdateAccountName
/******************************************************* ** Name: UpdateAccountName ** Created: 25.08.2010 ** Created By: TGDTOGE3 ** Description: Defect 22419 -- New method to update Name in Account and CMA Name SCM BCs after a Name change ** Changed By: TGDHURO9 (Robert Hunziker) ** Changed: 11.04.2011 ** Description: Fix of Defect 35344 PROD: Name change on CMA(Company) Customer. SR goes to failed: ** - for a CMA name change use the names from BC "CMA Name SCM". ** - tab indent corrected ** Changed By: TGDHAKA8 (Karin Schädler) ** Changed: 25.08.2011 ** Description: CR670: ** - Adding handling for CMA name versions marked as to-be-deleted or to-be-inactivated ******************************************************/ function UpdateAccountName(Inputs, Outputs) { var strNameId; var BOAccount:BusObject; var BOSR; var BCName; var strAccId; var strSRId; var BCAccount:BusComp; var BCSR; var strName; var strName1; var strName2; var strSANameId; var strSALangCode; var strSALang; var isrecord; var BCAccountName; var strCMANameLang; var isRecord2; var oDate = new Date; var sTimestamp = ""; var dateCalc; var monthCalc; var BOAccountName; var BCAllNames; var NameLanguage; var pickAnyName:bool=false; var accountActiveName:bool=false; var accountNameLang=""; var accountNameId; var srNameLang=""; var srActiveName:bool=false; var srCompanyName=""; var srName1=""; var srName2=""; try { //Get Account Id strAccId = Inputs.GetProperty("AccountId"); trcVar("AccountId", strAccId); //Get SR Id strSRId = Inputs.GetProperty("SRId"); trcVar("SRId", strSRId); BOAccount = oApp.GetBusObject("Account"); BCAccount = BOAccount.GetBusComp("Account Lite SCM"); BOSR = oApp.GetBusObject("Service Request"); BCSR = BOSR.GetBusComp("Service Request"); //Query on Account BCAccount.ActivateField("Name 1 SCM"); BCAccount.ActivateField("Type"); BCAccount.ActivateField("Sub Type SCM"); BCAccount.ActivateField("Primary Name Id SCM"); BCAccount.ActivateField("Primary CMA Name Language Code SCM"); BCAccount.SetViewMode(AllView); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", strAccId); BCAccount.ExecuteQuery(ForwardOnly); //Query on SR BCSR.ActivateField("Account Name SCM"); BCSR.ActivateField("Account Name 1 SCM"); BCSR.ActivateField("Account Name 2 SCM"); BCSR.ActivateField("Primary Name Id Aux SCM"); BCSR.ActivateField("SA Name Id Aux SCM"); BCSR.ActivateField("SA Company Index Language SCM"); BCSR.ActivateField("SA Company Index Language Code SCM"); BCSR.SetViewMode(AllView); BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id", strSRId); BCSR.SetSearchSpec("Sub-Area", "Name change"); BCSR.ExecuteQuery(ForwardOnly); //Get SR values if(BCSR.FirstRecord()) { strName = BCSR.GetFieldValue("Account Name SCM"); strName1 = BCSR.GetFieldValue("Account Name 1 SCM"); strName2 = BCSR.GetFieldValue("Account Name 2 SCM"); strNameId = BCSR.GetFieldValue("Primary Name Id Aux SCM"); strSANameId = BCSR.GetFieldValue("SA Name Id Aux SCM"); if(strSANameId != "") { strSALang = BCSR.GetFieldValue("SA Company Index Language SCM"); strSALangCode = BCSR.GetFieldValue("SA Company Index Language Code SCM"); } trcVar("Account Name SCM", strName); trcVar("Account Name 1 SCM", strName1); trcVar("Account Name 2 SCM", strName2); trcVar("Primary Name Id Aux SCM", strNameId); trcVar("SA Name Id Aux SCM", strSANameId); // Get the Account associated to the SR if(BCAccount.FirstRecord()) { if (BCAccount.GetFieldValue("Type")==oApp.InvokeMethod("LookupValue", "ACCOUNT_TYPE", "Company")) { if(BCAccount.GetFieldValue("Sub Type SCM")==oApp.InvokeMethod("LookupValue", "ACCOUNT_SUB_TYPE_SCM", "CMA")) { // Get CMA language and current Primary Name Id accountNameLang = BCAccount.GetFieldValue("Primary CMA Name Language Code SCM");

Account BS SCM
UpdateCMA
/******************************************************* ** Name: UpdateCMA ** Created: 06.11.2008 ** Created By: Gomez Ayerbe, F. Javier ** Description: This method is going to carry out the process of updating the CMA to be removed from ** a Holding. The method will update the Parent Account Id field and the Master Account Id field with ** the adequate values. ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function UpdateCMA(Inputs, Outputs){ var strSRId; var BOSR; var BCSR; var strAccId; var BCAccount; try { strSRId = Inputs.GetProperty("SRId"); BOSR = TheApplication().GetBusObject("Service Request"); BCSR = BOSR.GetBusComp("Service Request"); BCSR.ActivateField("Secondary Account Id SCM"); BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id", strSRId); BCSR.ExecuteQuery(ForwardOnly); // Get the customer associated to the SR strAccId = BCSR.GetFieldValue("Account Id"); // Look for the customer in the DB BCAccount = BOSR.GetBusComp("Account"); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", strAccId); BCAccount.ExecuteQuery(ForwardOnly); // Set the old Parent Account Id into the newly created SR BCSR.SetFieldValue("Secondary Account Id SCM", BCAccount.GetFieldValue("Parent Account Id")); BCSR.WriteRecord(); // Update the relationship fields in the customer BCAccount.SetFieldValue("Parent Account Id", ""); BCAccount.SetFieldValue("Master Account Id", strAccId); BCAccount.WriteRecord(); } catch(e){ TheApplication().RaiseErrorText(e.toString()); } finally{ BCAccount = null; strAccId = null; BCSR = null; BOSR = null; strSRId = null; } }

Account BS SCM
UpdateCMA
/******************************************************* ** Name: UpdateCMA ** Created: 06.11.2008 ** Created By: Gomez Ayerbe, F. Javier ** Description: This method is going to carry out the process of updating the CMA to be removed from ** a Holding. The method will update the Parent Account Id field and the Master Account Id field with ** the adequate values. ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function UpdateCMA(Inputs, Outputs){ var strSRId; var BOSR; var BCSR; var strAccId; var BCAccount; try { strSRId = Inputs.GetProperty("SRId"); BOSR = TheApplication().GetBusObject("Service Request"); BCSR = BOSR.GetBusComp("Service Request"); BCSR.ActivateField("Secondary Account Id SCM"); BCSR.ClearToQuery(); BCSR.SetSearchSpec("Id", strSRId); BCSR.ExecuteQuery(ForwardOnly); // Get the customer associated to the SR strAccId = BCSR.GetFieldValue("Account Id"); // Look for the customer in the DB BCAccount = BOSR.GetBusComp("Account"); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", strAccId); BCAccount.ExecuteQuery(ForwardOnly); // Set the old Parent Account Id into the newly created SR BCSR.SetFieldValue("Secondary Account Id SCM", BCAccount.GetFieldValue("Parent Account Id")); BCSR.WriteRecord(); // Update the relationship fields in the customer BCAccount.SetFieldValue("Parent Account Id", ""); BCAccount.SetFieldValue("Master Account Id", strAccId); BCAccount.WriteRecord(); } catch(e){ TheApplication().RaiseErrorText(e.toString()); } finally{ BCAccount = null; strAccId = null; BCSR = null; BOSR = null; strSRId = null; } }

Account BS SCM
getCompanyMainContactDefaults
/******************************************************* ** Name: getCompanyMainContactDefaults ** Created: 03.09.2010 ** Created By: Karin Haack ** Description: Returns Default Values of Company Main Contact ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function getCompanyMainContactDefaults(Inputs,Outputs) { Outputs.SetProperty("Last Name", "K."); Outputs.SetProperty("First Name", "M."); Outputs.SetProperty("Birth Date", "01/01/1900"); Outputs.SetProperty("Nationality", TheApplication().InvokeMethod("LookupValue","COUNTRY","unknown")); Outputs.SetProperty("Type SCM", TheApplication().InvokeMethod("LookupValue","ACCT_CONTACT_TYPE_SCM","Contact Information")); Outputs.SetProperty("Letter Salutation SCM", TheApplication().InvokeMethod("LookupValue","MR_MS","Dear Customer")); Outputs.SetProperty("M/M", TheApplication().InvokeMethod("LookupValue","MR_MS","Unknown")); Outputs.SetProperty("Id Typ SCM", TheApplication().InvokeMethod("LookupValue","ID_TYPE_SCM","Unknown")); return(Outputs); }

Account BS SCM
getCompanyMainContactDefaults
/******************************************************* ** Name: getCompanyMainContactDefaults ** Created: 03.09.2010 ** Created By: Karin Haack ** Description: Returns Default Values of Company Main Contact ** -------------------- Modifications --------------------- ** Version: <New Version> ** Date: <Date of modification> ** Changed By: <Name of changer> ** Description: <Description of modification> ******************************************************/ function getCompanyMainContactDefaults(Inputs,Outputs) { Outputs.SetProperty("Last Name", "K."); Outputs.SetProperty("First Name", "M."); Outputs.SetProperty("Birth Date", "01/01/1900"); Outputs.SetProperty("Nationality", TheApplication().InvokeMethod("LookupValue","COUNTRY","unknown")); Outputs.SetProperty("Type SCM", TheApplication().InvokeMethod("LookupValue","ACCT_CONTACT_TYPE_SCM","Contact Information")); Outputs.SetProperty("Letter Salutation SCM", TheApplication().InvokeMethod("LookupValue","MR_MS","Dear Customer")); Outputs.SetProperty("M/M", TheApplication().InvokeMethod("LookupValue","MR_MS","Unknown")); Outputs.SetProperty("Id Typ SCM", TheApplication().InvokeMethod("LookupValue","ID_TYPE_SCM","Unknown")); return(Outputs); }

Account BS SCM
trc
/***************************************************************************** * Function: trc * Author : Robert Hunziker (TGDHURO9) * Purpose : Writes the given string to the log file * Params : s - the string to trace * Date : 2011-05-06 *----------------------------------------------------------------------------* * Update : *****************************************************************************/ function trc(s) { if (bIsTraceOn) { oApp.Trace(this.Name() + ": " + s); } }

Account BS SCM
trc
/***************************************************************************** * Function: trc * Author : Robert Hunziker (TGDHURO9) * Purpose : Writes the given string to the log file * Params : s - the string to trace * Date : 2011-05-06 *----------------------------------------------------------------------------* * Update : *****************************************************************************/ function trc(s) { if (bIsTraceOn) { oApp.Trace(this.Name() + ": " + s); } }

Account BS SCM
trcVar
/***************************************************************************** * Function: trcVar * Author : Robert Hunziker (TGDHURO9) * Purpose : Trace a variable into a logfile with its name and its value. * Date : 2011-05-06 *----------------------------------------------------------------------------* * Update : *****************************************************************************/ function trcVar(strVarName, strVar) { if (bIsTraceOn) { oApp.Trace(this.Name() + ": " + strVarName + "='" + strVar + "'"); } }

Account BS SCM
trcVar
/***************************************************************************** * Function: trcVar * Author : Robert Hunziker (TGDHURO9) * Purpose : Trace a variable into a logfile with its name and its value. * Date : 2011-05-06 *----------------------------------------------------------------------------* * Update : *****************************************************************************/ function trcVar(strVarName, strVar) { if (bIsTraceOn) { oApp.Trace(this.Name() + ": " + strVarName + "='" + strVar + "'"); } }

Account Contact VBC SCM
(declarations)
var oApp = TheApplication(); // TGDSCTHO, 20061116 enable tracing var bIsTraceOn = oApp.isTraceON; // TGDSCTHO, 20061116 enable tracing //Hardcodes var COMP = "Company"; //View names where the applet should be executed var OLI_VIEW = "Order Entry - Line Items View (Sales)"; var OLI_REIS_1 = "Sales Order-Browse Catalog Category GRAS ROSE View - Add to Cart SCM"; var OLI_REIS_2 = "Sales Order-Browse Catalog Category Retention View - Add to Cart SCM"; var OLI_REIS_3 = "Sales Order-Browse Catalog Category Retention View SCM"; var QSUMVIEW = "Quote Item XA View AIP SCM";

Account Contact VBC SCM
(declarations)
var oApp = TheApplication(); // TGDSCTHO, 20061116 enable tracing var bIsTraceOn = oApp.isTraceON; // TGDSCTHO, 20061116 enable tracing //Hardcodes var COMP = "Company"; //View names where the applet should be executed var OLI_VIEW = "Order Entry - Line Items View (Sales)"; var OLI_REIS_1 = "Sales Order-Browse Catalog Category GRAS ROSE View - Add to Cart SCM"; var OLI_REIS_2 = "Sales Order-Browse Catalog Category Retention View - Add to Cart SCM"; var OLI_REIS_3 = "Sales Order-Browse Catalog Category Retention View SCM"; var QSUMVIEW = "Quote Item XA View AIP SCM";

Account Contact VBC SCM
Init
function Init (Inputs, Outputs) { /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: Init ** Created: 27.01.2009 ** Created By: TGDSEAI1 ** Description: Initialize the BC fields *****************************************************************/ try{ Outputs.SetProperty("Letter Salutation SCM", ""); Outputs.SetProperty("First Name SCM", ""); Outputs.SetProperty("Last Name SCM", ""); Outputs.SetProperty("Language Code SCM", ""); Outputs.SetProperty("Contact Middle Name", ""); Outputs.SetProperty("Contact M/F Calc for OLI SCM", ""); Outputs.SetProperty("Contact Id", ""); Outputs.SetProperty("Alt Email Addr", ""); Outputs.SetProperty("Account Id SCM", ""); } catch(e){ if(TheApplication().isTraceON) TheApplication().Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ } }

Account Contact VBC SCM
Init
function Init (Inputs, Outputs) { /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: Init ** Created: 27.01.2009 ** Created By: TGDSEAI1 ** Description: Initialize the BC fields *****************************************************************/ try{ Outputs.SetProperty("Letter Salutation SCM", ""); Outputs.SetProperty("First Name SCM", ""); Outputs.SetProperty("Last Name SCM", ""); Outputs.SetProperty("Language Code SCM", ""); Outputs.SetProperty("Contact Middle Name", ""); Outputs.SetProperty("Contact M/F Calc for OLI SCM", ""); Outputs.SetProperty("Contact Id", ""); Outputs.SetProperty("Alt Email Addr", ""); Outputs.SetProperty("Account Id SCM", ""); } catch(e){ if(TheApplication().isTraceON) TheApplication().Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ } }

Account Contact VBC SCM
Query
function Query(Inputs, Outputs) { /************************************************************************************************************** ** Name: Query ** Created: 1.10.2009 ** Created By: Antonio Rodríguez Villanueva ** Description: Do the VBC Query ** *************************************************************************************************************** ** Modification: 01.03.2011 ** Modified By: TGDSEAI1 ** Description: Adapted script to work on Quote Context. Some clean up and modularization ***************************************************************************************************************/ //Variable Declarations var BOActive:BusObject; var BCActive:BusComp; var AccountId = ""; var strCompMainId = ""; try{ //Initialize the Account Id depending of the context BOActive = TheApplication().ActiveBusObject(); if(BOActive.Name() == "Order Entry (Sales)"){ BCActive = BOActive.GetBusComp("Order Entry - Line Items"); AccountId = BCActive.GetFieldValue("Account Id"); } else if(BOActive.Name() == "Quote"){ BCActive = BOActive.GetBusComp("Quote"); AccountId = BCActive.GetFieldValue("Account Id"); } //If Account Id in context keep with query if(AccountId != null && AccountId != ""){ //Account will be set as a contact when it is a company in the outpus strCompMainId = fGetAccountAsContact(AccountId, Outputs); fAddContacts(AccountId, strCompMainId, Outputs); } }//End Try catch(e){ if(TheApplication().isTraceON) TheApplication().Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ //Variable destruction BOActive = null; BCActive = null; AccountId = null; strCompMainId = null; } }

Account Contact VBC SCM
Query
function Query(Inputs, Outputs) { /************************************************************************************************************** ** Name: Query ** Created: 1.10.2009 ** Created By: Antonio Rodríguez Villanueva ** Description: Do the VBC Query ** *************************************************************************************************************** ** Modification: 01.03.2011 ** Modified By: TGDSEAI1 ** Description: Adapted script to work on Quote Context. Some clean up and modularization ***************************************************************************************************************/ //Variable Declarations var BOActive:BusObject; var BCActive:BusComp; var AccountId = ""; var strCompMainId = ""; try{ //Initialize the Account Id depending of the context BOActive = TheApplication().ActiveBusObject(); if(BOActive.Name() == "Order Entry (Sales)"){ BCActive = BOActive.GetBusComp("Order Entry - Line Items"); AccountId = BCActive.GetFieldValue("Account Id"); } else if(BOActive.Name() == "Quote"){ BCActive = BOActive.GetBusComp("Quote"); AccountId = BCActive.GetFieldValue("Account Id"); } //If Account Id in context keep with query if(AccountId != null && AccountId != ""){ //Account will be set as a contact when it is a company in the outpus strCompMainId = fGetAccountAsContact(AccountId, Outputs); fAddContacts(AccountId, strCompMainId, Outputs); } }//End Try catch(e){ if(TheApplication().isTraceON) TheApplication().Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ //Variable destruction BOActive = null; BCActive = null; AccountId = null; strCompMainId = null; } }

Account Contact VBC SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /***************************************************************** ** Bussiness Service: CNO Address SCM ** Created: 30.09.2009 ** Created By: TGDROANA ** Description: *****************************************************************/ switch (MethodName) { case("Init"): Init(Inputs, Outputs); break; case("Query"): Query(Inputs, Outputs); break; default: break; } return (CancelOperation); }

Account Contact VBC SCM
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { /***************************************************************** ** Bussiness Service: CNO Address SCM ** Created: 30.09.2009 ** Created By: TGDROANA ** Description: *****************************************************************/ switch (MethodName) { case("Init"): Init(Inputs, Outputs); break; case("Query"): Query(Inputs, Outputs); break; default: break; } return (CancelOperation); }

Account Contact VBC SCM
fActivateAccountFields
function fActivateAccountFields(BCAccount:BusComp){ /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: fActivateAccountFields ** Created: 01.03.2011 ** Created By: TGDSEAI1 ** Description: Activate BC fields for query *****************************************************************/ BCAccount.ActivateField("Name"); BCAccount.ActivateField("CMA Company Name SCM"); BCAccount.ActivateField("Type"); BCAccount.ActivateField("Sub Type SCM"); BCAccount.ActivateField("Letter Salutation SCM"); BCAccount.ActivateField("Correspondence Language Code SCM"); BCAccount.ActivateField("Calculate Sub Type SCM"); //SCM 19.10.2010 TGDLOAL3: Company Main must not appear BCAccount.ActivateField("Primary Company Main Contact SCM"); }

Account Contact VBC SCM
fActivateAccountFields
function fActivateAccountFields(BCAccount:BusComp){ /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: fActivateAccountFields ** Created: 01.03.2011 ** Created By: TGDSEAI1 ** Description: Activate BC fields for query *****************************************************************/ BCAccount.ActivateField("Name"); BCAccount.ActivateField("CMA Company Name SCM"); BCAccount.ActivateField("Type"); BCAccount.ActivateField("Sub Type SCM"); BCAccount.ActivateField("Letter Salutation SCM"); BCAccount.ActivateField("Correspondence Language Code SCM"); BCAccount.ActivateField("Calculate Sub Type SCM"); //SCM 19.10.2010 TGDLOAL3: Company Main must not appear BCAccount.ActivateField("Primary Company Main Contact SCM"); }

Account Contact VBC SCM
fActivateContactFields
function fActivateContactFields(BCContact:BusComp){ /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: fActivateContactFields ** Created: 01.03.2011 ** Created By: TGDSEAI1 ** Description: Activate BC fields for query *****************************************************************/ BCContact.ActivateField("Contact First Name"); BCContact.ActivateField("Contact Last Name"); BCContact.ActivateField("Contact Correspondence Language Code SCM"); BCContact.ActivateField("Contact M/M"); BCContact.ActivateField("Contact Middle Name"); BCContact.ActivateField("Contact M/F Calc for OLI SCM"); BCContact.ActivateField("Contact Id"); BCContact.ActivateField("Alt Email Addr"); }

Account Contact VBC SCM
fActivateContactFields
function fActivateContactFields(BCContact:BusComp){ /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: fActivateContactFields ** Created: 01.03.2011 ** Created By: TGDSEAI1 ** Description: Activate BC fields for query *****************************************************************/ BCContact.ActivateField("Contact First Name"); BCContact.ActivateField("Contact Last Name"); BCContact.ActivateField("Contact Correspondence Language Code SCM"); BCContact.ActivateField("Contact M/M"); BCContact.ActivateField("Contact Middle Name"); BCContact.ActivateField("Contact M/F Calc for OLI SCM"); BCContact.ActivateField("Contact Id"); BCContact.ActivateField("Alt Email Addr"); }

Account Contact VBC SCM
fAddContacts
function fAddContacts(AccountId, strCompMainId, Outputs){ /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: fAddContacts ** Created: 01.03.2011 ** Created By: TGDSEAI1 ** Description: Moved to a function for modularity. Do the query for contacts of customers and add them to the VBC Property *****************************************************************/ //Variable Declaration var BO:BusObject; var BCContact:BusComp; var BCCon:BusComp; var psRow:PropertySet; try{ //Initialize BO = TheApplication().GetBusObject("Account"); BCCon = BO.GetBusComp("Contact"); BCContact = BO.GetBusComp("Account Contact SCM"); //Do query in Account Contact SCM BC BCContact.SetViewMode(AllView); //Activate Fields fActivateContactFields(BCContact); BCContact.ClearToQuery(); //SCM 19.10.2010 TGDLOAL3: Company Main must not appear if(strCompMainId != "" && strCompMainId != null){ BCContact.SetSearchSpec("Contact Id", "<>'" + strCompMainId + "'"); } BCContact.SetSearchSpec("Accnt Id", AccountId); BCContact.SetSearchSpec("End Date SCM", "is NULL"); BCContact.ExecuteQuery(ForwardOnly); if(BCContact.FirstRecord()) { do { psRow = TheApplication().NewPropertySet(); psRow.SetProperty("First Name SCM", BCContact.GetFieldValue("Contact First Name")); psRow.SetProperty("Last Name SCM", BCContact.GetFieldValue("Contact Last Name")); psRow.SetProperty("Language Code SCM", BCContact.GetFieldValue("Contact Correspondence Language Code SCM")); psRow.SetProperty("Letter Salutation SCM", BCContact.GetFieldValue("Contact M/M")); psRow.SetProperty("Account Id SCM", AccountId); psRow.SetProperty("Contact Middle Name", BCContact.GetFieldValue("Contact Middle Name")); psRow.SetProperty("Contact M/F Calc for OLI SCM", BCContact.GetFieldValue("Contact M/F Calc for OLI SCM")); psRow.SetProperty("Contact Id", BCContact.GetFieldValue("Contact Id")); //SCM 29.09.2010 Project CDM: Data Model Change //field "Alt Email Addr" is no more in BC 'Account Contact SCM' it is in the BC 'Contact'-> query in Contact BCCon.ActivateField("Email Address"); BCCon.SetViewMode(AllView); BCCon.ClearToQuery(); BCCon.SetSearchSpec("Id", BCContact.GetFieldValue("Contact Id")); BCCon.ExecuteQuery(ForwardOnly); if(BCCon.FirstRecord()){ psRow.SetProperty("Alt Email Addr", BCCon.GetFieldValue("Email Address")); } Outputs.AddChild (psRow); }while(BCContact.NextRecord()) } //End If; }//End Try catch(e){ if(TheApplication().isTraceON) TheApplication().Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ //Variable destruction BO = null; BCContact = null; BCCon = null; psRow = null; } }

Account Contact VBC SCM
fAddContacts
function fAddContacts(AccountId, strCompMainId, Outputs){ /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: fAddContacts ** Created: 01.03.2011 ** Created By: TGDSEAI1 ** Description: Moved to a function for modularity. Do the query for contacts of customers and add them to the VBC Property *****************************************************************/ //Variable Declaration var BO:BusObject; var BCContact:BusComp; var BCCon:BusComp; var psRow:PropertySet; try{ //Initialize BO = TheApplication().GetBusObject("Account"); BCCon = BO.GetBusComp("Contact"); BCContact = BO.GetBusComp("Account Contact SCM"); //Do query in Account Contact SCM BC BCContact.SetViewMode(AllView); //Activate Fields fActivateContactFields(BCContact); BCContact.ClearToQuery(); //SCM 19.10.2010 TGDLOAL3: Company Main must not appear if(strCompMainId != "" && strCompMainId != null){ BCContact.SetSearchSpec("Contact Id", "<>'" + strCompMainId + "'"); } BCContact.SetSearchSpec("Accnt Id", AccountId); BCContact.SetSearchSpec("End Date SCM", "is NULL"); BCContact.ExecuteQuery(ForwardOnly); if(BCContact.FirstRecord()) { do { psRow = TheApplication().NewPropertySet(); psRow.SetProperty("First Name SCM", BCContact.GetFieldValue("Contact First Name")); psRow.SetProperty("Last Name SCM", BCContact.GetFieldValue("Contact Last Name")); psRow.SetProperty("Language Code SCM", BCContact.GetFieldValue("Contact Correspondence Language Code SCM")); psRow.SetProperty("Letter Salutation SCM", BCContact.GetFieldValue("Contact M/M")); psRow.SetProperty("Account Id SCM", AccountId); psRow.SetProperty("Contact Middle Name", BCContact.GetFieldValue("Contact Middle Name")); psRow.SetProperty("Contact M/F Calc for OLI SCM", BCContact.GetFieldValue("Contact M/F Calc for OLI SCM")); psRow.SetProperty("Contact Id", BCContact.GetFieldValue("Contact Id")); //SCM 29.09.2010 Project CDM: Data Model Change //field "Alt Email Addr" is no more in BC 'Account Contact SCM' it is in the BC 'Contact'-> query in Contact BCCon.ActivateField("Email Address"); BCCon.SetViewMode(AllView); BCCon.ClearToQuery(); BCCon.SetSearchSpec("Id", BCContact.GetFieldValue("Contact Id")); BCCon.ExecuteQuery(ForwardOnly); if(BCCon.FirstRecord()){ psRow.SetProperty("Alt Email Addr", BCCon.GetFieldValue("Email Address")); } Outputs.AddChild (psRow); }while(BCContact.NextRecord()) } //End If; }//End Try catch(e){ if(TheApplication().isTraceON) TheApplication().Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ //Variable destruction BO = null; BCContact = null; BCCon = null; psRow = null; } }

Account Contact VBC SCM
fGetAccountAsContact
function fGetAccountAsContact(AccountId, Outputs){ /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: fActivateAccountFields ** Created: 01.03.2011 ** Created By: TGDSEAI1 ** Description: Moved to a function for modularity. Do the query for Company customers to take the Company Customer data as contact data *****************************************************************/ //Variable Declarations var BO:BusObject; var BCAccount:BusComp; var psRow:PropertySet; var strCompMainId = ""; try{ psRow = TheApplication().NewPropertySet(); BO = TheApplication().GetBusObject("Account"); BCAccount = BO.GetBusComp("Account"); BCAccount.SetViewMode(AllView); //Activate the fields fActivateAccountFields(BCAccount); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", AccountId); BCAccount.ExecuteQuery(ForwardOnly); if(BCAccount.FirstRecord()) { //Check if it is a company if (BCAccount.GetFieldValue("Type") == COMP){ if (BCAccount.GetFieldValue("Calculate Sub Type SCM") == "Y"){ psRow.SetProperty("Account Id SCM", AccountId); psRow.SetProperty("First Name SCM", ""); psRow.SetProperty("Last Name SCM", BCAccount.GetFieldValue("Name")); psRow.SetProperty("Language Code SCM", BCAccount.GetFieldValue("Correspondence Language Code SCM")); psRow.SetProperty("Letter Salutation SCM", BCAccount.GetFieldValue("Title SCM")); Outputs.AddChild(psRow); } else{ //CMA psRow.SetProperty("Account Id SCM", AccountId); psRow.SetProperty("First Name SCM", ""); psRow.SetProperty("Last Name SCM", BCAccount.GetFieldValue("CMA Company Name SCM")); psRow.SetProperty("Language Code SCM", BCAccount.GetFieldValue("Correspondence Language Code SCM")); psRow.SetProperty("Letter Salutation SCM", BCAccount.GetFieldValue("Title SCM")); Outputs.AddChild(psRow); }//end if subtype //SCM 19.10.2010 TGDLOAL3: Company Main must not appear strCompMainId = BCAccount.GetFieldValue("Primary Company Main Contact SCM"); } //End if type }//End First Record // TGDDERO7, 31.05.2011, move return statement behind finally statement // return (strCompMainId); } catch(e){ if(TheApplication().isTraceON) TheApplication().Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ //Variable destruction BO = null; BCAccount = null; psRow = null; // TGDDERO7, 31.05.2011, do not destroy // strCompMainId = null; } // TGDDERO7, 31.05.2011, move return statement behind finally statement return (strCompMainId); }

Account Contact VBC SCM
fGetAccountAsContact
function fGetAccountAsContact(AccountId, Outputs){ /***************************************************************** ** Bussiness Service: Account Contact VBC SCM ** Function: fActivateAccountFields ** Created: 01.03.2011 ** Created By: TGDSEAI1 ** Description: Moved to a function for modularity. Do the query for Company customers to take the Company Customer data as contact data *****************************************************************/ //Variable Declarations var BO:BusObject; var BCAccount:BusComp; var psRow:PropertySet; var strCompMainId = ""; try{ psRow = TheApplication().NewPropertySet(); BO = TheApplication().GetBusObject("Account"); BCAccount = BO.GetBusComp("Account"); BCAccount.SetViewMode(AllView); //Activate the fields fActivateAccountFields(BCAccount); BCAccount.ClearToQuery(); BCAccount.SetSearchSpec("Id", AccountId); BCAccount.ExecuteQuery(ForwardOnly); if(BCAccount.FirstRecord()) { //Check if it is a company if (BCAccount.GetFieldValue("Type") == COMP){ if (BCAccount.GetFieldValue("Calculate Sub Type SCM") == "Y"){ psRow.SetProperty("Account Id SCM", AccountId); psRow.SetProperty("First Name SCM", ""); psRow.SetProperty("Last Name SCM", BCAccount.GetFieldValue("Name")); psRow.SetProperty("Language Code SCM", BCAccount.GetFieldValue("Correspondence Language Code SCM")); psRow.SetProperty("Letter Salutation SCM", BCAccount.GetFieldValue("Title SCM")); Outputs.AddChild(psRow); } else{ //CMA psRow.SetProperty("Account Id SCM", AccountId); psRow.SetProperty("First Name SCM", ""); psRow.SetProperty("Last Name SCM", BCAccount.GetFieldValue("CMA Company Name SCM")); psRow.SetProperty("Language Code SCM", BCAccount.GetFieldValue("Correspondence Language Code SCM")); psRow.SetProperty("Letter Salutation SCM", BCAccount.GetFieldValue("Title SCM")); Outputs.AddChild(psRow); }//end if subtype //SCM 19.10.2010 TGDLOAL3: Company Main must not appear strCompMainId = BCAccount.GetFieldValue("Primary Company Main Contact SCM"); } //End if type }//End First Record // TGDDERO7, 31.05.2011, move return statement behind finally statement // return (strCompMainId); } catch(e){ if(TheApplication().isTraceON) TheApplication().Trace(this.Name() + " Error: " + e.message); throw(e); } finally{ //Variable destruction BO = null; BCAccount = null; psRow = null; // TGDDERO7, 31.05.2011, do not destroy // strCompMainId = null; } // TGDDERO7, 31.05.2011, move return statement behind finally statement return (strCompMainId); }

Account Interface Maps - Siebel Inbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // CREATOR : CAROLINE M. // LAST UPDATED : 12/28/2000 // // DESCRIPTION // Javascript maps from Oracle Operating Unit to Siebel Organization // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Interface Maps - Siebel Inbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // CREATOR : CAROLINE M. // LAST UPDATED : 12/28/2000 // // DESCRIPTION // Javascript maps from Oracle Operating Unit to Siebel Organization // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Interface Maps - Siebel Inbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // CREATOR : CAROLINE M. // LAST UPDATED : 12/28/2000 // // DESCRIPTION // Javascript maps from Oracle Operating Unit to Siebel Organization // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Interface Maps - Siebel Inbound
CopyIntegrationObjectData
function CopyIntegrationObjectData (OracleIntObject, SiebelIntObject) { // // Declare variables to hold the Oracle Primary Integration Component and // The Siebel Primary Integration Component // var OracleCustomerIntComp, SiebelAccountIntComp; // //Get the primary integration component from the Oracle Integration Object // OracleCustomerIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS_INTERFACE_ALL"); if (OracleCustomerIntComp.Exists ()) { // CUSTOMER INTERFACE SiebelAccountIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomerIntComp.NextRecord ()) { SiebelAccountIntComp.NewRecord (); SiebelAccountIntComp.SetCopySource (OracleCustomerIntComp); SiebelAccountIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_CUSTOMER_REF"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Status Code", "Error on Oracle Import"); SiebelAccountIntComp.SetFieldValue("EAI Sync Date", Timestamp()); SiebelAccountIntComp.CopyFieldValue ("EAI Sync Error Text","INTERFACE_STATUS"); } } else { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT,RA_CUSTOMERS_INTERFACE_ALL,Account - Get Oracle Customer Import Status (Oracle)")); } }

Account Interface Maps - Siebel Inbound
CopyIntegrationObjectData
function CopyIntegrationObjectData (OracleIntObject, SiebelIntObject) { // // Declare variables to hold the Oracle Primary Integration Component and // The Siebel Primary Integration Component // var OracleCustomerIntComp, SiebelAccountIntComp; // //Get the primary integration component from the Oracle Integration Object // OracleCustomerIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS_INTERFACE_ALL"); if (OracleCustomerIntComp.Exists ()) { // CUSTOMER INTERFACE SiebelAccountIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomerIntComp.NextRecord ()) { SiebelAccountIntComp.NewRecord (); SiebelAccountIntComp.SetCopySource (OracleCustomerIntComp); SiebelAccountIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_CUSTOMER_REF"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Status Code", "Error on Oracle Import"); SiebelAccountIntComp.SetFieldValue("EAI Sync Date", Timestamp()); SiebelAccountIntComp.CopyFieldValue ("EAI Sync Error Text","INTERFACE_STATUS"); } } else { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT,RA_CUSTOMERS_INTERFACE_ALL,Account - Get Oracle Customer Import Status (Oracle)")); } }

Account Interface Maps - Siebel Inbound
CopyIntegrationObjectData
function CopyIntegrationObjectData (OracleIntObject, SiebelIntObject) { // // Declare variables to hold the Oracle Primary Integration Component and // The Siebel Primary Integration Component // var OracleCustomerIntComp, SiebelAccountIntComp; // //Get the primary integration component from the Oracle Integration Object // OracleCustomerIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS_INTERFACE_ALL"); if (OracleCustomerIntComp.Exists ()) { // CUSTOMER INTERFACE SiebelAccountIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomerIntComp.NextRecord ()) { SiebelAccountIntComp.NewRecord (); SiebelAccountIntComp.SetCopySource (OracleCustomerIntComp); SiebelAccountIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_CUSTOMER_REF"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Status Code", "Error on Oracle Import"); SiebelAccountIntComp.SetFieldValue("EAI Sync Date", Timestamp()); SiebelAccountIntComp.CopyFieldValue ("EAI Sync Error Text","INTERFACE_STATUS"); } } else { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT,RA_CUSTOMERS_INTERFACE_ALL,Account - Get Oracle Customer Import Status (Oracle)")); } }

Account Interface Maps - Siebel Inbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Interface Maps - Siebel Inbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Interface Maps - Siebel Inbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Interface Maps - Siebel Inbound
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Interface Maps - Siebel Inbound
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Interface Maps - Siebel Inbound
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Interface Maps - Siebel Inbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Interface Maps - Siebel Inbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Interface Maps - Siebel Inbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Interface Maps - Siebel Inbound
UpsertSiebelAccount
function UpsertSiebelAccount (InputMsg, OutputMsg) { // // Declare a variable to hold the Siebel Integration Object. // var SiebelIntObject; // // Declare a variable to hold the Oracle Integration Object // var OracleIntObject; // // Get the Oracle Integration Object from the Input message // OracleIntObject = InputMsg.GetIntObj("Account - Get Oracle Customer Import Status (Oracle)"); // // Check the validity of the Oracle Integration Object. // if (OracleIntObject.Exists ()) { // // Create a new Siebel Integration Object on the Output Message. // SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle Customer Import Status (Siebel)"); // // Navigate through all the available instances in the Integration Object // while (OracleIntObject.NextInstance ()) { // // Create a new instance in the Oracle Integration Object // SiebelIntObject.NewInstance (); // // CopyFields is a user defined function which is written to copy all // the fields from the source to the target. // CopyIntegrationObjectData (OracleIntObject, SiebelIntObject); } } } ///~ End of CreateSiebelProduct function.

Account Interface Maps - Siebel Inbound
UpsertSiebelAccount
function UpsertSiebelAccount (InputMsg, OutputMsg) { // // Declare a variable to hold the Siebel Integration Object. // var SiebelIntObject; // // Declare a variable to hold the Oracle Integration Object // var OracleIntObject; // // Get the Oracle Integration Object from the Input message // OracleIntObject = InputMsg.GetIntObj("Account - Get Oracle Customer Import Status (Oracle)"); // // Check the validity of the Oracle Integration Object. // if (OracleIntObject.Exists ()) { // // Create a new Siebel Integration Object on the Output Message. // SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle Customer Import Status (Siebel)"); // // Navigate through all the available instances in the Integration Object // while (OracleIntObject.NextInstance ()) { // // Create a new instance in the Oracle Integration Object // SiebelIntObject.NewInstance (); // // CopyFields is a user defined function which is written to copy all // the fields from the source to the target. // CopyIntegrationObjectData (OracleIntObject, SiebelIntObject); } } } ///~ End of CreateSiebelProduct function.

Account Interface Maps - Siebel Inbound
UpsertSiebelAccount
function UpsertSiebelAccount (InputMsg, OutputMsg) { // // Declare a variable to hold the Siebel Integration Object. // var SiebelIntObject; // // Declare a variable to hold the Oracle Integration Object // var OracleIntObject; // // Get the Oracle Integration Object from the Input message // OracleIntObject = InputMsg.GetIntObj("Account - Get Oracle Customer Import Status (Oracle)"); // // Check the validity of the Oracle Integration Object. // if (OracleIntObject.Exists ()) { // // Create a new Siebel Integration Object on the Output Message. // SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle Customer Import Status (Siebel)"); // // Navigate through all the available instances in the Integration Object // while (OracleIntObject.NextInstance ()) { // // Create a new instance in the Oracle Integration Object // SiebelIntObject.NewInstance (); // // CopyFields is a user defined function which is written to copy all // the fields from the source to the target. // CopyIntegrationObjectData (OracleIntObject, SiebelIntObject); } } } ///~ End of CreateSiebelProduct function.

Account Interface Maps - Siebel Inbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 12/28/2000 // // DESCRIPTION // Javascript maps from Oracle Operating Unit to Siebel Organization // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Interface Maps - Siebel Inbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 12/28/2000 // // DESCRIPTION // Javascript maps from Oracle Operating Unit to Siebel Organization // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Interface Maps - Siebel Inbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 12/28/2000 // // DESCRIPTION // Javascript maps from Oracle Operating Unit to Siebel Organization // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Interface Maps - Siebel Inbound (Oracle11i)
CopyIntegrationObjectData
function CopyIntegrationObjectData (OracleIntObject, SiebelIntObject) { var OracleCustomerIntComp, SiebelAccountIntComp; OracleCustomerIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS_INTERFACE_ALL"); if (OracleCustomerIntComp.Exists ()) { // CUSTOMER INTERFACE SiebelAccountIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomerIntComp.NextRecord ()) { SiebelAccountIntComp.NewRecord (); SiebelAccountIntComp.SetCopySource (OracleCustomerIntComp); SiebelAccountIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_CUSTOMER_REF"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Status Code", "Error on Oracle Import"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Date", Timestamp()); SiebelAccountIntComp.CopyFieldValue ("EAI Sync Error Text","INTERFACE_STATUS"); } } else { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT,RA_CUSTOMERS_INTERFACE_ALL,Account - Get Oracle Customer Import Status (Oracle)")); } }

Account Interface Maps - Siebel Inbound (Oracle11i)
CopyIntegrationObjectData
function CopyIntegrationObjectData (OracleIntObject, SiebelIntObject) { var OracleCustomerIntComp, SiebelAccountIntComp; OracleCustomerIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS_INTERFACE_ALL"); if (OracleCustomerIntComp.Exists ()) { // CUSTOMER INTERFACE SiebelAccountIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomerIntComp.NextRecord ()) { SiebelAccountIntComp.NewRecord (); SiebelAccountIntComp.SetCopySource (OracleCustomerIntComp); SiebelAccountIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_CUSTOMER_REF"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Status Code", "Error on Oracle Import"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Date", Timestamp()); SiebelAccountIntComp.CopyFieldValue ("EAI Sync Error Text","INTERFACE_STATUS"); } } else { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT,RA_CUSTOMERS_INTERFACE_ALL,Account - Get Oracle Customer Import Status (Oracle)")); } }

Account Interface Maps - Siebel Inbound (Oracle11i)
CopyIntegrationObjectData
function CopyIntegrationObjectData (OracleIntObject, SiebelIntObject) { var OracleCustomerIntComp, SiebelAccountIntComp; OracleCustomerIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS_INTERFACE_ALL"); if (OracleCustomerIntComp.Exists ()) { // CUSTOMER INTERFACE SiebelAccountIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomerIntComp.NextRecord ()) { SiebelAccountIntComp.NewRecord (); SiebelAccountIntComp.SetCopySource (OracleCustomerIntComp); SiebelAccountIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_CUSTOMER_REF"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Status Code", "Error on Oracle Import"); SiebelAccountIntComp.SetFieldValue ("EAI Sync Date", Timestamp()); SiebelAccountIntComp.CopyFieldValue ("EAI Sync Error Text","INTERFACE_STATUS"); } } else { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT,RA_CUSTOMERS_INTERFACE_ALL,Account - Get Oracle Customer Import Status (Oracle)")); } }

Account Interface Maps - Siebel Inbound (Oracle11i)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Interface Maps - Siebel Inbound (Oracle11i)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Interface Maps - Siebel Inbound (Oracle11i)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Interface Maps - Siebel Inbound (Oracle11i)
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Interface Maps - Siebel Inbound (Oracle11i)
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Interface Maps - Siebel Inbound (Oracle11i)
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Interface Maps - Siebel Inbound (Oracle11i)
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Interface Maps - Siebel Inbound (Oracle11i)
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Interface Maps - Siebel Inbound (Oracle11i)
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Interface Maps - Siebel Inbound (Oracle11i)
UpsertSiebelAccount
function UpsertSiebelAccount (InputMsg, OutputMsg) { // // Declare a variable to hold the Siebel Integration Object. // var SiebelIntObject; // // Declare a variable to hold the Oracle Integration Object // var OracleIntObject; // // Get the Oracle Integration Object from the Input message // OracleIntObject = InputMsg.GetIntObj("Account - Get Oracle11i Customer Import Status (Oracle)"); // // Check the validity of the Oracle Integration Object. // if (OracleIntObject.Exists ()) { // // Create a new Siebel Integration Object on the Output Message. // SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle11i Customer Import Status (Siebel)"); // // Navigate through all the available instances in the Integration Object // while (OracleIntObject.NextInstance ()) { // // Create a new instance in the Oracle Integration Object // SiebelIntObject.NewInstance (); // // CopyFields is a user defined function which is written to copy all // the fields from the source to the target. // CopyIntegrationObjectData (OracleIntObject, SiebelIntObject); } } } ///~ End of CreateSiebelProduct function.

Account Interface Maps - Siebel Inbound (Oracle11i)
UpsertSiebelAccount
function UpsertSiebelAccount (InputMsg, OutputMsg) { // // Declare a variable to hold the Siebel Integration Object. // var SiebelIntObject; // // Declare a variable to hold the Oracle Integration Object // var OracleIntObject; // // Get the Oracle Integration Object from the Input message // OracleIntObject = InputMsg.GetIntObj("Account - Get Oracle11i Customer Import Status (Oracle)"); // // Check the validity of the Oracle Integration Object. // if (OracleIntObject.Exists ()) { // // Create a new Siebel Integration Object on the Output Message. // SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle11i Customer Import Status (Siebel)"); // // Navigate through all the available instances in the Integration Object // while (OracleIntObject.NextInstance ()) { // // Create a new instance in the Oracle Integration Object // SiebelIntObject.NewInstance (); // // CopyFields is a user defined function which is written to copy all // the fields from the source to the target. // CopyIntegrationObjectData (OracleIntObject, SiebelIntObject); } } } ///~ End of CreateSiebelProduct function.

Account Interface Maps - Siebel Inbound (Oracle11i)
UpsertSiebelAccount
function UpsertSiebelAccount (InputMsg, OutputMsg) { // // Declare a variable to hold the Siebel Integration Object. // var SiebelIntObject; // // Declare a variable to hold the Oracle Integration Object // var OracleIntObject; // // Get the Oracle Integration Object from the Input message // OracleIntObject = InputMsg.GetIntObj("Account - Get Oracle11i Customer Import Status (Oracle)"); // // Check the validity of the Oracle Integration Object. // if (OracleIntObject.Exists ()) { // // Create a new Siebel Integration Object on the Output Message. // SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle11i Customer Import Status (Siebel)"); // // Navigate through all the available instances in the Integration Object // while (OracleIntObject.NextInstance ()) { // // Create a new instance in the Oracle Integration Object // SiebelIntObject.NewInstance (); // // CopyFields is a user defined function which is written to copy all // the fields from the source to the target. // CopyIntegrationObjectData (OracleIntObject, SiebelIntObject); } } } ///~ End of CreateSiebelProduct function.

Account Maps - Siebel Inbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // DESCRIPTION // Javascript maps to Siebel Account from Oracle Customer // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Inbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // DESCRIPTION // Javascript maps to Siebel Account from Oracle Customer // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Inbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // DESCRIPTION // Javascript maps to Siebel Account from Oracle Customer // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Inbound
CopyFields
function CopyFields (OracleIntObject, SiebelIntObject) { var SiebelPrimIntComp, OraclePrimIntComp, OraclePhoneIntComp; var AccountStatusVM = EAIGetValueMap ("Oracle Account Status", "Siebel Inbound", "Active"); var CountryVM = EAIGetValueMap ("Oracle Country", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap ("Oracle Account Phone", "Siebel Inbound", "Main Phone Number"); var AddressPhoneVM = EAIGetValueMap ("Oracle Address Phone", "Siebel Inbound", "Phone Number"); var ContactPhoneVM = EAIGetValueMap ("Oracle Contact Phone", "Siebel Inbound", "Alternate Phone #"); var FreightVM = EAIGetValueMap ("Oracle Freight", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var ContactVM = EAIGetValueMap("Oracle Contact Title", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM = EAIGetValueMap("Oracle Account Category", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); OraclePrimIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS"); // // ACCOUNTS // if (OraclePrimIntComp.Exists ()) { SiebelPrimIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OraclePrimIntComp.NextRecord ()) { // Process delete operation if(ProcessDelete(OraclePrimIntComp)) continue; SiebelPrimIntComp.NewRecord (); var OracleAcctPhIntComp = OraclePrimIntComp.GetIntComp ("RA_PHONES"); SiebelPrimIntComp.SetCopySource (OraclePrimIntComp); // Set the opcode for this component SetOperationCode(SiebelPrimIntComp, OraclePrimIntComp); SiebelPrimIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); SiebelPrimIntComp.CopyFieldValue ("Name", "CUSTOMER_NAME"); SiebelPrimIntComp.CopyFieldValue ("CSN", "CUSTOMER_NUMBER"); SiebelPrimIntComp.SetFieldValue("EAI Sync Status Code", "Sync from Back Office"); SiebelPrimIntComp.SetFieldValue("EAI Sync Date", Timestamp()); SiebelPrimIntComp.SetFieldValue("EAI Sync Error Text",""); SiebelPrimIntComp.CopyFieldValue ("GSA Flag", "GSA_INDICATOR"); SiebelPrimIntComp.CopyFieldValue ("Home Page", "URL"); SiebelPrimIntComp.CopyFieldValue ("Price List Integration Id", "PRICE_LIST_ID"); SiebelPrimIntComp.SetFieldValue ("Freight Terms", FreightVM.Translate( OraclePrimIntComp.GetFieldValue ("FREIGHT_TERM"))); SiebelPrimIntComp.SetFieldValue ("Type", AccountCategoryVM.Translate ( OraclePrimIntComp.GetFieldValue ("CUSTOMER_CATEGORY_CODE"))); SiebelPrimIntComp.SetFieldValue ("Account Status", AccountStatusVM.Translate ( OraclePrimIntComp.GetFieldValue ("STATUS"))); // // ACCOUNT SYNONYM // var customerNamePhonetic = OraclePrimIntComp.GetFieldValue("CUSTOMER_NAME_PHONETIC").substring(0, 49); if(customerNamePhonetic != "") { // Create a new child integration component in the Siebel from // Primary integration Component var SiebelAccSynIntComp = SiebelPrimIntComp.CreateIntComp ("Account_Account Synonym"); SiebelAccSynIntComp.NewRecord (); SetOperationCode(SiebelAccSynIntComp, OraclePrimIntComp); SiebelAccSynIntComp.SetFieldValue ("Synonym", customerNamePhonetic); } // ACCOUNT SYNONYM // // ACCOUNT PHONES // if (OracleAcctPhIntComp.Exists ()) { while (OracleAcctPhIntComp.NextRecord ()) { var OraclePhStatus = OracleAcctPhIntComp.GetFieldValue ("STATUS"); var OraclePhPrimFlg = OracleAcctPhIntComp.GetFieldValue ("PRIMARY_FLAG"); var OraclePhAddr = OracleAcctPhIntComp.GetFieldValue ("ADDRESS_ID"); var OraclePhContact = OracleAcctPhIntComp.GetFieldValue ("CONTACT_ID"); // CR: 12-9X2JRV if (OraclePhStatus == "A" && OraclePhAddr == "" && OraclePhContact == "") TransformPhone (OracleAcctPhIntComp, SiebelPrimIntComp, AccountPhoneVM); } } // END ACCOUNT PHONES // // ADDRESSES // var OracleAddressIntComp = OraclePrimIntComp.GetIntComp ("RA_

Account Maps - Siebel Inbound
CopyFields
function CopyFields (OracleIntObject, SiebelIntObject) { var SiebelPrimIntComp, OraclePrimIntComp, OraclePhoneIntComp; var AccountStatusVM = EAIGetValueMap ("Oracle Account Status", "Siebel Inbound", "Active"); var CountryVM = EAIGetValueMap ("Oracle Country", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap ("Oracle Account Phone", "Siebel Inbound", "Main Phone Number"); var AddressPhoneVM = EAIGetValueMap ("Oracle Address Phone", "Siebel Inbound", "Phone Number"); var ContactPhoneVM = EAIGetValueMap ("Oracle Contact Phone", "Siebel Inbound", "Alternate Phone #"); var FreightVM = EAIGetValueMap ("Oracle Freight", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var ContactVM = EAIGetValueMap("Oracle Contact Title", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM = EAIGetValueMap("Oracle Account Category", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); OraclePrimIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS"); // // ACCOUNTS // if (OraclePrimIntComp.Exists ()) { SiebelPrimIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OraclePrimIntComp.NextRecord ()) { // Process delete operation if(ProcessDelete(OraclePrimIntComp)) continue; SiebelPrimIntComp.NewRecord (); var OracleAcctPhIntComp = OraclePrimIntComp.GetIntComp ("RA_PHONES"); SiebelPrimIntComp.SetCopySource (OraclePrimIntComp); // Set the opcode for this component SetOperationCode(SiebelPrimIntComp, OraclePrimIntComp); SiebelPrimIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); SiebelPrimIntComp.CopyFieldValue ("Name", "CUSTOMER_NAME"); SiebelPrimIntComp.CopyFieldValue ("CSN", "CUSTOMER_NUMBER"); SiebelPrimIntComp.SetFieldValue("EAI Sync Status Code", "Sync from Back Office"); SiebelPrimIntComp.SetFieldValue("EAI Sync Date", Timestamp()); SiebelPrimIntComp.SetFieldValue("EAI Sync Error Text",""); SiebelPrimIntComp.CopyFieldValue ("GSA Flag", "GSA_INDICATOR"); SiebelPrimIntComp.CopyFieldValue ("Home Page", "URL"); SiebelPrimIntComp.CopyFieldValue ("Price List Integration Id", "PRICE_LIST_ID"); SiebelPrimIntComp.SetFieldValue ("Freight Terms", FreightVM.Translate( OraclePrimIntComp.GetFieldValue ("FREIGHT_TERM"))); SiebelPrimIntComp.SetFieldValue ("Type", AccountCategoryVM.Translate ( OraclePrimIntComp.GetFieldValue ("CUSTOMER_CATEGORY_CODE"))); SiebelPrimIntComp.SetFieldValue ("Account Status", AccountStatusVM.Translate ( OraclePrimIntComp.GetFieldValue ("STATUS"))); // // ACCOUNT SYNONYM // var customerNamePhonetic = OraclePrimIntComp.GetFieldValue("CUSTOMER_NAME_PHONETIC").substring(0, 49); if(customerNamePhonetic != "") { // Create a new child integration component in the Siebel from // Primary integration Component var SiebelAccSynIntComp = SiebelPrimIntComp.CreateIntComp ("Account_Account Synonym"); SiebelAccSynIntComp.NewRecord (); SetOperationCode(SiebelAccSynIntComp, OraclePrimIntComp); SiebelAccSynIntComp.SetFieldValue ("Synonym", customerNamePhonetic); } // ACCOUNT SYNONYM // // ACCOUNT PHONES // if (OracleAcctPhIntComp.Exists ()) { while (OracleAcctPhIntComp.NextRecord ()) { var OraclePhStatus = OracleAcctPhIntComp.GetFieldValue ("STATUS"); var OraclePhPrimFlg = OracleAcctPhIntComp.GetFieldValue ("PRIMARY_FLAG"); var OraclePhAddr = OracleAcctPhIntComp.GetFieldValue ("ADDRESS_ID"); var OraclePhContact = OracleAcctPhIntComp.GetFieldValue ("CONTACT_ID"); // CR: 12-9X2JRV if (OraclePhStatus == "A" && OraclePhAddr == "" && OraclePhContact == "") TransformPhone (OracleAcctPhIntComp, SiebelPrimIntComp, AccountPhoneVM); } } // END ACCOUNT PHONES // // ADDRESSES // var OracleAddressIntComp = OraclePrimIntComp.GetIntComp ("RA_

Account Maps - Siebel Inbound
CopyFields
function CopyFields (OracleIntObject, SiebelIntObject) { var SiebelPrimIntComp, OraclePrimIntComp, OraclePhoneIntComp; var AccountStatusVM = EAIGetValueMap ("Oracle Account Status", "Siebel Inbound", "Active"); var CountryVM = EAIGetValueMap ("Oracle Country", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap ("Oracle Account Phone", "Siebel Inbound", "Main Phone Number"); var AddressPhoneVM = EAIGetValueMap ("Oracle Address Phone", "Siebel Inbound", "Phone Number"); var ContactPhoneVM = EAIGetValueMap ("Oracle Contact Phone", "Siebel Inbound", "Alternate Phone #"); var FreightVM = EAIGetValueMap ("Oracle Freight", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var ContactVM = EAIGetValueMap("Oracle Contact Title", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM = EAIGetValueMap("Oracle Account Category", "Siebel Inbound", EAIValueMap_NoEntry_RaiseError); OraclePrimIntComp = OracleIntObject.GetPrimaryIntComp ("RA_CUSTOMERS"); // // ACCOUNTS // if (OraclePrimIntComp.Exists ()) { SiebelPrimIntComp = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OraclePrimIntComp.NextRecord ()) { // Process delete operation if(ProcessDelete(OraclePrimIntComp)) continue; SiebelPrimIntComp.NewRecord (); var OracleAcctPhIntComp = OraclePrimIntComp.GetIntComp ("RA_PHONES"); SiebelPrimIntComp.SetCopySource (OraclePrimIntComp); // Set the opcode for this component SetOperationCode(SiebelPrimIntComp, OraclePrimIntComp); SiebelPrimIntComp.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); SiebelPrimIntComp.CopyFieldValue ("Name", "CUSTOMER_NAME"); SiebelPrimIntComp.CopyFieldValue ("CSN", "CUSTOMER_NUMBER"); SiebelPrimIntComp.SetFieldValue("EAI Sync Status Code", "Sync from Back Office"); SiebelPrimIntComp.SetFieldValue("EAI Sync Date", Timestamp()); SiebelPrimIntComp.SetFieldValue("EAI Sync Error Text",""); SiebelPrimIntComp.CopyFieldValue ("GSA Flag", "GSA_INDICATOR"); SiebelPrimIntComp.CopyFieldValue ("Home Page", "URL"); SiebelPrimIntComp.CopyFieldValue ("Price List Integration Id", "PRICE_LIST_ID"); SiebelPrimIntComp.SetFieldValue ("Freight Terms", FreightVM.Translate( OraclePrimIntComp.GetFieldValue ("FREIGHT_TERM"))); SiebelPrimIntComp.SetFieldValue ("Type", AccountCategoryVM.Translate ( OraclePrimIntComp.GetFieldValue ("CUSTOMER_CATEGORY_CODE"))); SiebelPrimIntComp.SetFieldValue ("Account Status", AccountStatusVM.Translate ( OraclePrimIntComp.GetFieldValue ("STATUS"))); // // ACCOUNT SYNONYM // var customerNamePhonetic = OraclePrimIntComp.GetFieldValue("CUSTOMER_NAME_PHONETIC").substring(0, 49); if(customerNamePhonetic != "") { // Create a new child integration component in the Siebel from // Primary integration Component var SiebelAccSynIntComp = SiebelPrimIntComp.CreateIntComp ("Account_Account Synonym"); SiebelAccSynIntComp.NewRecord (); SetOperationCode(SiebelAccSynIntComp, OraclePrimIntComp); SiebelAccSynIntComp.SetFieldValue ("Synonym", customerNamePhonetic); } // ACCOUNT SYNONYM // // ACCOUNT PHONES // if (OracleAcctPhIntComp.Exists ()) { while (OracleAcctPhIntComp.NextRecord ()) { var OraclePhStatus = OracleAcctPhIntComp.GetFieldValue ("STATUS"); var OraclePhPrimFlg = OracleAcctPhIntComp.GetFieldValue ("PRIMARY_FLAG"); var OraclePhAddr = OracleAcctPhIntComp.GetFieldValue ("ADDRESS_ID"); var OraclePhContact = OracleAcctPhIntComp.GetFieldValue ("CONTACT_ID"); // CR: 12-9X2JRV if (OraclePhStatus == "A" && OraclePhAddr == "" && OraclePhContact == "") TransformPhone (OracleAcctPhIntComp, SiebelPrimIntComp, AccountPhoneVM); } } // END ACCOUNT PHONES // // ADDRESSES // var OracleAddressIntComp = OraclePrimIntComp.GetIntComp ("RA_

Account Maps - Siebel Inbound
ProcessDelete
function ProcessDelete(OracleComp) { // If not a delete return false. // If delete (X or D) perform delete through COM interface. X indicates that // there should be a D at a lower level. // // For Accounts we expect deletes at SIE_CUSTOMER_PROFILE_AMOUNT only. // X RA_CUSTOMERS // D SIE_CUSTOMER_PROFILE_AMOUNT // // Phone Deletes are treated specially // We need to first figure out whether it's a Customer Phone, // Address Phone or a Contact Phone. var opCode; var childComp; opCode = OracleComp.GetFieldValue("SysOp"); if (opCode == "D") { // Delete of Discount not supported. EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_DELETION,RA_CUSTOMERS")); } else if (opCode == "X") { // Expect delete within account childComp = OracleComp.GetIntComp("SIE_CUSTOMER_PROFILE_AMOUNT"); if(childComp.Exists() && childComp.NextRecord()) { opCode = childComp.GetFieldValue("SysOp"); if (opCode == "D") { // Delete Credit Profile var BusObject = TheApplication().GetBusObject("Account"); var BComp = BusObject.GetBusComp("Account Credit Profile"); BComp.SetViewMode(3); BComp.ClearToQuery(); BComp.SetSearchSpec("Credit Control Area Code", childComp.GetFieldValue("CUSTOMER_PROFILE_AMOUNT_ID")); BComp.ExecuteQuery(); BComp.FirstRecord(); BComp.DeleteRecord(); BComp.WriteRecord(); return true; } else EAIRaiseError(TranslateMessage( "ORA_MSG_INVALID_SYSOP,"+opCode+",SIE_CUSTOMER_PROFILE_AMOUNT")); } else { //Phone delete processing childComp = OracleComp.GetIntComp("RA_PHONES"); if(!childComp.Exists() || !childComp.NextRecord()) { childComp = OracleComp.GetIntComp("RA_ADDRESSES_ALL"); if(childComp.Exists() && childComp.NextRecord()) { childComp = childComp.GetIntComp("RA_PHONES2"); if(!childComp.Exists() || !childComp.NextRecord()) { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT, RA_PHONES2, RA_CUSTOMERS")); } } else { //see if it's a contact phone childComp = OracleComp.GetIntComp("RA_CONTACTS"); if(childComp.Exists() && childComp.NextRecord()) { childComp = childComp.GetIntComp("RA_PHONES3"); if(!childComp.Exists() || !childComp.NextRecord()) { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT, RA_PHONES3, RA_CUSTOMERS")); } } }//end of contact phone check }//either address or contact phone opCode = childComp.GetFieldValue("SysOp"); //We still need to check what kind of phone it is //as the receiver may return an incorrect hierarchy //The parent comp is put in this column var SiebelBusComp; var ValueMapName; var TableName; //Get the parent type. var BusCompType = childComp.GetFieldValue("ROOT_TBL_PRI_KEY2"); if(BusCompType == 1) { SiebelBusComp = "Account"; ValueMapName = "Oracle Account Phone"; TableName = "RA_PHONE"; } else if(BusCompType == 2) { SiebelBusComp = "Business Address"; ValueMapName = "Oracle Address Phone"; TableName = "RA_PHONE2"; } else if(BusCompType == 3) { SiebelBusComp = "Contact"; ValueMapName = "Oracle Contact Phone"; TableName = "RA_PHONE3"; } else { /*Add this message EAIRaiseError(TranslateMessage( "ORA_MSG_INVALID_PHONE, "+BusCompType+""));*/ } if(opCode == "D") { var BusObject = TheApplication().GetBusObject("Account"); var BComp = BusObject.GetBusComp(SiebelBusComp); BComp.SetViewMode(3); BComp.ClearToQuery(); //assume that the receiver sets this from the //error message column. The phone type is put in this column. var AccountPhoneVM = EAIGetValueMap(ValueMapName, "Siebel Inbound"); //Get the Phone Type which is put in the //Error Message column of the notification tbl var type = childComp.GetFieldValue("ERROR_MESSAGE"); var SiebelColName = AccountPhoneVM.T

Account Maps - Siebel Inbound
ProcessDelete
function ProcessDelete(OracleComp) { // If not a delete return false. // If delete (X or D) perform delete through COM interface. X indicates that // there should be a D at a lower level. // // For Accounts we expect deletes at SIE_CUSTOMER_PROFILE_AMOUNT only. // X RA_CUSTOMERS // D SIE_CUSTOMER_PROFILE_AMOUNT // // Phone Deletes are treated specially // We need to first figure out whether it's a Customer Phone, // Address Phone or a Contact Phone. var opCode; var childComp; opCode = OracleComp.GetFieldValue("SysOp"); if (opCode == "D") { // Delete of Discount not supported. EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_DELETION,RA_CUSTOMERS")); } else if (opCode == "X") { // Expect delete within account childComp = OracleComp.GetIntComp("SIE_CUSTOMER_PROFILE_AMOUNT"); if(childComp.Exists() && childComp.NextRecord()) { opCode = childComp.GetFieldValue("SysOp"); if (opCode == "D") { // Delete Credit Profile var BusObject = TheApplication().GetBusObject("Account"); var BComp = BusObject.GetBusComp("Account Credit Profile"); BComp.SetViewMode(3); BComp.ClearToQuery(); BComp.SetSearchSpec("Credit Control Area Code", childComp.GetFieldValue("CUSTOMER_PROFILE_AMOUNT_ID")); BComp.ExecuteQuery(); BComp.FirstRecord(); BComp.DeleteRecord(); BComp.WriteRecord(); return true; } else EAIRaiseError(TranslateMessage( "ORA_MSG_INVALID_SYSOP,"+opCode+",SIE_CUSTOMER_PROFILE_AMOUNT")); } else { //Phone delete processing childComp = OracleComp.GetIntComp("RA_PHONES"); if(!childComp.Exists() || !childComp.NextRecord()) { childComp = OracleComp.GetIntComp("RA_ADDRESSES_ALL"); if(childComp.Exists() && childComp.NextRecord()) { childComp = childComp.GetIntComp("RA_PHONES2"); if(!childComp.Exists() || !childComp.NextRecord()) { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT, RA_PHONES2, RA_CUSTOMERS")); } } else { //see if it's a contact phone childComp = OracleComp.GetIntComp("RA_CONTACTS"); if(childComp.Exists() && childComp.NextRecord()) { childComp = childComp.GetIntComp("RA_PHONES3"); if(!childComp.Exists() || !childComp.NextRecord()) { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT, RA_PHONES3, RA_CUSTOMERS")); } } }//end of contact phone check }//either address or contact phone opCode = childComp.GetFieldValue("SysOp"); //We still need to check what kind of phone it is //as the receiver may return an incorrect hierarchy //The parent comp is put in this column var SiebelBusComp; var ValueMapName; var TableName; //Get the parent type. var BusCompType = childComp.GetFieldValue("ROOT_TBL_PRI_KEY2"); if(BusCompType == 1) { SiebelBusComp = "Account"; ValueMapName = "Oracle Account Phone"; TableName = "RA_PHONE"; } else if(BusCompType == 2) { SiebelBusComp = "Business Address"; ValueMapName = "Oracle Address Phone"; TableName = "RA_PHONE2"; } else if(BusCompType == 3) { SiebelBusComp = "Contact"; ValueMapName = "Oracle Contact Phone"; TableName = "RA_PHONE3"; } else { /*Add this message EAIRaiseError(TranslateMessage( "ORA_MSG_INVALID_PHONE, "+BusCompType+""));*/ } if(opCode == "D") { var BusObject = TheApplication().GetBusObject("Account"); var BComp = BusObject.GetBusComp(SiebelBusComp); BComp.SetViewMode(3); BComp.ClearToQuery(); //assume that the receiver sets this from the //error message column. The phone type is put in this column. var AccountPhoneVM = EAIGetValueMap(ValueMapName, "Siebel Inbound"); //Get the Phone Type which is put in the //Error Message column of the notification tbl var type = childComp.GetFieldValue("ERROR_MESSAGE"); var SiebelColName = AccountPhoneVM.T

Account Maps - Siebel Inbound
ProcessDelete
function ProcessDelete(OracleComp) { // If not a delete return false. // If delete (X or D) perform delete through COM interface. X indicates that // there should be a D at a lower level. // // For Accounts we expect deletes at SIE_CUSTOMER_PROFILE_AMOUNT only. // X RA_CUSTOMERS // D SIE_CUSTOMER_PROFILE_AMOUNT // // Phone Deletes are treated specially // We need to first figure out whether it's a Customer Phone, // Address Phone or a Contact Phone. var opCode; var childComp; opCode = OracleComp.GetFieldValue("SysOp"); if (opCode == "D") { // Delete of Discount not supported. EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_DELETION,RA_CUSTOMERS")); } else if (opCode == "X") { // Expect delete within account childComp = OracleComp.GetIntComp("SIE_CUSTOMER_PROFILE_AMOUNT"); if(childComp.Exists() && childComp.NextRecord()) { opCode = childComp.GetFieldValue("SysOp"); if (opCode == "D") { // Delete Credit Profile var BusObject = TheApplication().GetBusObject("Account"); var BComp = BusObject.GetBusComp("Account Credit Profile"); BComp.SetViewMode(3); BComp.ClearToQuery(); BComp.SetSearchSpec("Credit Control Area Code", childComp.GetFieldValue("CUSTOMER_PROFILE_AMOUNT_ID")); BComp.ExecuteQuery(); BComp.FirstRecord(); BComp.DeleteRecord(); BComp.WriteRecord(); return true; } else EAIRaiseError(TranslateMessage( "ORA_MSG_INVALID_SYSOP,"+opCode+",SIE_CUSTOMER_PROFILE_AMOUNT")); } else { //Phone delete processing childComp = OracleComp.GetIntComp("RA_PHONES"); if(!childComp.Exists() || !childComp.NextRecord()) { childComp = OracleComp.GetIntComp("RA_ADDRESSES_ALL"); if(childComp.Exists() && childComp.NextRecord()) { childComp = childComp.GetIntComp("RA_PHONES2"); if(!childComp.Exists() || !childComp.NextRecord()) { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT, RA_PHONES2, RA_CUSTOMERS")); } } else { //see if it's a contact phone childComp = OracleComp.GetIntComp("RA_CONTACTS"); if(childComp.Exists() && childComp.NextRecord()) { childComp = childComp.GetIntComp("RA_PHONES3"); if(!childComp.Exists() || !childComp.NextRecord()) { EAIRaiseError(TranslateMessage( "ORA_MSG_MISSING_COMPONENT, RA_PHONES3, RA_CUSTOMERS")); } } }//end of contact phone check }//either address or contact phone opCode = childComp.GetFieldValue("SysOp"); //We still need to check what kind of phone it is //as the receiver may return an incorrect hierarchy //The parent comp is put in this column var SiebelBusComp; var ValueMapName; var TableName; //Get the parent type. var BusCompType = childComp.GetFieldValue("ROOT_TBL_PRI_KEY2"); if(BusCompType == 1) { SiebelBusComp = "Account"; ValueMapName = "Oracle Account Phone"; TableName = "RA_PHONE"; } else if(BusCompType == 2) { SiebelBusComp = "Business Address"; ValueMapName = "Oracle Address Phone"; TableName = "RA_PHONE2"; } else if(BusCompType == 3) { SiebelBusComp = "Contact"; ValueMapName = "Oracle Contact Phone"; TableName = "RA_PHONE3"; } else { /*Add this message EAIRaiseError(TranslateMessage( "ORA_MSG_INVALID_PHONE, "+BusCompType+""));*/ } if(opCode == "D") { var BusObject = TheApplication().GetBusObject("Account"); var BComp = BusObject.GetBusComp(SiebelBusComp); BComp.SetViewMode(3); BComp.ClearToQuery(); //assume that the receiver sets this from the //error message column. The phone type is put in this column. var AccountPhoneVM = EAIGetValueMap(ValueMapName, "Siebel Inbound"); //Get the Phone Type which is put in the //Error Message column of the notification tbl var type = childComp.GetFieldValue("ERROR_MESSAGE"); var SiebelColName = AccountPhoneVM.T

Account Maps - Siebel Inbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Inbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Inbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Inbound
SetOperationCode
/** * Sets the operation code for this Siebel integration component */ function SetOperationCode(SiebelIntComp, OracleIntComp) { var opCode = OracleIntComp.GetFieldValue ("SysOp"); if(opCode == "D") SiebelIntComp.SetFieldValue ("operation", "delete"); else SiebelIntComp.SetFieldValue ("operation", "upsert"); }

Account Maps - Siebel Inbound
SetOperationCode
/** * Sets the operation code for this Siebel integration component */ function SetOperationCode(SiebelIntComp, OracleIntComp) { var opCode = OracleIntComp.GetFieldValue ("SysOp"); if(opCode == "D") SiebelIntComp.SetFieldValue ("operation", "delete"); else SiebelIntComp.SetFieldValue ("operation", "upsert"); }

Account Maps - Siebel Inbound
SetOperationCode
/** * Sets the operation code for this Siebel integration component */ function SetOperationCode(SiebelIntComp, OracleIntComp) { var opCode = OracleIntComp.GetFieldValue ("SysOp"); if(opCode == "D") SiebelIntComp.SetFieldValue ("operation", "delete"); else SiebelIntComp.SetFieldValue ("operation", "upsert"); }

Account Maps - Siebel Inbound
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Inbound
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Inbound
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Inbound
TransformOracleCustomer
function TransformOracleCustomer (InputMsg, OutputMsg) { var OracleIntObject, SiebelIntObject; OracleIntObject = InputMsg.GetIntObj ("Account - Get Oracle Customer (Oracle)"); SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get/Put Oracle Customer (Siebel)"); while (OracleIntObject.NextInstance ()) { SiebelIntObject.NewInstance (); CopyFields (OracleIntObject, SiebelIntObject); } }

Account Maps - Siebel Inbound
TransformOracleCustomer
function TransformOracleCustomer (InputMsg, OutputMsg) { var OracleIntObject, SiebelIntObject; OracleIntObject = InputMsg.GetIntObj ("Account - Get Oracle Customer (Oracle)"); SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get/Put Oracle Customer (Siebel)"); while (OracleIntObject.NextInstance ()) { SiebelIntObject.NewInstance (); CopyFields (OracleIntObject, SiebelIntObject); } }

Account Maps - Siebel Inbound
TransformOracleCustomer
function TransformOracleCustomer (InputMsg, OutputMsg) { var OracleIntObject, SiebelIntObject; OracleIntObject = InputMsg.GetIntObj ("Account - Get Oracle Customer (Oracle)"); SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get/Put Oracle Customer (Siebel)"); while (OracleIntObject.NextInstance ()) { SiebelIntObject.NewInstance (); CopyFields (OracleIntObject, SiebelIntObject); } }

Account Maps - Siebel Inbound
TransformPhone
function TransformPhone (OraclePhoneIntComp, SiebelIntComp, PhoneValueMap) { // Declare a variable to hold the Phone type. var PhoneType, SiebelPhoneField; // Get the Phone_Type field from Oracle. PhoneType = OraclePhoneIntComp.GetFieldValue("PHONE_TYPE"); // Use the value map to lookup the Phone field in the Siebel Integration Object. SiebelPhoneField = PhoneValueMap.Translate(PhoneType); if(SiebelPhoneField == "") { // Exception: Missing phone type EAIRaiseError (TranslateMessage( "ORA_MSG_MISSING_VALUE_MAPPING,"+PhoneType+",Oracle Account Phone")); } SiebelIntComp.SetFieldValue (SiebelPhoneField, OraclePhoneIntComp.GetFieldValue ("PHONE_NUMBER")); }

Account Maps - Siebel Inbound
TransformPhone
function TransformPhone (OraclePhoneIntComp, SiebelIntComp, PhoneValueMap) { // Declare a variable to hold the Phone type. var PhoneType, SiebelPhoneField; // Get the Phone_Type field from Oracle. PhoneType = OraclePhoneIntComp.GetFieldValue("PHONE_TYPE"); // Use the value map to lookup the Phone field in the Siebel Integration Object. SiebelPhoneField = PhoneValueMap.Translate(PhoneType); if(SiebelPhoneField == "") { // Exception: Missing phone type EAIRaiseError (TranslateMessage( "ORA_MSG_MISSING_VALUE_MAPPING,"+PhoneType+",Oracle Account Phone")); } SiebelIntComp.SetFieldValue (SiebelPhoneField, OraclePhoneIntComp.GetFieldValue ("PHONE_NUMBER")); }

Account Maps - Siebel Inbound
TransformPhone
function TransformPhone (OraclePhoneIntComp, SiebelIntComp, PhoneValueMap) { // Declare a variable to hold the Phone type. var PhoneType, SiebelPhoneField; // Get the Phone_Type field from Oracle. PhoneType = OraclePhoneIntComp.GetFieldValue("PHONE_TYPE"); // Use the value map to lookup the Phone field in the Siebel Integration Object. SiebelPhoneField = PhoneValueMap.Translate(PhoneType); if(SiebelPhoneField == "") { // Exception: Missing phone type EAIRaiseError (TranslateMessage( "ORA_MSG_MISSING_VALUE_MAPPING,"+PhoneType+",Oracle Account Phone")); } SiebelIntComp.SetFieldValue (SiebelPhoneField, OraclePhoneIntComp.GetFieldValue ("PHONE_NUMBER")); }

Account Maps - Siebel Inbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Inbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Inbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created by Richard Exley - November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Inbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 01/03/2001 // // DESCRIPTION // Javascript maps from Oracle11i Customer to Siebel Account // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Inbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 01/03/2001 // // DESCRIPTION // Javascript maps from Oracle11i Customer to Siebel Account // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Inbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 01/03/2001 // // DESCRIPTION // Javascript maps from Oracle11i Customer to Siebel Account // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Inbound (Oracle11i)
CopyFields
function CopyFields (OracleIntObject, SiebelIntObject) { var OracleCustomer, SiebelAccount; OracleCustomer = OracleIntObject.GetPrimaryIntComp ("HZ_CUST_ACCOUNTS"); if (OracleCustomer.Exists ()) { SiebelAccount = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomer.NextRecord ()) { // // ACCOUNTS // SiebelAccount.NewRecord (); SiebelAccount.SetCopySource (OracleCustomer); SetOperationCode(SiebelAccount, OracleCustomer); SiebelAccount.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); SiebelAccount.SetFieldValue ("EAI Sync Status Code", "Sync from Back Office"); SiebelAccount.SetFieldValue ("EAI Sync Date", Timestamp()); SiebelAccount.SetFieldValue ("EAI Sync Error Text",""); SiebelAccount.CopyFieldValue ("CSN", "ACCOUNT_NUMBER"); // // CONTACTS // var OracleCustContacts = OracleCustomer.GetIntComp ("SIE_CONTACTS_V"); if (OracleCustContacts.Exists ()) { var SiebelAccountContacts = SiebelAccount.CreateIntComp ("Contact"); while (OracleCustContacts.NextRecord ()) { SiebelAccountContacts.NewRecord (); SiebelAccountContacts.SetCopySource (OracleCustContacts); SetOperationCode(SiebelAccountContacts, OracleCustContacts); // For all the contacts passed from Oracle to Siebel // make the current account as the contact's primary account SiebelAccountContacts.SetFieldValue("Account Integration Id", OracleCustomer.GetFieldValue("ORIG_SYSTEM_REFERENCE")); SiebelAccountContacts.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); } } // // ADDRESSES // var OracleCustSites = OracleCustomer.GetIntComp ("SIE_ADDRESSES_V"); if (OracleCustSites.Exists ()) { var SiebelAccountAddresses = SiebelAccount.CreateIntComp ("Business Address"); while (OracleCustSites.NextRecord ()) { SiebelAccountAddresses.NewRecord (); SiebelAccountAddresses.SetCopySource (OracleCustSites); SetOperationCode(SiebelAccountAddresses, OracleCustSites); SiebelAccountAddresses.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); } } } ///~ while(OracleAccount.NextRecord()) } ///~ if(OracleAccount.Exists()) else { EAIRaiseError (TranslateMessage ( "ORA_MSG_MISSING_COMPONENT,HZ_CUST_ACCOUNTS,Account - Get Oracle11i Customer (Oracle)")); } }

Account Maps - Siebel Inbound (Oracle11i)
CopyFields
function CopyFields (OracleIntObject, SiebelIntObject) { var OracleCustomer, SiebelAccount; OracleCustomer = OracleIntObject.GetPrimaryIntComp ("HZ_CUST_ACCOUNTS"); if (OracleCustomer.Exists ()) { SiebelAccount = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomer.NextRecord ()) { // // ACCOUNTS // SiebelAccount.NewRecord (); SiebelAccount.SetCopySource (OracleCustomer); SetOperationCode(SiebelAccount, OracleCustomer); SiebelAccount.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); SiebelAccount.SetFieldValue ("EAI Sync Status Code", "Sync from Back Office"); SiebelAccount.SetFieldValue ("EAI Sync Date", Timestamp()); SiebelAccount.SetFieldValue ("EAI Sync Error Text",""); SiebelAccount.CopyFieldValue ("CSN", "ACCOUNT_NUMBER"); // // CONTACTS // var OracleCustContacts = OracleCustomer.GetIntComp ("SIE_CONTACTS_V"); if (OracleCustContacts.Exists ()) { var SiebelAccountContacts = SiebelAccount.CreateIntComp ("Contact"); while (OracleCustContacts.NextRecord ()) { SiebelAccountContacts.NewRecord (); SiebelAccountContacts.SetCopySource (OracleCustContacts); SetOperationCode(SiebelAccountContacts, OracleCustContacts); // For all the contacts passed from Oracle to Siebel // make the current account as the contact's primary account SiebelAccountContacts.SetFieldValue("Account Integration Id", OracleCustomer.GetFieldValue("ORIG_SYSTEM_REFERENCE")); SiebelAccountContacts.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); } } // // ADDRESSES // var OracleCustSites = OracleCustomer.GetIntComp ("SIE_ADDRESSES_V"); if (OracleCustSites.Exists ()) { var SiebelAccountAddresses = SiebelAccount.CreateIntComp ("Business Address"); while (OracleCustSites.NextRecord ()) { SiebelAccountAddresses.NewRecord (); SiebelAccountAddresses.SetCopySource (OracleCustSites); SetOperationCode(SiebelAccountAddresses, OracleCustSites); SiebelAccountAddresses.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); } } } ///~ while(OracleAccount.NextRecord()) } ///~ if(OracleAccount.Exists()) else { EAIRaiseError (TranslateMessage ( "ORA_MSG_MISSING_COMPONENT,HZ_CUST_ACCOUNTS,Account - Get Oracle11i Customer (Oracle)")); } }

Account Maps - Siebel Inbound (Oracle11i)
CopyFields
function CopyFields (OracleIntObject, SiebelIntObject) { var OracleCustomer, SiebelAccount; OracleCustomer = OracleIntObject.GetPrimaryIntComp ("HZ_CUST_ACCOUNTS"); if (OracleCustomer.Exists ()) { SiebelAccount = SiebelIntObject.CreatePrimaryIntComp ("Account"); while (OracleCustomer.NextRecord ()) { // // ACCOUNTS // SiebelAccount.NewRecord (); SiebelAccount.SetCopySource (OracleCustomer); SetOperationCode(SiebelAccount, OracleCustomer); SiebelAccount.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); SiebelAccount.SetFieldValue ("EAI Sync Status Code", "Sync from Back Office"); SiebelAccount.SetFieldValue ("EAI Sync Date", Timestamp()); SiebelAccount.SetFieldValue ("EAI Sync Error Text",""); SiebelAccount.CopyFieldValue ("CSN", "ACCOUNT_NUMBER"); // // CONTACTS // var OracleCustContacts = OracleCustomer.GetIntComp ("SIE_CONTACTS_V"); if (OracleCustContacts.Exists ()) { var SiebelAccountContacts = SiebelAccount.CreateIntComp ("Contact"); while (OracleCustContacts.NextRecord ()) { SiebelAccountContacts.NewRecord (); SiebelAccountContacts.SetCopySource (OracleCustContacts); SetOperationCode(SiebelAccountContacts, OracleCustContacts); // For all the contacts passed from Oracle to Siebel // make the current account as the contact's primary account SiebelAccountContacts.SetFieldValue("Account Integration Id", OracleCustomer.GetFieldValue("ORIG_SYSTEM_REFERENCE")); SiebelAccountContacts.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); } } // // ADDRESSES // var OracleCustSites = OracleCustomer.GetIntComp ("SIE_ADDRESSES_V"); if (OracleCustSites.Exists ()) { var SiebelAccountAddresses = SiebelAccount.CreateIntComp ("Business Address"); while (OracleCustSites.NextRecord ()) { SiebelAccountAddresses.NewRecord (); SiebelAccountAddresses.SetCopySource (OracleCustSites); SetOperationCode(SiebelAccountAddresses, OracleCustSites); SiebelAccountAddresses.CopyFieldValue ("Integration Id", "ORIG_SYSTEM_REFERENCE"); } } } ///~ while(OracleAccount.NextRecord()) } ///~ if(OracleAccount.Exists()) else { EAIRaiseError (TranslateMessage ( "ORA_MSG_MISSING_COMPONENT,HZ_CUST_ACCOUNTS,Account - Get Oracle11i Customer (Oracle)")); } }

Account Maps - Siebel Inbound (Oracle11i)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Inbound (Oracle11i)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Inbound (Oracle11i)
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Inbound (Oracle11i)
SetOperationCode
function SetOperationCode(SiebelIntComp, OracleIntComp) { var opCode = OracleIntComp.GetFieldValue ("SysOp"); if(opCode == "D") SiebelIntComp.SetFieldValue ("operation", "delete"); else SiebelIntComp.SetFieldValue ("operation", "upsert"); }

Account Maps - Siebel Inbound (Oracle11i)
SetOperationCode
function SetOperationCode(SiebelIntComp, OracleIntComp) { var opCode = OracleIntComp.GetFieldValue ("SysOp"); if(opCode == "D") SiebelIntComp.SetFieldValue ("operation", "delete"); else SiebelIntComp.SetFieldValue ("operation", "upsert"); }

Account Maps - Siebel Inbound (Oracle11i)
SetOperationCode
function SetOperationCode(SiebelIntComp, OracleIntComp) { var opCode = OracleIntComp.GetFieldValue ("SysOp"); if(opCode == "D") SiebelIntComp.SetFieldValue ("operation", "delete"); else SiebelIntComp.SetFieldValue ("operation", "upsert"); }

Account Maps - Siebel Inbound (Oracle11i)
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Inbound (Oracle11i)
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Inbound (Oracle11i)
Timestamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Inbound (Oracle11i)
TransformOracleCustomer
function TransformOracleCustomer (InputMsg, OutputMsg) { // Declare a variable to hold the Oracle Integration Object var OracleIntObject; // Declare a variable to hold the Siebel Integration Object. var SiebelIntObject; // Get the Oracle Integration Object from the Input message OracleIntObject = InputMsg.GetIntObj ("Account - Get Oracle11i Customer (Oracle)"); // Check the validity of the Oracle Integration Object. if (OracleIntObject.Exists ()) { // Go ahead and create a new Siebel Integration Object on the Output Message. SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle11i Customer (Siebel)"); // Navigate through all the available instances in the Integration Object while (OracleIntObject.NextInstance ()) { // Create a new instance in the Siebel Integration Object SiebelIntObject.NewInstance (); // CopyFields is again a user defined function which is written to copy all // the fields from the source to the target. CopyFields (OracleIntObject, SiebelIntObject); } } ///~ if (OracleIntObject.Exists ()) else { //Raise an exception saying that the Oracle Integration Object was not found in // the Input message EAIRaiseError (TranslateMessage ("ORA_MSG_EMPTY,Account - Get Oracle11i Customer (Oracle)")); } ///~ else } ///~ End of TransformOracleCustomer function.

Account Maps - Siebel Inbound (Oracle11i)
TransformOracleCustomer
function TransformOracleCustomer (InputMsg, OutputMsg) { // Declare a variable to hold the Oracle Integration Object var OracleIntObject; // Declare a variable to hold the Siebel Integration Object. var SiebelIntObject; // Get the Oracle Integration Object from the Input message OracleIntObject = InputMsg.GetIntObj ("Account - Get Oracle11i Customer (Oracle)"); // Check the validity of the Oracle Integration Object. if (OracleIntObject.Exists ()) { // Go ahead and create a new Siebel Integration Object on the Output Message. SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle11i Customer (Siebel)"); // Navigate through all the available instances in the Integration Object while (OracleIntObject.NextInstance ()) { // Create a new instance in the Siebel Integration Object SiebelIntObject.NewInstance (); // CopyFields is again a user defined function which is written to copy all // the fields from the source to the target. CopyFields (OracleIntObject, SiebelIntObject); } } ///~ if (OracleIntObject.Exists ()) else { //Raise an exception saying that the Oracle Integration Object was not found in // the Input message EAIRaiseError (TranslateMessage ("ORA_MSG_EMPTY,Account - Get Oracle11i Customer (Oracle)")); } ///~ else } ///~ End of TransformOracleCustomer function.

Account Maps - Siebel Inbound (Oracle11i)
TransformOracleCustomer
function TransformOracleCustomer (InputMsg, OutputMsg) { // Declare a variable to hold the Oracle Integration Object var OracleIntObject; // Declare a variable to hold the Siebel Integration Object. var SiebelIntObject; // Get the Oracle Integration Object from the Input message OracleIntObject = InputMsg.GetIntObj ("Account - Get Oracle11i Customer (Oracle)"); // Check the validity of the Oracle Integration Object. if (OracleIntObject.Exists ()) { // Go ahead and create a new Siebel Integration Object on the Output Message. SiebelIntObject = OutputMsg.CreateIntObj ("Account - Get Oracle11i Customer (Siebel)"); // Navigate through all the available instances in the Integration Object while (OracleIntObject.NextInstance ()) { // Create a new instance in the Siebel Integration Object SiebelIntObject.NewInstance (); // CopyFields is again a user defined function which is written to copy all // the fields from the source to the target. CopyFields (OracleIntObject, SiebelIntObject); } } ///~ if (OracleIntObject.Exists ()) else { //Raise an exception saying that the Oracle Integration Object was not found in // the Input message EAIRaiseError (TranslateMessage ("ORA_MSG_EMPTY,Account - Get Oracle11i Customer (Oracle)")); } ///~ else } ///~ End of TransformOracleCustomer function.

Account Maps - Siebel Inbound (Oracle11i)
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Inbound (Oracle11i)
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Inbound (Oracle11i)
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Outbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // DESCRIPTION // Javascript maps from Siebel Account to Oracle Customer // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Outbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // DESCRIPTION // Javascript maps from Siebel Account to Oracle Customer // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Outbound
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // DESCRIPTION // Javascript maps from Siebel Account to Oracle Customer // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Outbound
AccountLoopBack
// Set Integration Id for new accounts, contacts or addresses created in Siebel function AccountLoopBack(InputMsg, OutputMsg) { var SiebelObjectIn, SiebelObjectOut; var AccCompIn, AccCompOut, AddrCompIn, AddrCompOut, ConCompIn, ConCompOut; var AccSharedID, AccIntegId, AddrSharedID, AddrIntegId, ConSharedID, ConIntegId; /* Check the validation message */ var ValidationMessage = InputMsg.GetArgument("Validation Message"); if (ValidationMessage != "") { EAIRaiseError(TranslateMessage(ValidationMessage)); } SiebelObjectIn = InputMsg.GetIntObj("Account - Get/Put Oracle Customer (Siebel)"); if (SiebelObjectIn.Exists ()) { SiebelObjectOut = OutputMsg.CreateIntObj("Account - Get/Put Oracle Customer (Siebel)"); while (SiebelObjectIn.NextInstance ()) { SiebelObjectOut.NewInstance (); AccCompIn = SiebelObjectIn.GetPrimaryIntComp ("Account"); // // ACCOUNT // if (AccCompIn.Exists ()) { AccCompOut = SiebelObjectOut.CreatePrimaryIntComp("Account"); while (AccCompIn.NextRecord ()) { AccCompOut.SetCopySource (AccCompIn); AccCompOut.NewRecord (); AccCompOut.CopyFieldValue("Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Date", Timestamp()); AccIntegId = AccCompIn.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccCompOut.CopyFieldValue("Integration Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Creating in Back Office"); } else { // Existing Account AccCompOut.CopyFieldValue("Integration Id", "Integration Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Sync To Back Office"); } AccCompOut.SetFieldValue ("EAI Sync Error Text",""); AccCompOut.SetFieldValue ("EAI Sync Date", Timestamp()); // // ACCOUNT ADDRESSES // var AddrCompIn = AccCompIn.GetIntComp ("Business Address"); if (AddrCompIn.Exists()) { AddrCompOut = AccCompOut.CreateIntComp("Business Address"); while (AddrCompIn.NextRecord()) { AddrCompOut.SetCopySource (AddrCompIn); AddrCompOut.NewRecord(); AddrCompOut.CopyFieldValue("Id", "Id"); AddrIntegId = AddrCompIn.GetFieldValue( "Integration Id"); if (AddrIntegId == "" || AddrIntegId == null) { // New Address AddrCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Address AddrCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT ADDRESSES // // ACCOUNT CONTACTS // var ConCompIn = AccCompIn.GetIntComp ("Contact"); if (ConCompIn.Exists()) { ConCompOut = AccCompOut.CreateIntComp("Contact"); while (ConCompIn.NextRecord()) { ConCompOut.SetCopySource (ConCompIn); ConCompOut.NewRecord(); ConCompOut.CopyFieldValue("Id", "Id"); ConIntegId = ConCompIn.GetFieldValue( "Integration Id"); if (ConIntegId == "" || ConIntegId == null) { // New Contact ConCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Contact ConCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT CONTACTS } } // END ACCOUNT } } else { EAIRaiseError (TranslateMessage ( "ORA_MSG_EMPTY,Account - Get/Put Oracle Customer (Siebel)")); } }

Account Maps - Siebel Outbound
AccountLoopBack
// Set Integration Id for new accounts, contacts or addresses created in Siebel function AccountLoopBack(InputMsg, OutputMsg) { var SiebelObjectIn, SiebelObjectOut; var AccCompIn, AccCompOut, AddrCompIn, AddrCompOut, ConCompIn, ConCompOut; var AccSharedID, AccIntegId, AddrSharedID, AddrIntegId, ConSharedID, ConIntegId; /* Check the validation message */ var ValidationMessage = InputMsg.GetArgument("Validation Message"); if (ValidationMessage != "") { EAIRaiseError(TranslateMessage(ValidationMessage)); } SiebelObjectIn = InputMsg.GetIntObj("Account - Get/Put Oracle Customer (Siebel)"); if (SiebelObjectIn.Exists ()) { SiebelObjectOut = OutputMsg.CreateIntObj("Account - Get/Put Oracle Customer (Siebel)"); while (SiebelObjectIn.NextInstance ()) { SiebelObjectOut.NewInstance (); AccCompIn = SiebelObjectIn.GetPrimaryIntComp ("Account"); // // ACCOUNT // if (AccCompIn.Exists ()) { AccCompOut = SiebelObjectOut.CreatePrimaryIntComp("Account"); while (AccCompIn.NextRecord ()) { AccCompOut.SetCopySource (AccCompIn); AccCompOut.NewRecord (); AccCompOut.CopyFieldValue("Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Date", Timestamp()); AccIntegId = AccCompIn.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccCompOut.CopyFieldValue("Integration Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Creating in Back Office"); } else { // Existing Account AccCompOut.CopyFieldValue("Integration Id", "Integration Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Sync To Back Office"); } AccCompOut.SetFieldValue ("EAI Sync Error Text",""); AccCompOut.SetFieldValue ("EAI Sync Date", Timestamp()); // // ACCOUNT ADDRESSES // var AddrCompIn = AccCompIn.GetIntComp ("Business Address"); if (AddrCompIn.Exists()) { AddrCompOut = AccCompOut.CreateIntComp("Business Address"); while (AddrCompIn.NextRecord()) { AddrCompOut.SetCopySource (AddrCompIn); AddrCompOut.NewRecord(); AddrCompOut.CopyFieldValue("Id", "Id"); AddrIntegId = AddrCompIn.GetFieldValue( "Integration Id"); if (AddrIntegId == "" || AddrIntegId == null) { // New Address AddrCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Address AddrCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT ADDRESSES // // ACCOUNT CONTACTS // var ConCompIn = AccCompIn.GetIntComp ("Contact"); if (ConCompIn.Exists()) { ConCompOut = AccCompOut.CreateIntComp("Contact"); while (ConCompIn.NextRecord()) { ConCompOut.SetCopySource (ConCompIn); ConCompOut.NewRecord(); ConCompOut.CopyFieldValue("Id", "Id"); ConIntegId = ConCompIn.GetFieldValue( "Integration Id"); if (ConIntegId == "" || ConIntegId == null) { // New Contact ConCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Contact ConCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT CONTACTS } } // END ACCOUNT } } else { EAIRaiseError (TranslateMessage ( "ORA_MSG_EMPTY,Account - Get/Put Oracle Customer (Siebel)")); } }

Account Maps - Siebel Outbound
AccountLoopBack
// Set Integration Id for new accounts, contacts or addresses created in Siebel function AccountLoopBack(InputMsg, OutputMsg) { var SiebelObjectIn, SiebelObjectOut; var AccCompIn, AccCompOut, AddrCompIn, AddrCompOut, ConCompIn, ConCompOut; var AccSharedID, AccIntegId, AddrSharedID, AddrIntegId, ConSharedID, ConIntegId; /* Check the validation message */ var ValidationMessage = InputMsg.GetArgument("Validation Message"); if (ValidationMessage != "") { EAIRaiseError(TranslateMessage(ValidationMessage)); } SiebelObjectIn = InputMsg.GetIntObj("Account - Get/Put Oracle Customer (Siebel)"); if (SiebelObjectIn.Exists ()) { SiebelObjectOut = OutputMsg.CreateIntObj("Account - Get/Put Oracle Customer (Siebel)"); while (SiebelObjectIn.NextInstance ()) { SiebelObjectOut.NewInstance (); AccCompIn = SiebelObjectIn.GetPrimaryIntComp ("Account"); // // ACCOUNT // if (AccCompIn.Exists ()) { AccCompOut = SiebelObjectOut.CreatePrimaryIntComp("Account"); while (AccCompIn.NextRecord ()) { AccCompOut.SetCopySource (AccCompIn); AccCompOut.NewRecord (); AccCompOut.CopyFieldValue("Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Date", Timestamp()); AccIntegId = AccCompIn.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccCompOut.CopyFieldValue("Integration Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Creating in Back Office"); } else { // Existing Account AccCompOut.CopyFieldValue("Integration Id", "Integration Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Sync To Back Office"); } AccCompOut.SetFieldValue ("EAI Sync Error Text",""); AccCompOut.SetFieldValue ("EAI Sync Date", Timestamp()); // // ACCOUNT ADDRESSES // var AddrCompIn = AccCompIn.GetIntComp ("Business Address"); if (AddrCompIn.Exists()) { AddrCompOut = AccCompOut.CreateIntComp("Business Address"); while (AddrCompIn.NextRecord()) { AddrCompOut.SetCopySource (AddrCompIn); AddrCompOut.NewRecord(); AddrCompOut.CopyFieldValue("Id", "Id"); AddrIntegId = AddrCompIn.GetFieldValue( "Integration Id"); if (AddrIntegId == "" || AddrIntegId == null) { // New Address AddrCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Address AddrCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT ADDRESSES // // ACCOUNT CONTACTS // var ConCompIn = AccCompIn.GetIntComp ("Contact"); if (ConCompIn.Exists()) { ConCompOut = AccCompOut.CreateIntComp("Contact"); while (ConCompIn.NextRecord()) { ConCompOut.SetCopySource (ConCompIn); ConCompOut.NewRecord(); ConCompOut.CopyFieldValue("Id", "Id"); ConIntegId = ConCompIn.GetFieldValue( "Integration Id"); if (ConIntegId == "" || ConIntegId == null) { // New Contact ConCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Contact ConCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT CONTACTS } } // END ACCOUNT } } else { EAIRaiseError (TranslateMessage ( "ORA_MSG_EMPTY,Account - Get/Put Oracle Customer (Siebel)")); } }

Account Maps - Siebel Outbound
CopyAddressInfo
function CopyAddressInfo (OracleCustComp, SiebelAddressIntComp, CountryVM, AddrSharedID) { OracleCustComp.SetCopySource (SiebelAddressIntComp); OracleCustComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleCustComp.CopyFieldValue ("ADDRESS1", "Street Address"); OracleCustComp.CopyFieldValue ("ADDRESS2", "Street Address 2"); OracleCustComp.CopyFieldValue ("CITY", "City"); OracleCustComp.CopyFieldValue ("STATE", "State"); OracleCustComp.CopyFieldValue ("PROVINCE", "Province"); OracleCustComp.CopyFieldValue ("COUNTY", "County"); OracleCustComp.CopyFieldValue ("POSTAL_CODE", "Postal Code"); OracleCustComp.CopyFieldValue ("ORG_ID", "Organization Integration Id"); var CountryVal = SiebelAddressIntComp.GetFieldValue("Country"); if ( CountryVal != "" ) { OracleCustComp.SetFieldValue ("COUNTRY", CountryVM.Translate ( SiebelAddressIntComp.GetFieldValue ("Country"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_COUNTRY, NULL")); } }

Account Maps - Siebel Outbound
CopyAddressInfo
function CopyAddressInfo (OracleCustComp, SiebelAddressIntComp, CountryVM, AddrSharedID) { OracleCustComp.SetCopySource (SiebelAddressIntComp); OracleCustComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleCustComp.CopyFieldValue ("ADDRESS1", "Street Address"); OracleCustComp.CopyFieldValue ("ADDRESS2", "Street Address 2"); OracleCustComp.CopyFieldValue ("CITY", "City"); OracleCustComp.CopyFieldValue ("STATE", "State"); OracleCustComp.CopyFieldValue ("PROVINCE", "Province"); OracleCustComp.CopyFieldValue ("COUNTY", "County"); OracleCustComp.CopyFieldValue ("POSTAL_CODE", "Postal Code"); OracleCustComp.CopyFieldValue ("ORG_ID", "Organization Integration Id"); var CountryVal = SiebelAddressIntComp.GetFieldValue("Country"); if ( CountryVal != "" ) { OracleCustComp.SetFieldValue ("COUNTRY", CountryVM.Translate ( SiebelAddressIntComp.GetFieldValue ("Country"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_COUNTRY, NULL")); } }

Account Maps - Siebel Outbound
CopyAddressInfo
function CopyAddressInfo (OracleCustComp, SiebelAddressIntComp, CountryVM, AddrSharedID) { OracleCustComp.SetCopySource (SiebelAddressIntComp); OracleCustComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleCustComp.CopyFieldValue ("ADDRESS1", "Street Address"); OracleCustComp.CopyFieldValue ("ADDRESS2", "Street Address 2"); OracleCustComp.CopyFieldValue ("CITY", "City"); OracleCustComp.CopyFieldValue ("STATE", "State"); OracleCustComp.CopyFieldValue ("PROVINCE", "Province"); OracleCustComp.CopyFieldValue ("COUNTY", "County"); OracleCustComp.CopyFieldValue ("POSTAL_CODE", "Postal Code"); OracleCustComp.CopyFieldValue ("ORG_ID", "Organization Integration Id"); var CountryVal = SiebelAddressIntComp.GetFieldValue("Country"); if ( CountryVal != "" ) { OracleCustComp.SetFieldValue ("COUNTRY", CountryVM.Translate ( SiebelAddressIntComp.GetFieldValue ("Country"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_COUNTRY, NULL")); } }

Account Maps - Siebel Outbound
CopyContactInfo
function CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID) { OracleContactIntComp.NewRecord(); OracleContactIntComp.SetCopySource (SiebelContactIntComp); OracleContactIntComp.SetFieldValue ("operation", "upsert"); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_TELEPHONE_REF", ""); OracleContactIntComp.SetFieldValue ("INSERT_UPDATE_FLAG",ContactInsUpdFlag); OracleContactIntComp.SetFieldValue ("CONTACT_TITLE", ContactTitleVM.Translate (SiebelContactIntComp.GetFieldValue ("M/M"))); OracleContactIntComp.SetFieldValue ("CONTACT_JOB_TITLE", SiebelContactIntComp.GetFieldValue("Job Title").substring(0,49)); OracleContactIntComp.CopyFieldValue ("CONTACT_LAST_NAME", "Last Name"); OracleContactIntComp.SetFieldValue ("CONTACT_FIRST_NAME", SiebelContactIntComp.GetFieldValue("First Name").substring(0,39)); OracleContactIntComp.CopyFieldValue ("SEX_CODE","M/F"); OracleContactIntComp.CopyFieldValue ("EMAIL_ADDRESS", "Email Address"); OracleContactIntComp.CopyFieldValue ("MAIL_STOP", "Mail Stop"); OracleContactIntComp.SetFieldValue ("ORG_ID", ""); OracleContactIntComp.SetFieldValue ("CREATION_DATE", SiebelContactIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue ("LAST_UPDATE_DATE", SiebelContactIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound
CopyContactInfo
function CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID) { OracleContactIntComp.NewRecord(); OracleContactIntComp.SetCopySource (SiebelContactIntComp); OracleContactIntComp.SetFieldValue ("operation", "upsert"); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_TELEPHONE_REF", ""); OracleContactIntComp.SetFieldValue ("INSERT_UPDATE_FLAG",ContactInsUpdFlag); OracleContactIntComp.SetFieldValue ("CONTACT_TITLE", ContactTitleVM.Translate (SiebelContactIntComp.GetFieldValue ("M/M"))); OracleContactIntComp.SetFieldValue ("CONTACT_JOB_TITLE", SiebelContactIntComp.GetFieldValue("Job Title").substring(0,49)); OracleContactIntComp.CopyFieldValue ("CONTACT_LAST_NAME", "Last Name"); OracleContactIntComp.SetFieldValue ("CONTACT_FIRST_NAME", SiebelContactIntComp.GetFieldValue("First Name").substring(0,39)); OracleContactIntComp.CopyFieldValue ("SEX_CODE","M/F"); OracleContactIntComp.CopyFieldValue ("EMAIL_ADDRESS", "Email Address"); OracleContactIntComp.CopyFieldValue ("MAIL_STOP", "Mail Stop"); OracleContactIntComp.SetFieldValue ("ORG_ID", ""); OracleContactIntComp.SetFieldValue ("CREATION_DATE", SiebelContactIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue ("LAST_UPDATE_DATE", SiebelContactIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound
CopyContactInfo
function CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID) { OracleContactIntComp.NewRecord(); OracleContactIntComp.SetCopySource (SiebelContactIntComp); OracleContactIntComp.SetFieldValue ("operation", "upsert"); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_TELEPHONE_REF", ""); OracleContactIntComp.SetFieldValue ("INSERT_UPDATE_FLAG",ContactInsUpdFlag); OracleContactIntComp.SetFieldValue ("CONTACT_TITLE", ContactTitleVM.Translate (SiebelContactIntComp.GetFieldValue ("M/M"))); OracleContactIntComp.SetFieldValue ("CONTACT_JOB_TITLE", SiebelContactIntComp.GetFieldValue("Job Title").substring(0,49)); OracleContactIntComp.CopyFieldValue ("CONTACT_LAST_NAME", "Last Name"); OracleContactIntComp.SetFieldValue ("CONTACT_FIRST_NAME", SiebelContactIntComp.GetFieldValue("First Name").substring(0,39)); OracleContactIntComp.CopyFieldValue ("SEX_CODE","M/F"); OracleContactIntComp.CopyFieldValue ("EMAIL_ADDRESS", "Email Address"); OracleContactIntComp.CopyFieldValue ("MAIL_STOP", "Mail Stop"); OracleContactIntComp.SetFieldValue ("ORG_ID", ""); OracleContactIntComp.SetFieldValue ("CREATION_DATE", SiebelContactIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue ("LAST_UPDATE_DATE", SiebelContactIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound
CopyContactPhoneInfo
function CopyContactPhoneInfo(SiebelAccountIntComp, SiebelAddressIntComp, SiebelContactIntComp,OracleContactIntComp, ContactInsUpdFlag, ContactTitleVM, ContactPhoneVM, AccSharedID, ConSharedID) { var PhoneFields = new Array("Cellular Phone #", "Fax Phone #", "Home Phone #", "Work Phone #", "Alternate Phone #", "Assistant Phone #"); var PhoneNumber, PhoneType; for ( var i = 0; i < PhoneFields.length; i++ ) { PhoneNumber = SiebelContactIntComp.GetFieldValue (PhoneFields[i]).substring(0,24); if (PhoneNumber != "") { // Fetch the Phone Type from Contact VM PhoneType = ContactPhoneVM.Translate(PhoneFields[i]); // Copy the Contact details first CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID); // Copy the Phone details CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, ContactInsUpdFlag, PhoneNumber, AccSharedID, "", ConSharedID); } } }

Account Maps - Siebel Outbound
CopyContactPhoneInfo
function CopyContactPhoneInfo(SiebelAccountIntComp, SiebelAddressIntComp, SiebelContactIntComp,OracleContactIntComp, ContactInsUpdFlag, ContactTitleVM, ContactPhoneVM, AccSharedID, ConSharedID) { var PhoneFields = new Array("Cellular Phone #", "Fax Phone #", "Home Phone #", "Work Phone #", "Alternate Phone #", "Assistant Phone #"); var PhoneNumber, PhoneType; for ( var i = 0; i < PhoneFields.length; i++ ) { PhoneNumber = SiebelContactIntComp.GetFieldValue (PhoneFields[i]).substring(0,24); if (PhoneNumber != "") { // Fetch the Phone Type from Contact VM PhoneType = ContactPhoneVM.Translate(PhoneFields[i]); // Copy the Contact details first CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID); // Copy the Phone details CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, ContactInsUpdFlag, PhoneNumber, AccSharedID, "", ConSharedID); } } }

Account Maps - Siebel Outbound
CopyContactPhoneInfo
function CopyContactPhoneInfo(SiebelAccountIntComp, SiebelAddressIntComp, SiebelContactIntComp,OracleContactIntComp, ContactInsUpdFlag, ContactTitleVM, ContactPhoneVM, AccSharedID, ConSharedID) { var PhoneFields = new Array("Cellular Phone #", "Fax Phone #", "Home Phone #", "Work Phone #", "Alternate Phone #", "Assistant Phone #"); var PhoneNumber, PhoneType; for ( var i = 0; i < PhoneFields.length; i++ ) { PhoneNumber = SiebelContactIntComp.GetFieldValue (PhoneFields[i]).substring(0,24); if (PhoneNumber != "") { // Fetch the Phone Type from Contact VM PhoneType = ContactPhoneVM.Translate(PhoneFields[i]); // Copy the Contact details first CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID); // Copy the Phone details CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, ContactInsUpdFlag, PhoneNumber, AccSharedID, "", ConSharedID); } } }

Account Maps - Siebel Outbound
CopyCustomerInfo
function CopyCustomerInfo(OracleCustomerComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID) { OracleCustomerComp.SetCopySource (SiebelAccountIntComp); OracleCustomerComp.SetFieldValue ("operation", "upsert"); OracleCustomerComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleCustomerComp.SetFieldValue ("SITE_USE_CODE", ""); OracleCustomerComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleCustomerComp.SetFieldValue ("CUSTOMER_NAME", SiebelAccountIntComp.GetFieldValue("Name").substring(0,49)); OracleCustomerComp.SetFieldValue ("CUSTOMER_TYPE", CusType); OracleCustomerComp.CopyFieldValue ("URL", "Home Page"); var CustomerTypeVal = SiebelAccountIntComp.GetFieldValue ("Type"); if ( CustomerTypeVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_CATEGORY_CODE", AccountCategoryVM.Translate (SiebelAccountIntComp.GetFieldValue ("Type"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_CUST_CATEGORY, NULL")); } var CustomerStatusVal = SiebelAccountIntComp.GetFieldValue ("Account Status"); if ( CustomerStatusVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_STATUS", AccountStatusVM.Translate ( SiebelAccountIntComp.GetFieldValue ("Account Status"))); } else { EAIRaiseError(TranslateMessage ("ORA_MSG_INVALID_CUST_STATUS, null")); } OracleCustomerComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleCustomerComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound
CopyCustomerInfo
function CopyCustomerInfo(OracleCustomerComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID) { OracleCustomerComp.SetCopySource (SiebelAccountIntComp); OracleCustomerComp.SetFieldValue ("operation", "upsert"); OracleCustomerComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleCustomerComp.SetFieldValue ("SITE_USE_CODE", ""); OracleCustomerComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleCustomerComp.SetFieldValue ("CUSTOMER_NAME", SiebelAccountIntComp.GetFieldValue("Name").substring(0,49)); OracleCustomerComp.SetFieldValue ("CUSTOMER_TYPE", CusType); OracleCustomerComp.CopyFieldValue ("URL", "Home Page"); var CustomerTypeVal = SiebelAccountIntComp.GetFieldValue ("Type"); if ( CustomerTypeVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_CATEGORY_CODE", AccountCategoryVM.Translate (SiebelAccountIntComp.GetFieldValue ("Type"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_CUST_CATEGORY, NULL")); } var CustomerStatusVal = SiebelAccountIntComp.GetFieldValue ("Account Status"); if ( CustomerStatusVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_STATUS", AccountStatusVM.Translate ( SiebelAccountIntComp.GetFieldValue ("Account Status"))); } else { EAIRaiseError(TranslateMessage ("ORA_MSG_INVALID_CUST_STATUS, null")); } OracleCustomerComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleCustomerComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound
CopyCustomerInfo
function CopyCustomerInfo(OracleCustomerComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID) { OracleCustomerComp.SetCopySource (SiebelAccountIntComp); OracleCustomerComp.SetFieldValue ("operation", "upsert"); OracleCustomerComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleCustomerComp.SetFieldValue ("SITE_USE_CODE", ""); OracleCustomerComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleCustomerComp.SetFieldValue ("CUSTOMER_NAME", SiebelAccountIntComp.GetFieldValue("Name").substring(0,49)); OracleCustomerComp.SetFieldValue ("CUSTOMER_TYPE", CusType); OracleCustomerComp.CopyFieldValue ("URL", "Home Page"); var CustomerTypeVal = SiebelAccountIntComp.GetFieldValue ("Type"); if ( CustomerTypeVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_CATEGORY_CODE", AccountCategoryVM.Translate (SiebelAccountIntComp.GetFieldValue ("Type"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_CUST_CATEGORY, NULL")); } var CustomerStatusVal = SiebelAccountIntComp.GetFieldValue ("Account Status"); if ( CustomerStatusVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_STATUS", AccountStatusVM.Translate ( SiebelAccountIntComp.GetFieldValue ("Account Status"))); } else { EAIRaiseError(TranslateMessage ("ORA_MSG_INVALID_CUST_STATUS, null")); } OracleCustomerComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleCustomerComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound
CopyFields
function CopyFields (SiebelIntObject, OracleIntObject, OutputMsg) { // Declare variables to hold the Primary Integration Components var SiebelAccountIntComp, OracleCustomerIntComp; // Variables to hold the Oracle Contact and Oracle Profile integration Components. var OracleContactIntComp, OracleProfileIntComp; // Declare Shared ID's and misc. variables var AccSharedID, AccIntegId, InsertUpdateFlag, AddrSharedID, AddrIntegId, AddrInsUpdFlag, AddressCount, ConSharedID, ConIntegId, ContactInsUpdFlag, PhoneNumber, PhoneType, PhoneField; // Customer Type should either External("E") or Internal("I") at oracle side var CusType = "R"; var ProfileClass = "Default"; var CreditHold = "N"; // Open the EAI Value Map for Account here. var CountryVM = EAIGetValueMap("Oracle Country", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountStatusVM = EAIGetValueMap("Oracle Account Status", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap("Oracle Account Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AddressPhoneVM = EAIGetValueMap("Oracle Address Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactPhoneVM = EAIGetValueMap("Oracle Contact Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM= EAIGetValueMap("Oracle Account Category", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactTitleVM = EAIGetValueMap("Oracle Contact Title", "Siebel Outbound"); //Get the primary integration component from the Siebel Integration Object SiebelAccountIntComp = SiebelIntObject.GetPrimaryIntComp ("Account"); // If the Primary Integration Component is valid, then go ahead with the copying process // Else raise an error message. if (SiebelAccountIntComp.Exists ()) { // Create the Oracle Integration Components OracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); // Navigate through all the available records in the Siebel primary integration component while (SiebelAccountIntComp.NextRecord ()) { // Create a new record in the Oracle Primary Integration Object OracleCustomerIntComp.NewRecord (); OracleContactIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CONTACT_PHONES_INT_ALL"); OracleProfileIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CUSTOMER_PROFILES_INT_ALL"); // // ACCOUNT // AccIntegId = SiebelAccountIntComp.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccSharedID = SiebelAccountIntComp.GetFieldValue("Id"); InsertUpdateFlag = "I"; } else { // Existing Account AccSharedID = AccIntegId; InsertUpdateFlag = "U"; } OutputMsg.SetArgument("ObjectIntegrationId", AccSharedID); // set values in SIE_CUSTOMERS_INTERFACE_ALL CopyCustomerInfo(OracleCustomerIntComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); // set values in SIE_CUSTOMER_PROFILES_INT_ALL // Inserting a profile class for the Account in SIE_CUSTOMER_PROFILES_INT_ALL if (InsertUpdateFlag == "I") { OracleProfileIntComp.NewRecord(); CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, ""); } // Set the copy source to SiebelAccountIntComp OracleContactIntComp.SetCopySource (SiebelAccountIntComp); PhoneField = "Main Phone Number"; PhoneNumber = SiebelAccountIntComp.GetFieldValue(PhoneField).substring(0,24); if (PhoneNumber != "") { OracleContactIntComp.NewRecord(); PhoneType = AccountPhoneVM.Translate(PhoneField); // Call the function CopyPhoneInfo to copy the common fields. CopyPhoneInfo (OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag, PhoneNumber,

Account Maps - Siebel Outbound
CopyFields
function CopyFields (SiebelIntObject, OracleIntObject, OutputMsg) { // Declare variables to hold the Primary Integration Components var SiebelAccountIntComp, OracleCustomerIntComp; // Variables to hold the Oracle Contact and Oracle Profile integration Components. var OracleContactIntComp, OracleProfileIntComp; // Declare Shared ID's and misc. variables var AccSharedID, AccIntegId, InsertUpdateFlag, AddrSharedID, AddrIntegId, AddrInsUpdFlag, AddressCount, ConSharedID, ConIntegId, ContactInsUpdFlag, PhoneNumber, PhoneType, PhoneField; // Customer Type should either External("E") or Internal("I") at oracle side var CusType = "R"; var ProfileClass = "Default"; var CreditHold = "N"; // Open the EAI Value Map for Account here. var CountryVM = EAIGetValueMap("Oracle Country", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountStatusVM = EAIGetValueMap("Oracle Account Status", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap("Oracle Account Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AddressPhoneVM = EAIGetValueMap("Oracle Address Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactPhoneVM = EAIGetValueMap("Oracle Contact Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM= EAIGetValueMap("Oracle Account Category", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactTitleVM = EAIGetValueMap("Oracle Contact Title", "Siebel Outbound"); //Get the primary integration component from the Siebel Integration Object SiebelAccountIntComp = SiebelIntObject.GetPrimaryIntComp ("Account"); // If the Primary Integration Component is valid, then go ahead with the copying process // Else raise an error message. if (SiebelAccountIntComp.Exists ()) { // Create the Oracle Integration Components OracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); // Navigate through all the available records in the Siebel primary integration component while (SiebelAccountIntComp.NextRecord ()) { // Create a new record in the Oracle Primary Integration Object OracleCustomerIntComp.NewRecord (); OracleContactIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CONTACT_PHONES_INT_ALL"); OracleProfileIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CUSTOMER_PROFILES_INT_ALL"); // // ACCOUNT // AccIntegId = SiebelAccountIntComp.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccSharedID = SiebelAccountIntComp.GetFieldValue("Id"); InsertUpdateFlag = "I"; } else { // Existing Account AccSharedID = AccIntegId; InsertUpdateFlag = "U"; } OutputMsg.SetArgument("ObjectIntegrationId", AccSharedID); // set values in SIE_CUSTOMERS_INTERFACE_ALL CopyCustomerInfo(OracleCustomerIntComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); // set values in SIE_CUSTOMER_PROFILES_INT_ALL // Inserting a profile class for the Account in SIE_CUSTOMER_PROFILES_INT_ALL if (InsertUpdateFlag == "I") { OracleProfileIntComp.NewRecord(); CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, ""); } // Set the copy source to SiebelAccountIntComp OracleContactIntComp.SetCopySource (SiebelAccountIntComp); PhoneField = "Main Phone Number"; PhoneNumber = SiebelAccountIntComp.GetFieldValue(PhoneField).substring(0,24); if (PhoneNumber != "") { OracleContactIntComp.NewRecord(); PhoneType = AccountPhoneVM.Translate(PhoneField); // Call the function CopyPhoneInfo to copy the common fields. CopyPhoneInfo (OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag, PhoneNumber,

Account Maps - Siebel Outbound
CopyFields
function CopyFields (SiebelIntObject, OracleIntObject, OutputMsg) { // Declare variables to hold the Primary Integration Components var SiebelAccountIntComp, OracleCustomerIntComp; // Variables to hold the Oracle Contact and Oracle Profile integration Components. var OracleContactIntComp, OracleProfileIntComp; // Declare Shared ID's and misc. variables var AccSharedID, AccIntegId, InsertUpdateFlag, AddrSharedID, AddrIntegId, AddrInsUpdFlag, AddressCount, ConSharedID, ConIntegId, ContactInsUpdFlag, PhoneNumber, PhoneType, PhoneField; // Customer Type should either External("E") or Internal("I") at oracle side var CusType = "R"; var ProfileClass = "Default"; var CreditHold = "N"; // Open the EAI Value Map for Account here. var CountryVM = EAIGetValueMap("Oracle Country", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountStatusVM = EAIGetValueMap("Oracle Account Status", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap("Oracle Account Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AddressPhoneVM = EAIGetValueMap("Oracle Address Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactPhoneVM = EAIGetValueMap("Oracle Contact Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM= EAIGetValueMap("Oracle Account Category", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactTitleVM = EAIGetValueMap("Oracle Contact Title", "Siebel Outbound"); //Get the primary integration component from the Siebel Integration Object SiebelAccountIntComp = SiebelIntObject.GetPrimaryIntComp ("Account"); // If the Primary Integration Component is valid, then go ahead with the copying process // Else raise an error message. if (SiebelAccountIntComp.Exists ()) { // Create the Oracle Integration Components OracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); // Navigate through all the available records in the Siebel primary integration component while (SiebelAccountIntComp.NextRecord ()) { // Create a new record in the Oracle Primary Integration Object OracleCustomerIntComp.NewRecord (); OracleContactIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CONTACT_PHONES_INT_ALL"); OracleProfileIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CUSTOMER_PROFILES_INT_ALL"); // // ACCOUNT // AccIntegId = SiebelAccountIntComp.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccSharedID = SiebelAccountIntComp.GetFieldValue("Id"); InsertUpdateFlag = "I"; } else { // Existing Account AccSharedID = AccIntegId; InsertUpdateFlag = "U"; } OutputMsg.SetArgument("ObjectIntegrationId", AccSharedID); // set values in SIE_CUSTOMERS_INTERFACE_ALL CopyCustomerInfo(OracleCustomerIntComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); // set values in SIE_CUSTOMER_PROFILES_INT_ALL // Inserting a profile class for the Account in SIE_CUSTOMER_PROFILES_INT_ALL if (InsertUpdateFlag == "I") { OracleProfileIntComp.NewRecord(); CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, ""); } // Set the copy source to SiebelAccountIntComp OracleContactIntComp.SetCopySource (SiebelAccountIntComp); PhoneField = "Main Phone Number"; PhoneNumber = SiebelAccountIntComp.GetFieldValue(PhoneField).substring(0,24); if (PhoneNumber != "") { OracleContactIntComp.NewRecord(); PhoneType = AccountPhoneVM.Translate(PhoneField); // Call the function CopyPhoneInfo to copy the common fields. CopyPhoneInfo (OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag, PhoneNumber,

Account Maps - Siebel Outbound
CopyPhoneInfo
function CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag, PhoneNumber, AccSharedID, AddrSharedID, ConSharedID) { OracleContactIntComp.SetFieldValue("operation", "upsert"); OracleContactIntComp.SetFieldValue("TELEPHONE", PhoneNumber); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_TELEPHONE_REF", AccSharedID+":"+AddrSharedID+":"+ConSharedID+":"+PhoneType); OracleContactIntComp.SetFieldValue("TELEPHONE_TYPE", PhoneType); OracleContactIntComp.SetFieldValue("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleContactIntComp.SetFieldValue("CREATION_DATE", SiebelAccountIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue("LAST_UPDATE_DATE", SiebelAccountIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound
CopyPhoneInfo
function CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag, PhoneNumber, AccSharedID, AddrSharedID, ConSharedID) { OracleContactIntComp.SetFieldValue("operation", "upsert"); OracleContactIntComp.SetFieldValue("TELEPHONE", PhoneNumber); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_TELEPHONE_REF", AccSharedID+":"+AddrSharedID+":"+ConSharedID+":"+PhoneType); OracleContactIntComp.SetFieldValue("TELEPHONE_TYPE", PhoneType); OracleContactIntComp.SetFieldValue("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleContactIntComp.SetFieldValue("CREATION_DATE", SiebelAccountIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue("LAST_UPDATE_DATE", SiebelAccountIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound
CopyPhoneInfo
function CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag, PhoneNumber, AccSharedID, AddrSharedID, ConSharedID) { OracleContactIntComp.SetFieldValue("operation", "upsert"); OracleContactIntComp.SetFieldValue("TELEPHONE", PhoneNumber); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_TELEPHONE_REF", AccSharedID+":"+AddrSharedID+":"+ConSharedID+":"+PhoneType); OracleContactIntComp.SetFieldValue("TELEPHONE_TYPE", PhoneType); OracleContactIntComp.SetFieldValue("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleContactIntComp.SetFieldValue("CREATION_DATE", SiebelAccountIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue("LAST_UPDATE_DATE", SiebelAccountIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound
CopyProfileInfo
function CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, AddrSharedID) { OracleProfileIntComp.SetCopySource(SiebelAccountIntComp); OracleProfileIntComp.SetFieldValue ("operation", "upsert"); OracleProfileIntComp.SetFieldValue ("CUSTOMER_PROFILE_CLASS_NAME", ProfileClass); OracleProfileIntComp.SetFieldValue ("CREDIT_HOLD", CreditHold); OracleProfileIntComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleProfileIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleProfileIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleProfileIntComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleProfileIntComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleProfileIntComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound
CopyProfileInfo
function CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, AddrSharedID) { OracleProfileIntComp.SetCopySource(SiebelAccountIntComp); OracleProfileIntComp.SetFieldValue ("operation", "upsert"); OracleProfileIntComp.SetFieldValue ("CUSTOMER_PROFILE_CLASS_NAME", ProfileClass); OracleProfileIntComp.SetFieldValue ("CREDIT_HOLD", CreditHold); OracleProfileIntComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleProfileIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleProfileIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleProfileIntComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleProfileIntComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleProfileIntComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound
CopyProfileInfo
function CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, AddrSharedID) { OracleProfileIntComp.SetCopySource(SiebelAccountIntComp); OracleProfileIntComp.SetFieldValue ("operation", "upsert"); OracleProfileIntComp.SetFieldValue ("CUSTOMER_PROFILE_CLASS_NAME", ProfileClass); OracleProfileIntComp.SetFieldValue ("CREDIT_HOLD", CreditHold); OracleProfileIntComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleProfileIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleProfileIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleProfileIntComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleProfileIntComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleProfileIntComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound
CopySiteUseInfo
function CopySiteUseInfo (OracleCustomerIntComp, OracleProfileIntComp, SiebelAccountIntComp, SiebelAddressIntComp, AccountStatusVM, CountryVM, AccountCategoryVM, InsertUpdateFlag, OracleIntObject, AccSharedID, AddrSharedID) { var AddrSharedID; var SiteUseList = new Array(); var PrimarySiteUseList = new Array(); var SiteUseCount = 0; var NewOracleCustomerIntComp; // Get the Address & Address Integration Id var AddrId = SiebelAddressIntComp.GetFieldValue ("Id"); var AddrIntId = SiebelAddressIntComp.GetFieldValue ("Integration Id"); var BillToSiteUse = null, ShipToSiteUse = null, GeneralSiteUse = null; var CusType = "R"; var ProfileClass = "Default"; var CreditHold = "N"; if (AddrIntId == "" || AddrIntId == null) { // New Address AddrSharedID = AddrId; } else { // Existing Address so nothing to do // (We don't support changing site uses) return; } if (SiebelAddressIntComp.GetFieldValue ("Bill Address Flag") == "Y") { SiteUseList[SiteUseCount] = "BILL_TO"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Bill To Address Id")) ? "Y" : "N" } if (SiebelAddressIntComp.GetFieldValue ("Ship Address Flag") == "Y") { SiteUseList[SiteUseCount] = "SHIP_TO"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Ship To Address Id")) ? "Y" : "N" } if (SiebelAddressIntComp.GetFieldValue ("Main Address Flag") == "Y") { SiteUseList[SiteUseCount] = "GENERAL"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Address Id")) ? "Y" : "N" } for ( var i = 0; i < SiteUseList.length; i++ ) { if (SiteUseList[i] == "BILL_TO") { // Create new profile for BILL_TO OracleProfileIntComp.NewRecord(); // Copy the Address Id from the Address Integration Component CopyProfileInfo ( OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, "I", AccSharedID, AddrSharedID); } if (i > 0) { // Need new customer interface record OracleIntObject.NewInstance (); NewOracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); NewOracleCustomerIntComp.NewRecord (); CopyCustomerInfo(NewOracleCustomerIntComp, SiebelAccountIntComp, "I", CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); CopyAddressInfo (NewOracleCustomerIntComp, SiebelAddressIntComp, CountryVM, AddrSharedID); NewOracleCustomerIntComp.SetFieldValue ("SITE_USE_CODE", SiteUseList[i]); NewOracleCustomerIntComp.SetFieldValue ("PRIMARY_SITE_USE_FLAG", PrimarySiteUseList[i]); } else { // Use existing customer interface record OracleCustomerIntComp.SetFieldValue ("SITE_USE_CODE", SiteUseList[i]); OracleCustomerIntComp.SetFieldValue ("INSERT_UPDATE_FLAG", "I"); OracleCustomerIntComp.SetFieldValue ("PRIMARY_SITE_USE_FLAG", PrimarySiteUseList[i]); } } }

Account Maps - Siebel Outbound
CopySiteUseInfo
function CopySiteUseInfo (OracleCustomerIntComp, OracleProfileIntComp, SiebelAccountIntComp, SiebelAddressIntComp, AccountStatusVM, CountryVM, AccountCategoryVM, InsertUpdateFlag, OracleIntObject, AccSharedID, AddrSharedID) { var AddrSharedID; var SiteUseList = new Array(); var PrimarySiteUseList = new Array(); var SiteUseCount = 0; var NewOracleCustomerIntComp; // Get the Address & Address Integration Id var AddrId = SiebelAddressIntComp.GetFieldValue ("Id"); var AddrIntId = SiebelAddressIntComp.GetFieldValue ("Integration Id"); var BillToSiteUse = null, ShipToSiteUse = null, GeneralSiteUse = null; var CusType = "R"; var ProfileClass = "Default"; var CreditHold = "N"; if (AddrIntId == "" || AddrIntId == null) { // New Address AddrSharedID = AddrId; } else { // Existing Address so nothing to do // (We don't support changing site uses) return; } if (SiebelAddressIntComp.GetFieldValue ("Bill Address Flag") == "Y") { SiteUseList[SiteUseCount] = "BILL_TO"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Bill To Address Id")) ? "Y" : "N" } if (SiebelAddressIntComp.GetFieldValue ("Ship Address Flag") == "Y") { SiteUseList[SiteUseCount] = "SHIP_TO"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Ship To Address Id")) ? "Y" : "N" } if (SiebelAddressIntComp.GetFieldValue ("Main Address Flag") == "Y") { SiteUseList[SiteUseCount] = "GENERAL"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Address Id")) ? "Y" : "N" } for ( var i = 0; i < SiteUseList.length; i++ ) { if (SiteUseList[i] == "BILL_TO") { // Create new profile for BILL_TO OracleProfileIntComp.NewRecord(); // Copy the Address Id from the Address Integration Component CopyProfileInfo ( OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, "I", AccSharedID, AddrSharedID); } if (i > 0) { // Need new customer interface record OracleIntObject.NewInstance (); NewOracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); NewOracleCustomerIntComp.NewRecord (); CopyCustomerInfo(NewOracleCustomerIntComp, SiebelAccountIntComp, "I", CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); CopyAddressInfo (NewOracleCustomerIntComp, SiebelAddressIntComp, CountryVM, AddrSharedID); NewOracleCustomerIntComp.SetFieldValue ("SITE_USE_CODE", SiteUseList[i]); NewOracleCustomerIntComp.SetFieldValue ("PRIMARY_SITE_USE_FLAG", PrimarySiteUseList[i]); } else { // Use existing customer interface record OracleCustomerIntComp.SetFieldValue ("SITE_USE_CODE", SiteUseList[i]); OracleCustomerIntComp.SetFieldValue ("INSERT_UPDATE_FLAG", "I"); OracleCustomerIntComp.SetFieldValue ("PRIMARY_SITE_USE_FLAG", PrimarySiteUseList[i]); } } }

Account Maps - Siebel Outbound
CopySiteUseInfo
function CopySiteUseInfo (OracleCustomerIntComp, OracleProfileIntComp, SiebelAccountIntComp, SiebelAddressIntComp, AccountStatusVM, CountryVM, AccountCategoryVM, InsertUpdateFlag, OracleIntObject, AccSharedID, AddrSharedID) { var AddrSharedID; var SiteUseList = new Array(); var PrimarySiteUseList = new Array(); var SiteUseCount = 0; var NewOracleCustomerIntComp; // Get the Address & Address Integration Id var AddrId = SiebelAddressIntComp.GetFieldValue ("Id"); var AddrIntId = SiebelAddressIntComp.GetFieldValue ("Integration Id"); var BillToSiteUse = null, ShipToSiteUse = null, GeneralSiteUse = null; var CusType = "R"; var ProfileClass = "Default"; var CreditHold = "N"; if (AddrIntId == "" || AddrIntId == null) { // New Address AddrSharedID = AddrId; } else { // Existing Address so nothing to do // (We don't support changing site uses) return; } if (SiebelAddressIntComp.GetFieldValue ("Bill Address Flag") == "Y") { SiteUseList[SiteUseCount] = "BILL_TO"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Bill To Address Id")) ? "Y" : "N" } if (SiebelAddressIntComp.GetFieldValue ("Ship Address Flag") == "Y") { SiteUseList[SiteUseCount] = "SHIP_TO"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Ship To Address Id")) ? "Y" : "N" } if (SiebelAddressIntComp.GetFieldValue ("Main Address Flag") == "Y") { SiteUseList[SiteUseCount] = "GENERAL"; PrimarySiteUseList[SiteUseCount++] = (AddrId == SiebelAccountIntComp.GetFieldValue ("Primary Address Id")) ? "Y" : "N" } for ( var i = 0; i < SiteUseList.length; i++ ) { if (SiteUseList[i] == "BILL_TO") { // Create new profile for BILL_TO OracleProfileIntComp.NewRecord(); // Copy the Address Id from the Address Integration Component CopyProfileInfo ( OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, "I", AccSharedID, AddrSharedID); } if (i > 0) { // Need new customer interface record OracleIntObject.NewInstance (); NewOracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); NewOracleCustomerIntComp.NewRecord (); CopyCustomerInfo(NewOracleCustomerIntComp, SiebelAccountIntComp, "I", CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); CopyAddressInfo (NewOracleCustomerIntComp, SiebelAddressIntComp, CountryVM, AddrSharedID); NewOracleCustomerIntComp.SetFieldValue ("SITE_USE_CODE", SiteUseList[i]); NewOracleCustomerIntComp.SetFieldValue ("PRIMARY_SITE_USE_FLAG", PrimarySiteUseList[i]); } else { // Use existing customer interface record OracleCustomerIntComp.SetFieldValue ("SITE_USE_CODE", SiteUseList[i]); OracleCustomerIntComp.SetFieldValue ("INSERT_UPDATE_FLAG", "I"); OracleCustomerIntComp.SetFieldValue ("PRIMARY_SITE_USE_FLAG", PrimarySiteUseList[i]); } } }

Account Maps - Siebel Outbound
CreateSiebelCustomer
// Map Siebel Account to Oracle Customer // Returns argument "ObjectIntegrationId" function CreateSiebelCustomer(InputMsg, OutputMsg) { var SiebelIntObject, OracleIntObject; OutputMsg.SetArgument("ObjectIntegrationId", ""); SiebelIntObject = InputMsg.GetIntObj("Account - Get/Put Oracle Customer (Siebel)"); // Check the validity of the Siebel Integration Object. if (SiebelIntObject.Exists ()) { // Go ahead and create a new Oracle Integration Object on the Output Message. OracleIntObject = OutputMsg.CreateIntObj("Account - Put Oracle Customer (Oracle)"); // Navigate through all the available instances in the Integration Object while (SiebelIntObject.NextInstance ()) { // Create a new instance in the Oracle Integration Object OracleIntObject.NewInstance (); // CopyFields is again a user defined function which is written to copy all // the fields from the source to the target. CopyFields (SiebelIntObject, OracleIntObject, OutputMsg); } ///~ while(SiebelIntObject.NextInstance()) } ///~ if(SiebelIntObject.Exists()) else { // Raise an exception saying that the Siebel Integration Object was not found in // the Input message. Actually we don't have to do this because, the workflow // system itself will inform the user with an Error message. EAIRaiseError (TranslateMessage ("ORA_MSG_EMPTY,Account - Get/Put Oracle Customer (Siebel)")); } ///~ else } ///~ End of CreateSiebelAccount function.

Account Maps - Siebel Outbound
CreateSiebelCustomer
// Map Siebel Account to Oracle Customer // Returns argument "ObjectIntegrationId" function CreateSiebelCustomer(InputMsg, OutputMsg) { var SiebelIntObject, OracleIntObject; OutputMsg.SetArgument("ObjectIntegrationId", ""); SiebelIntObject = InputMsg.GetIntObj("Account - Get/Put Oracle Customer (Siebel)"); // Check the validity of the Siebel Integration Object. if (SiebelIntObject.Exists ()) { // Go ahead and create a new Oracle Integration Object on the Output Message. OracleIntObject = OutputMsg.CreateIntObj("Account - Put Oracle Customer (Oracle)"); // Navigate through all the available instances in the Integration Object while (SiebelIntObject.NextInstance ()) { // Create a new instance in the Oracle Integration Object OracleIntObject.NewInstance (); // CopyFields is again a user defined function which is written to copy all // the fields from the source to the target. CopyFields (SiebelIntObject, OracleIntObject, OutputMsg); } ///~ while(SiebelIntObject.NextInstance()) } ///~ if(SiebelIntObject.Exists()) else { // Raise an exception saying that the Siebel Integration Object was not found in // the Input message. Actually we don't have to do this because, the workflow // system itself will inform the user with an Error message. EAIRaiseError (TranslateMessage ("ORA_MSG_EMPTY,Account - Get/Put Oracle Customer (Siebel)")); } ///~ else } ///~ End of CreateSiebelAccount function.

Account Maps - Siebel Outbound
CreateSiebelCustomer
// Map Siebel Account to Oracle Customer // Returns argument "ObjectIntegrationId" function CreateSiebelCustomer(InputMsg, OutputMsg) { var SiebelIntObject, OracleIntObject; OutputMsg.SetArgument("ObjectIntegrationId", ""); SiebelIntObject = InputMsg.GetIntObj("Account - Get/Put Oracle Customer (Siebel)"); // Check the validity of the Siebel Integration Object. if (SiebelIntObject.Exists ()) { // Go ahead and create a new Oracle Integration Object on the Output Message. OracleIntObject = OutputMsg.CreateIntObj("Account - Put Oracle Customer (Oracle)"); // Navigate through all the available instances in the Integration Object while (SiebelIntObject.NextInstance ()) { // Create a new instance in the Oracle Integration Object OracleIntObject.NewInstance (); // CopyFields is again a user defined function which is written to copy all // the fields from the source to the target. CopyFields (SiebelIntObject, OracleIntObject, OutputMsg); } ///~ while(SiebelIntObject.NextInstance()) } ///~ if(SiebelIntObject.Exists()) else { // Raise an exception saying that the Siebel Integration Object was not found in // the Input message. Actually we don't have to do this because, the workflow // system itself will inform the user with an Error message. EAIRaiseError (TranslateMessage ("ORA_MSG_EMPTY,Account - Get/Put Oracle Customer (Siebel)")); } ///~ else } ///~ End of CreateSiebelAccount function.

Account Maps - Siebel Outbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Outbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Outbound
Service_PreInvokeMethod
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { return EAIExecuteMap(MethodName, Inputs, Outputs); }

Account Maps - Siebel Outbound
TimeStamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Outbound
TimeStamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Outbound
TimeStamp
/** ** User-defined function that returns System Date/Time ** in the format understandable by Siebel adapter **/ function Timestamp() { var d = Date.fromSystem(Clib.time()); // Return date in the format MM/DD/YYYY HH:MM:SS return Clib.rsprintf("%02d/%02d/%04d %02d:%02d:%02d", d.getMonth()+1, d.getDate(), d.getFullYear(), d.getHours(), d.getMinutes(), d.getSeconds()); }

Account Maps - Siebel Outbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Outbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Outbound
TranslateMessage
function TranslateMessage(Message) { // Function to perform message language translation and parameterization. // // Created in November 2000 // // Message is a string of comma separate tokens and parameters. // Tokens begin with <prefix>. // The tokens represent language independent LOV codes of type // <LOVType> which in turn map to translated // parameterized message texts. If the input message does not start with // ORA_MSG the message is returned untranslated. A message can have // up to nine parameters, %1,%2,...,%9. An example from the Oracle Connector: // // Message: // ORA_MSG_MISSING_CONTACT,A. K. Parker,ORA_MSG_INVALID_STATUS,Re-opened,A. K. Parker // Parameterized text: // ORA_MSG_MISSING_CONTACT="Contact for account %1 is missing." // ORA_MSG_INVALID_STATUS="%1 is an invalid status for %2." // Result: // "Contact for account A. K. Parker is missing. Re-opened is an invalid status for A. K. Parker." // // Warning!!! The comma is the delimiter so commas in the parameters will // cause undesirable results and so steps should be taken to avoid them. // // Note: LOV Display values are limited to 30 characters and so in some cases // you may need to combine two tokens to get the behavior you require. var prefix = "ORA_MSG"; var LOVType = "ORACLE_CONNECTOR_MESSAGE"; if (Message.substring(0,7) != prefix) // Don't translate return (Message); var pieces = Message.split(','); var tokeni=0; var i=1; var oMessage=""; while (tokeni < pieces.length) { i=tokeni + 1; // Lookup error token in LOV table to get translated error text var LOVText = TheApplication().InvokeMethod ( "LookupValue", LOVType, pieces[tokeni]); if (LOVText == "") { // No token in LOV table so append untranslated token and parameters oMessage=oMessage+pieces[tokeni]+" "; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; oMessage=oMessage+pieces[i]+" "; i++; } } else { // Read parameters var params = new Array("","","","","","","","",""); var paramsi = 0; while(i < pieces.length) { if (pieces[i].substring(0,7) == prefix) break; params[paramsi]=pieces[i]; paramsi++; i++; } // Insert parameters into message and append to output // Split LOVText to find parameter place holders %1,%2,... var msgpieces=LOVText.split("%"); var mpi; oMessage = oMessage + msgpieces[0]; for (mpi = 1; mpi < msgpieces.length; mpi++) { paramsi = msgpieces[mpi].substring(0,1); if ((Clib.isdigit(paramsi)) && (paramsi > 0)) // Parameter place holder so append parameter and rest of message piece oMessage = oMessage + params[paramsi-1] + msgpieces[mpi].substring(1); else // Not a parameter place holder so just append % and piece oMessage = oMessage + "%" + msgpieces[mpi]; } oMessage = oMessage + " "; } // Set token to next piece tokeni=i; } return (oMessage); }

Account Maps - Siebel Outbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 01/03/2001 // // DESCRIPTION // Javascript maps from Oracle11i Customer to Siebel Account // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Outbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 01/03/2001 // // DESCRIPTION // Javascript maps from Oracle11i Customer to Siebel Account // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Outbound (Oracle11i)
(declarations)
/////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001, Siebel Systems, Inc., All rights reserved. // // LAST UPDATED : 01/03/2001 // // DESCRIPTION // Javascript maps from Oracle11i Customer to Siebel Account // /////////////////////////////////////////////////////////////////////////////// #include "eaisiebel.js"

Account Maps - Siebel Outbound (Oracle11i)
AccountLoopBack
function AccountLoopBack(InputMsg, OutputMsg) { var SiebelObjectIn, SiebelObjectOut; var AccCompIn, AccCompOut, AddrCompIn, AddrCompOut, ConCompIn, ConCompOut; var AccSharedID, AccIntegId, AddrSharedID, AddrIntegId, ConSharedID, ConIntegId; /* Check the validation message */ var ValidationMessage = InputMsg.GetArgument("Validation Message"); if (ValidationMessage != "") { EAIRaiseError(TranslateMessage(ValidationMessage)); } SiebelObjectIn = InputMsg.GetIntObj("Account - Put Oracle11i Customer (Siebel)"); if (SiebelObjectIn.Exists ()) { SiebelObjectOut = OutputMsg.CreateIntObj("Account - Put Oracle11i Customer (Siebel)"); while (SiebelObjectIn.NextInstance ()) { SiebelObjectOut.NewInstance (); AccCompIn = SiebelObjectIn.GetPrimaryIntComp ("Account"); // // ACCOUNT // if (AccCompIn.Exists ()) { AccCompOut = SiebelObjectOut.CreatePrimaryIntComp("Account"); while (AccCompIn.NextRecord ()) { AccCompOut.SetCopySource (AccCompIn); AccCompOut.NewRecord (); AccCompOut.CopyFieldValue("Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Date", Timestamp()); AccIntegId = AccCompIn.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccCompOut.CopyFieldValue("Integration Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Creating in Back Office"); } else { // Existing Account AccCompOut.CopyFieldValue("Integration Id", "Integration Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Sync To Back Office"); } AccCompOut.SetFieldValue ("EAI Sync Error Text",""); // // ACCOUNT ADDRESSES // var AddrCompIn = AccCompIn.GetIntComp ("Business Address"); if (AddrCompIn.Exists()) { AddrCompOut = AccCompOut.CreateIntComp("Business Address"); while (AddrCompIn.NextRecord()) { AddrCompOut.SetCopySource (AddrCompIn); AddrCompOut.NewRecord(); AddrCompOut.CopyFieldValue("Id", "Id"); AddrIntegId = AddrCompIn.GetFieldValue( "Integration Id"); if (AddrIntegId == "" || AddrIntegId == null) { // New Address AddrCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Address AddrCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT ADDRESSES // // ACCOUNT CONTACTS // var ConCompIn = AccCompIn.GetIntComp ("Contact"); if (ConCompIn.Exists()) { ConCompOut = AccCompOut.CreateIntComp("Contact"); while (ConCompIn.NextRecord()) { ConCompOut.SetCopySource (ConCompIn); ConCompOut.NewRecord(); ConCompOut.CopyFieldValue("Id", "Id"); ConIntegId = ConCompIn.GetFieldValue( "Integration Id"); if (ConIntegId == "" || ConIntegId == null) { // New Contact ConCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Contact ConCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT CONTACTS } } // END ACCOUNT } } else { EAIRaiseError (TranslateMessage ( "ORA_MSG_EMPTY,Account - Put Oracle11i Customer (Siebel)")); } }

Account Maps - Siebel Outbound (Oracle11i)
AccountLoopBack
function AccountLoopBack(InputMsg, OutputMsg) { var SiebelObjectIn, SiebelObjectOut; var AccCompIn, AccCompOut, AddrCompIn, AddrCompOut, ConCompIn, ConCompOut; var AccSharedID, AccIntegId, AddrSharedID, AddrIntegId, ConSharedID, ConIntegId; /* Check the validation message */ var ValidationMessage = InputMsg.GetArgument("Validation Message"); if (ValidationMessage != "") { EAIRaiseError(TranslateMessage(ValidationMessage)); } SiebelObjectIn = InputMsg.GetIntObj("Account - Put Oracle11i Customer (Siebel)"); if (SiebelObjectIn.Exists ()) { SiebelObjectOut = OutputMsg.CreateIntObj("Account - Put Oracle11i Customer (Siebel)"); while (SiebelObjectIn.NextInstance ()) { SiebelObjectOut.NewInstance (); AccCompIn = SiebelObjectIn.GetPrimaryIntComp ("Account"); // // ACCOUNT // if (AccCompIn.Exists ()) { AccCompOut = SiebelObjectOut.CreatePrimaryIntComp("Account"); while (AccCompIn.NextRecord ()) { AccCompOut.SetCopySource (AccCompIn); AccCompOut.NewRecord (); AccCompOut.CopyFieldValue("Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Date", Timestamp()); AccIntegId = AccCompIn.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccCompOut.CopyFieldValue("Integration Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Creating in Back Office"); } else { // Existing Account AccCompOut.CopyFieldValue("Integration Id", "Integration Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Sync To Back Office"); } AccCompOut.SetFieldValue ("EAI Sync Error Text",""); // // ACCOUNT ADDRESSES // var AddrCompIn = AccCompIn.GetIntComp ("Business Address"); if (AddrCompIn.Exists()) { AddrCompOut = AccCompOut.CreateIntComp("Business Address"); while (AddrCompIn.NextRecord()) { AddrCompOut.SetCopySource (AddrCompIn); AddrCompOut.NewRecord(); AddrCompOut.CopyFieldValue("Id", "Id"); AddrIntegId = AddrCompIn.GetFieldValue( "Integration Id"); if (AddrIntegId == "" || AddrIntegId == null) { // New Address AddrCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Address AddrCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT ADDRESSES // // ACCOUNT CONTACTS // var ConCompIn = AccCompIn.GetIntComp ("Contact"); if (ConCompIn.Exists()) { ConCompOut = AccCompOut.CreateIntComp("Contact"); while (ConCompIn.NextRecord()) { ConCompOut.SetCopySource (ConCompIn); ConCompOut.NewRecord(); ConCompOut.CopyFieldValue("Id", "Id"); ConIntegId = ConCompIn.GetFieldValue( "Integration Id"); if (ConIntegId == "" || ConIntegId == null) { // New Contact ConCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Contact ConCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT CONTACTS } } // END ACCOUNT } } else { EAIRaiseError (TranslateMessage ( "ORA_MSG_EMPTY,Account - Put Oracle11i Customer (Siebel)")); } }

Account Maps - Siebel Outbound (Oracle11i)
AccountLoopBack
function AccountLoopBack(InputMsg, OutputMsg) { var SiebelObjectIn, SiebelObjectOut; var AccCompIn, AccCompOut, AddrCompIn, AddrCompOut, ConCompIn, ConCompOut; var AccSharedID, AccIntegId, AddrSharedID, AddrIntegId, ConSharedID, ConIntegId; /* Check the validation message */ var ValidationMessage = InputMsg.GetArgument("Validation Message"); if (ValidationMessage != "") { EAIRaiseError(TranslateMessage(ValidationMessage)); } SiebelObjectIn = InputMsg.GetIntObj("Account - Put Oracle11i Customer (Siebel)"); if (SiebelObjectIn.Exists ()) { SiebelObjectOut = OutputMsg.CreateIntObj("Account - Put Oracle11i Customer (Siebel)"); while (SiebelObjectIn.NextInstance ()) { SiebelObjectOut.NewInstance (); AccCompIn = SiebelObjectIn.GetPrimaryIntComp ("Account"); // // ACCOUNT // if (AccCompIn.Exists ()) { AccCompOut = SiebelObjectOut.CreatePrimaryIntComp("Account"); while (AccCompIn.NextRecord ()) { AccCompOut.SetCopySource (AccCompIn); AccCompOut.NewRecord (); AccCompOut.CopyFieldValue("Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Date", Timestamp()); AccIntegId = AccCompIn.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccCompOut.CopyFieldValue("Integration Id", "Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Creating in Back Office"); } else { // Existing Account AccCompOut.CopyFieldValue("Integration Id", "Integration Id"); AccCompOut.SetFieldValue("EAI Sync Status Code", "Sync To Back Office"); } AccCompOut.SetFieldValue ("EAI Sync Error Text",""); // // ACCOUNT ADDRESSES // var AddrCompIn = AccCompIn.GetIntComp ("Business Address"); if (AddrCompIn.Exists()) { AddrCompOut = AccCompOut.CreateIntComp("Business Address"); while (AddrCompIn.NextRecord()) { AddrCompOut.SetCopySource (AddrCompIn); AddrCompOut.NewRecord(); AddrCompOut.CopyFieldValue("Id", "Id"); AddrIntegId = AddrCompIn.GetFieldValue( "Integration Id"); if (AddrIntegId == "" || AddrIntegId == null) { // New Address AddrCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Address AddrCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT ADDRESSES // // ACCOUNT CONTACTS // var ConCompIn = AccCompIn.GetIntComp ("Contact"); if (ConCompIn.Exists()) { ConCompOut = AccCompOut.CreateIntComp("Contact"); while (ConCompIn.NextRecord()) { ConCompOut.SetCopySource (ConCompIn); ConCompOut.NewRecord(); ConCompOut.CopyFieldValue("Id", "Id"); ConIntegId = ConCompIn.GetFieldValue( "Integration Id"); if (ConIntegId == "" || ConIntegId == null) { // New Contact ConCompOut.CopyFieldValue("Integration Id", "Id"); } else { // Existing Contact ConCompOut.CopyFieldValue("Integration Id", "Integration Id"); } } } // END ACCOUNT CONTACTS } } // END ACCOUNT } } else { EAIRaiseError (TranslateMessage ( "ORA_MSG_EMPTY,Account - Put Oracle11i Customer (Siebel)")); } }

Account Maps - Siebel Outbound (Oracle11i)
CopyAddressInfo
function CopyAddressInfo (OracleCustComp, SiebelAddressIntComp, CountryVM, AddrSharedID) { OracleCustComp.SetCopySource (SiebelAddressIntComp); OracleCustComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleCustComp.CopyFieldValue ("ADDRESS1", "Street Address"); OracleCustComp.CopyFieldValue ("ADDRESS2", "Street Address 2"); OracleCustComp.CopyFieldValue ("CITY", "City"); OracleCustComp.CopyFieldValue ("STATE", "State"); OracleCustComp.CopyFieldValue ("PROVINCE", "Province"); OracleCustComp.CopyFieldValue ("COUNTY", "County"); OracleCustComp.CopyFieldValue ("POSTAL_CODE", "Postal Code"); OracleCustComp.CopyFieldValue ("ORG_ID", "Organization Integration Id"); var CountryVal = SiebelAddressIntComp.GetFieldValue("Country"); if ( CountryVal != "" ) { OracleCustComp.SetFieldValue ("COUNTRY", CountryVM.Translate ( SiebelAddressIntComp.GetFieldValue ("Country"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_COUNTRY,NULL")); } }

Account Maps - Siebel Outbound (Oracle11i)
CopyAddressInfo
function CopyAddressInfo (OracleCustComp, SiebelAddressIntComp, CountryVM, AddrSharedID) { OracleCustComp.SetCopySource (SiebelAddressIntComp); OracleCustComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleCustComp.CopyFieldValue ("ADDRESS1", "Street Address"); OracleCustComp.CopyFieldValue ("ADDRESS2", "Street Address 2"); OracleCustComp.CopyFieldValue ("CITY", "City"); OracleCustComp.CopyFieldValue ("STATE", "State"); OracleCustComp.CopyFieldValue ("PROVINCE", "Province"); OracleCustComp.CopyFieldValue ("COUNTY", "County"); OracleCustComp.CopyFieldValue ("POSTAL_CODE", "Postal Code"); OracleCustComp.CopyFieldValue ("ORG_ID", "Organization Integration Id"); var CountryVal = SiebelAddressIntComp.GetFieldValue("Country"); if ( CountryVal != "" ) { OracleCustComp.SetFieldValue ("COUNTRY", CountryVM.Translate ( SiebelAddressIntComp.GetFieldValue ("Country"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_COUNTRY,NULL")); } }

Account Maps - Siebel Outbound (Oracle11i)
CopyAddressInfo
function CopyAddressInfo (OracleCustComp, SiebelAddressIntComp, CountryVM, AddrSharedID) { OracleCustComp.SetCopySource (SiebelAddressIntComp); OracleCustComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleCustComp.CopyFieldValue ("ADDRESS1", "Street Address"); OracleCustComp.CopyFieldValue ("ADDRESS2", "Street Address 2"); OracleCustComp.CopyFieldValue ("CITY", "City"); OracleCustComp.CopyFieldValue ("STATE", "State"); OracleCustComp.CopyFieldValue ("PROVINCE", "Province"); OracleCustComp.CopyFieldValue ("COUNTY", "County"); OracleCustComp.CopyFieldValue ("POSTAL_CODE", "Postal Code"); OracleCustComp.CopyFieldValue ("ORG_ID", "Organization Integration Id"); var CountryVal = SiebelAddressIntComp.GetFieldValue("Country"); if ( CountryVal != "" ) { OracleCustComp.SetFieldValue ("COUNTRY", CountryVM.Translate ( SiebelAddressIntComp.GetFieldValue ("Country"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_COUNTRY,NULL")); } }

Account Maps - Siebel Outbound (Oracle11i)
CopyContactInfo
function CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID) { OracleContactIntComp.NewRecord(); OracleContactIntComp.SetCopySource (SiebelContactIntComp); OracleContactIntComp.SetFieldValue ("operation", "upsert"); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_TELEPHONE_REF", ""); OracleContactIntComp.SetFieldValue ("INSERT_UPDATE_FLAG",ContactInsUpdFlag); OracleContactIntComp.SetFieldValue ("CONTACT_TITLE", ContactTitleVM.Translate (SiebelContactIntComp.GetFieldValue ("M/M"))); OracleContactIntComp.SetFieldValue ("CONTACT_JOB_TITLE", SiebelContactIntComp.GetFieldValue("Job Title").substring(0,49)); OracleContactIntComp.CopyFieldValue ("CONTACT_LAST_NAME", "Last Name"); OracleContactIntComp.SetFieldValue ("CONTACT_FIRST_NAME", SiebelContactIntComp.GetFieldValue("First Name").substring(0,39)); OracleContactIntComp.CopyFieldValue ("SEX_CODE","M/F"); OracleContactIntComp.CopyFieldValue ("EMAIL_ADDRESS", "Email Address"); OracleContactIntComp.CopyFieldValue ("MAIL_STOP", "Mail Stop"); OracleContactIntComp.SetFieldValue ("ORG_ID", ""); OracleContactIntComp.SetFieldValue ("CREATED_BY", "-1"); OracleContactIntComp.SetFieldValue ("LAST_UPDATED_BY", "-1"); OracleContactIntComp.SetFieldValue ("CREATION_DATE", SiebelContactIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue ("LAST_UPDATE_DATE", SiebelContactIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound (Oracle11i)
CopyContactInfo
function CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID) { OracleContactIntComp.NewRecord(); OracleContactIntComp.SetCopySource (SiebelContactIntComp); OracleContactIntComp.SetFieldValue ("operation", "upsert"); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_TELEPHONE_REF", ""); OracleContactIntComp.SetFieldValue ("INSERT_UPDATE_FLAG",ContactInsUpdFlag); OracleContactIntComp.SetFieldValue ("CONTACT_TITLE", ContactTitleVM.Translate (SiebelContactIntComp.GetFieldValue ("M/M"))); OracleContactIntComp.SetFieldValue ("CONTACT_JOB_TITLE", SiebelContactIntComp.GetFieldValue("Job Title").substring(0,49)); OracleContactIntComp.CopyFieldValue ("CONTACT_LAST_NAME", "Last Name"); OracleContactIntComp.SetFieldValue ("CONTACT_FIRST_NAME", SiebelContactIntComp.GetFieldValue("First Name").substring(0,39)); OracleContactIntComp.CopyFieldValue ("SEX_CODE","M/F"); OracleContactIntComp.CopyFieldValue ("EMAIL_ADDRESS", "Email Address"); OracleContactIntComp.CopyFieldValue ("MAIL_STOP", "Mail Stop"); OracleContactIntComp.SetFieldValue ("ORG_ID", ""); OracleContactIntComp.SetFieldValue ("CREATED_BY", "-1"); OracleContactIntComp.SetFieldValue ("LAST_UPDATED_BY", "-1"); OracleContactIntComp.SetFieldValue ("CREATION_DATE", SiebelContactIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue ("LAST_UPDATE_DATE", SiebelContactIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound (Oracle11i)
CopyContactInfo
function CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID) { OracleContactIntComp.NewRecord(); OracleContactIntComp.SetCopySource (SiebelContactIntComp); OracleContactIntComp.SetFieldValue ("operation", "upsert"); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleContactIntComp.SetFieldValue ("ORIG_SYSTEM_TELEPHONE_REF", ""); OracleContactIntComp.SetFieldValue ("INSERT_UPDATE_FLAG",ContactInsUpdFlag); OracleContactIntComp.SetFieldValue ("CONTACT_TITLE", ContactTitleVM.Translate (SiebelContactIntComp.GetFieldValue ("M/M"))); OracleContactIntComp.SetFieldValue ("CONTACT_JOB_TITLE", SiebelContactIntComp.GetFieldValue("Job Title").substring(0,49)); OracleContactIntComp.CopyFieldValue ("CONTACT_LAST_NAME", "Last Name"); OracleContactIntComp.SetFieldValue ("CONTACT_FIRST_NAME", SiebelContactIntComp.GetFieldValue("First Name").substring(0,39)); OracleContactIntComp.CopyFieldValue ("SEX_CODE","M/F"); OracleContactIntComp.CopyFieldValue ("EMAIL_ADDRESS", "Email Address"); OracleContactIntComp.CopyFieldValue ("MAIL_STOP", "Mail Stop"); OracleContactIntComp.SetFieldValue ("ORG_ID", ""); OracleContactIntComp.SetFieldValue ("CREATED_BY", "-1"); OracleContactIntComp.SetFieldValue ("LAST_UPDATED_BY", "-1"); OracleContactIntComp.SetFieldValue ("CREATION_DATE", SiebelContactIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue ("LAST_UPDATE_DATE", SiebelContactIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound (Oracle11i)
CopyContactPhoneInfo
function CopyContactPhoneInfo(SiebelAccountIntComp, SiebelAddressIntComp, SiebelContactIntComp,OracleContactIntComp, ContactInsUpdFlag, ContactTitleVM, ContactPhoneVM, AccSharedID, ConSharedID) { var PhoneFields = new Array("Cellular Phone #", "Fax Phone #", "Home Phone #", "Work Phone #", "Alternate Phone #", "Assistant Phone #"); var PhoneNumber, PhoneType; for ( var i = 0; i < PhoneFields.length; i++ ) { PhoneNumber = SiebelContactIntComp.GetFieldValue (PhoneFields[i]).substring(0,24); if (PhoneNumber != "") { // Fetch the Phone Type from Contact VM PhoneType = ContactPhoneVM.Translate(PhoneFields[i]); // Copy the Contact details first CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID); // Copy the Phone details CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, ContactInsUpdFlag, PhoneNumber, AccSharedID, "", ConSharedID); } } }

Account Maps - Siebel Outbound (Oracle11i)
CopyContactPhoneInfo
function CopyContactPhoneInfo(SiebelAccountIntComp, SiebelAddressIntComp, SiebelContactIntComp,OracleContactIntComp, ContactInsUpdFlag, ContactTitleVM, ContactPhoneVM, AccSharedID, ConSharedID) { var PhoneFields = new Array("Cellular Phone #", "Fax Phone #", "Home Phone #", "Work Phone #", "Alternate Phone #", "Assistant Phone #"); var PhoneNumber, PhoneType; for ( var i = 0; i < PhoneFields.length; i++ ) { PhoneNumber = SiebelContactIntComp.GetFieldValue (PhoneFields[i]).substring(0,24); if (PhoneNumber != "") { // Fetch the Phone Type from Contact VM PhoneType = ContactPhoneVM.Translate(PhoneFields[i]); // Copy the Contact details first CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID); // Copy the Phone details CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, ContactInsUpdFlag, PhoneNumber, AccSharedID, "", ConSharedID); } } }

Account Maps - Siebel Outbound (Oracle11i)
CopyContactPhoneInfo
function CopyContactPhoneInfo(SiebelAccountIntComp, SiebelAddressIntComp, SiebelContactIntComp,OracleContactIntComp, ContactInsUpdFlag, ContactTitleVM, ContactPhoneVM, AccSharedID, ConSharedID) { var PhoneFields = new Array("Cellular Phone #", "Fax Phone #", "Home Phone #", "Work Phone #", "Alternate Phone #", "Assistant Phone #"); var PhoneNumber, PhoneType; for ( var i = 0; i < PhoneFields.length; i++ ) { PhoneNumber = SiebelContactIntComp.GetFieldValue (PhoneFields[i]).substring(0,24); if (PhoneNumber != "") { // Fetch the Phone Type from Contact VM PhoneType = ContactPhoneVM.Translate(PhoneFields[i]); // Copy the Contact details first CopyContactInfo(OracleContactIntComp, SiebelAccountIntComp, SiebelContactIntComp, ContactInsUpdFlag, ContactTitleVM, AccSharedID, ConSharedID); // Copy the Phone details CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, ContactInsUpdFlag, PhoneNumber, AccSharedID, "", ConSharedID); } } }

Account Maps - Siebel Outbound (Oracle11i)
CopyCustomerInfo
function CopyCustomerInfo(OracleCustomerComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID) { OracleCustomerComp.SetCopySource (SiebelAccountIntComp); OracleCustomerComp.SetFieldValue ("operation", "upsert"); OracleCustomerComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleCustomerComp.SetFieldValue ("SITE_USE_CODE", ""); OracleCustomerComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleCustomerComp.SetFieldValue ("CUSTOMER_NAME", SiebelAccountIntComp.GetFieldValue("Name").substring(0,49)); OracleCustomerComp.SetFieldValue ("CUSTOMER_TYPE", CusType); OracleCustomerComp.CopyFieldValue ("URL", "Home Page"); var CustomerTypeVal = SiebelAccountIntComp.GetFieldValue ("Type"); if ( CustomerTypeVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_CATEGORY_CODE", AccountCategoryVM.Translate (SiebelAccountIntComp.GetFieldValue ("Type"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_CUST_CATEGORY, NULL")); } var CustomerStatusVal = SiebelAccountIntComp.GetFieldValue ("Account Status"); if ( CustomerStatusVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_STATUS", AccountStatusVM.Translate ( SiebelAccountIntComp.GetFieldValue ("Account Status"))); } else { EAIRaiseError(TranslateMessage ("ORA_MSG_INVALID_CUST_STATUS, null")); } OracleCustomerComp.SetFieldValue ("CREATED_BY", "-1"); OracleCustomerComp.SetFieldValue ("LAST_UPDATED_BY", "-1"); OracleCustomerComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleCustomerComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound (Oracle11i)
CopyCustomerInfo
function CopyCustomerInfo(OracleCustomerComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID) { OracleCustomerComp.SetCopySource (SiebelAccountIntComp); OracleCustomerComp.SetFieldValue ("operation", "upsert"); OracleCustomerComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleCustomerComp.SetFieldValue ("SITE_USE_CODE", ""); OracleCustomerComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleCustomerComp.SetFieldValue ("CUSTOMER_NAME", SiebelAccountIntComp.GetFieldValue("Name").substring(0,49)); OracleCustomerComp.SetFieldValue ("CUSTOMER_TYPE", CusType); OracleCustomerComp.CopyFieldValue ("URL", "Home Page"); var CustomerTypeVal = SiebelAccountIntComp.GetFieldValue ("Type"); if ( CustomerTypeVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_CATEGORY_CODE", AccountCategoryVM.Translate (SiebelAccountIntComp.GetFieldValue ("Type"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_CUST_CATEGORY, NULL")); } var CustomerStatusVal = SiebelAccountIntComp.GetFieldValue ("Account Status"); if ( CustomerStatusVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_STATUS", AccountStatusVM.Translate ( SiebelAccountIntComp.GetFieldValue ("Account Status"))); } else { EAIRaiseError(TranslateMessage ("ORA_MSG_INVALID_CUST_STATUS, null")); } OracleCustomerComp.SetFieldValue ("CREATED_BY", "-1"); OracleCustomerComp.SetFieldValue ("LAST_UPDATED_BY", "-1"); OracleCustomerComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleCustomerComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound (Oracle11i)
CopyCustomerInfo
function CopyCustomerInfo(OracleCustomerComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID) { OracleCustomerComp.SetCopySource (SiebelAccountIntComp); OracleCustomerComp.SetFieldValue ("operation", "upsert"); OracleCustomerComp.SetFieldValue ("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleCustomerComp.SetFieldValue ("ORIG_SYSTEM_ADDRESS_REF", ""); OracleCustomerComp.SetFieldValue ("SITE_USE_CODE", ""); OracleCustomerComp.CopyFieldValue ("ORG_ID", "Account Organization Integration Id"); OracleCustomerComp.SetFieldValue ("CUSTOMER_NAME", SiebelAccountIntComp.GetFieldValue("Name").substring(0,49)); OracleCustomerComp.SetFieldValue ("CUSTOMER_TYPE", CusType); OracleCustomerComp.CopyFieldValue ("URL", "Home Page"); var CustomerTypeVal = SiebelAccountIntComp.GetFieldValue ("Type"); if ( CustomerTypeVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_CATEGORY_CODE", AccountCategoryVM.Translate (SiebelAccountIntComp.GetFieldValue ("Type"))); } else { EAIRaiseError(TranslateMessage("ORA_MSG_INVALID_CUST_CATEGORY, NULL")); } var CustomerStatusVal = SiebelAccountIntComp.GetFieldValue ("Account Status"); if ( CustomerStatusVal != "") { OracleCustomerComp.SetFieldValue ("CUSTOMER_STATUS", AccountStatusVM.Translate ( SiebelAccountIntComp.GetFieldValue ("Account Status"))); } else { EAIRaiseError(TranslateMessage ("ORA_MSG_INVALID_CUST_STATUS, null")); } OracleCustomerComp.SetFieldValue ("CREATED_BY", "-1"); OracleCustomerComp.SetFieldValue ("LAST_UPDATED_BY", "-1"); OracleCustomerComp.CopyFieldValue ("CREATION_DATE", "Created"); OracleCustomerComp.CopyFieldValue ("LAST_UPDATE_DATE", "Updated"); }

Account Maps - Siebel Outbound (Oracle11i)
CopyFields
function CopyFields (SiebelIntObject, OracleIntObject, OutputMsg) { // Declare variables to hold the Primary Integration Components var SiebelAccountIntComp, OracleCustomerIntComp; // Variables to hold the Oracle Contact and Oracle Profile integration Components. var OracleContactIntComp, OracleProfileIntComp; // Declare Shared ID's and misc. variables var AccSharedID, AccIntegId, InsertUpdateFlag, AddrSharedID, AddrIntegId, AddrInsUpdFlag, AddressCount, ConSharedID, ConIntegId, ContactInsUpdFlag, PhoneNumber, PhoneType, PhoneField; // Customer Type should either External("E") or Internal("I") at oracle side var CusType = "R"; var ProfileClass = "DEFAULT"; var CreditHold = "N"; // Open the EAI Value Map for Account here. var CountryVM = EAIGetValueMap("Oracle11i Country", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountStatusVM = EAIGetValueMap("Oracle11i Account Status", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap("Oracle11i Account Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AddressPhoneVM = EAIGetValueMap("Oracle11i Address Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactPhoneVM = EAIGetValueMap("Oracle11i Contact Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM= EAIGetValueMap("Oracle11i Account Category", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactTitleVM = EAIGetValueMap("Oracle11i Contact Title", "Siebel Outbound"); //Get the primary integration component from the Siebel Integration Object SiebelAccountIntComp = SiebelIntObject.GetPrimaryIntComp ("Account"); // If the Primary Integration Component is valid, then go ahead with the copying process // Else raise an error message. if (SiebelAccountIntComp.Exists ()) { // Create the Oracle Integration Components OracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); // Navigate through all the available records in the Siebel primary integration component while (SiebelAccountIntComp.NextRecord ()) { // Create a new record in the Oracle Primary Integration Object OracleCustomerIntComp.NewRecord (); OracleContactIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CONTACT_PHONES_INT_ALL"); OracleProfileIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CUSTOMER_PROFILES_INT_ALL"); // // ACCOUNT // AccIntegId = SiebelAccountIntComp.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccSharedID = SiebelAccountIntComp.GetFieldValue("Id"); InsertUpdateFlag = "I"; } else { // Existing Account AccSharedID = AccIntegId; InsertUpdateFlag = "U"; } OutputMsg.SetArgument("ObjectIntegrationId", AccSharedID); // set values in SIE_CUSTOMERS_INTERFACE_ALL CopyCustomerInfo(OracleCustomerIntComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); // set values in SIE_CUSTOMER_PROFILES_INT_ALL // Inserting a profile class for the Account in SIE_CUSTOMER_PROFILES_INT_ALL if (InsertUpdateFlag == "I") { OracleProfileIntComp.NewRecord(); CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, ""); } // Set the copy source to SiebelAccountIntComp OracleContactIntComp.SetCopySource (SiebelAccountIntComp); PhoneField = "Main Phone Number"; PhoneNumber = SiebelAccountIntComp.GetFieldValue(PhoneField).substring(0,24); if (PhoneNumber != "") { OracleContactIntComp.NewRecord(); PhoneType = AccountPhoneVM.Translate(PhoneField); // Call the function CopyPhoneInfo to copy the common fields. CopyPhoneInfo (OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag

Account Maps - Siebel Outbound (Oracle11i)
CopyFields
function CopyFields (SiebelIntObject, OracleIntObject, OutputMsg) { // Declare variables to hold the Primary Integration Components var SiebelAccountIntComp, OracleCustomerIntComp; // Variables to hold the Oracle Contact and Oracle Profile integration Components. var OracleContactIntComp, OracleProfileIntComp; // Declare Shared ID's and misc. variables var AccSharedID, AccIntegId, InsertUpdateFlag, AddrSharedID, AddrIntegId, AddrInsUpdFlag, AddressCount, ConSharedID, ConIntegId, ContactInsUpdFlag, PhoneNumber, PhoneType, PhoneField; // Customer Type should either External("E") or Internal("I") at oracle side var CusType = "R"; var ProfileClass = "DEFAULT"; var CreditHold = "N"; // Open the EAI Value Map for Account here. var CountryVM = EAIGetValueMap("Oracle11i Country", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountStatusVM = EAIGetValueMap("Oracle11i Account Status", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap("Oracle11i Account Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AddressPhoneVM = EAIGetValueMap("Oracle11i Address Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactPhoneVM = EAIGetValueMap("Oracle11i Contact Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM= EAIGetValueMap("Oracle11i Account Category", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactTitleVM = EAIGetValueMap("Oracle11i Contact Title", "Siebel Outbound"); //Get the primary integration component from the Siebel Integration Object SiebelAccountIntComp = SiebelIntObject.GetPrimaryIntComp ("Account"); // If the Primary Integration Component is valid, then go ahead with the copying process // Else raise an error message. if (SiebelAccountIntComp.Exists ()) { // Create the Oracle Integration Components OracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); // Navigate through all the available records in the Siebel primary integration component while (SiebelAccountIntComp.NextRecord ()) { // Create a new record in the Oracle Primary Integration Object OracleCustomerIntComp.NewRecord (); OracleContactIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CONTACT_PHONES_INT_ALL"); OracleProfileIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CUSTOMER_PROFILES_INT_ALL"); // // ACCOUNT // AccIntegId = SiebelAccountIntComp.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccSharedID = SiebelAccountIntComp.GetFieldValue("Id"); InsertUpdateFlag = "I"; } else { // Existing Account AccSharedID = AccIntegId; InsertUpdateFlag = "U"; } OutputMsg.SetArgument("ObjectIntegrationId", AccSharedID); // set values in SIE_CUSTOMERS_INTERFACE_ALL CopyCustomerInfo(OracleCustomerIntComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); // set values in SIE_CUSTOMER_PROFILES_INT_ALL // Inserting a profile class for the Account in SIE_CUSTOMER_PROFILES_INT_ALL if (InsertUpdateFlag == "I") { OracleProfileIntComp.NewRecord(); CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, ""); } // Set the copy source to SiebelAccountIntComp OracleContactIntComp.SetCopySource (SiebelAccountIntComp); PhoneField = "Main Phone Number"; PhoneNumber = SiebelAccountIntComp.GetFieldValue(PhoneField).substring(0,24); if (PhoneNumber != "") { OracleContactIntComp.NewRecord(); PhoneType = AccountPhoneVM.Translate(PhoneField); // Call the function CopyPhoneInfo to copy the common fields. CopyPhoneInfo (OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag

Account Maps - Siebel Outbound (Oracle11i)
CopyFields
function CopyFields (SiebelIntObject, OracleIntObject, OutputMsg) { // Declare variables to hold the Primary Integration Components var SiebelAccountIntComp, OracleCustomerIntComp; // Variables to hold the Oracle Contact and Oracle Profile integration Components. var OracleContactIntComp, OracleProfileIntComp; // Declare Shared ID's and misc. variables var AccSharedID, AccIntegId, InsertUpdateFlag, AddrSharedID, AddrIntegId, AddrInsUpdFlag, AddressCount, ConSharedID, ConIntegId, ContactInsUpdFlag, PhoneNumber, PhoneType, PhoneField; // Customer Type should either External("E") or Internal("I") at oracle side var CusType = "R"; var ProfileClass = "DEFAULT"; var CreditHold = "N"; // Open the EAI Value Map for Account here. var CountryVM = EAIGetValueMap("Oracle11i Country", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountStatusVM = EAIGetValueMap("Oracle11i Account Status", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountPhoneVM = EAIGetValueMap("Oracle11i Account Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AddressPhoneVM = EAIGetValueMap("Oracle11i Address Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactPhoneVM = EAIGetValueMap("Oracle11i Contact Phone", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var AccountCategoryVM= EAIGetValueMap("Oracle11i Account Category", "Siebel Outbound", EAIValueMap_NoEntry_RaiseError); var ContactTitleVM = EAIGetValueMap("Oracle11i Contact Title", "Siebel Outbound"); //Get the primary integration component from the Siebel Integration Object SiebelAccountIntComp = SiebelIntObject.GetPrimaryIntComp ("Account"); // If the Primary Integration Component is valid, then go ahead with the copying process // Else raise an error message. if (SiebelAccountIntComp.Exists ()) { // Create the Oracle Integration Components OracleCustomerIntComp = OracleIntObject.CreatePrimaryIntComp("SIE_CUSTOMERS_INTERFACE_ALL"); // Navigate through all the available records in the Siebel primary integration component while (SiebelAccountIntComp.NextRecord ()) { // Create a new record in the Oracle Primary Integration Object OracleCustomerIntComp.NewRecord (); OracleContactIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CONTACT_PHONES_INT_ALL"); OracleProfileIntComp = OracleCustomerIntComp.CreateIntComp("SIE_CUSTOMER_PROFILES_INT_ALL"); // // ACCOUNT // AccIntegId = SiebelAccountIntComp.GetFieldValue("Integration Id"); if (AccIntegId == "" || AccIntegId == null) { // New Account AccSharedID = SiebelAccountIntComp.GetFieldValue("Id"); InsertUpdateFlag = "I"; } else { // Existing Account AccSharedID = AccIntegId; InsertUpdateFlag = "U"; } OutputMsg.SetArgument("ObjectIntegrationId", AccSharedID); // set values in SIE_CUSTOMERS_INTERFACE_ALL CopyCustomerInfo(OracleCustomerIntComp, SiebelAccountIntComp, InsertUpdateFlag, CusType, AccountCategoryVM, AccountStatusVM, AccSharedID); // set values in SIE_CUSTOMER_PROFILES_INT_ALL // Inserting a profile class for the Account in SIE_CUSTOMER_PROFILES_INT_ALL if (InsertUpdateFlag == "I") { OracleProfileIntComp.NewRecord(); CopyProfileInfo (OracleProfileIntComp, SiebelAccountIntComp, ProfileClass, CreditHold, InsertUpdateFlag, AccSharedID, ""); } // Set the copy source to SiebelAccountIntComp OracleContactIntComp.SetCopySource (SiebelAccountIntComp); PhoneField = "Main Phone Number"; PhoneNumber = SiebelAccountIntComp.GetFieldValue(PhoneField).substring(0,24); if (PhoneNumber != "") { OracleContactIntComp.NewRecord(); PhoneType = AccountPhoneVM.Translate(PhoneField); // Call the function CopyPhoneInfo to copy the common fields. CopyPhoneInfo (OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag

Account Maps - Siebel Outbound (Oracle11i)
CopyPhoneInfo
function CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag, PhoneNumber, AccSharedID, AddrSharedID, ConSharedID) { OracleContactIntComp.SetFieldValue("operation", "upsert"); OracleContactIntComp.SetFieldValue("TELEPHONE", PhoneNumber); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CONTACT_REF", ConSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_TELEPHONE_REF", AccSharedID+":"+AddrSharedID+":"+ConSharedID+":"+PhoneType); OracleContactIntComp.SetFieldValue("TELEPHONE_TYPE", PhoneType); OracleContactIntComp.SetFieldValue("INSERT_UPDATE_FLAG", InsertUpdateFlag); OracleContactIntComp.SetFieldValue ("CREATED_BY", "-1"); OracleContactIntComp.SetFieldValue ("LAST_UPDATED_BY", "-1"); OracleContactIntComp.SetFieldValue("CREATION_DATE", SiebelAccountIntComp.GetFieldValue ("Created")); OracleContactIntComp.SetFieldValue("LAST_UPDATE_DATE", SiebelAccountIntComp.GetFieldValue ("Updated")); }

Account Maps - Siebel Outbound (Oracle11i)
CopyPhoneInfo
function CopyPhoneInfo(OracleContactIntComp, SiebelAccountIntComp, PhoneType, InsertUpdateFlag, PhoneNumber, AccSharedID, AddrSharedID, ConSharedID) { OracleContactIntComp.SetFieldValue("operation", "upsert"); OracleContactIntComp.SetFieldValue("TELEPHONE", PhoneNumber); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_CUSTOMER_REF", AccSharedID); OracleContactIntComp.SetFieldValue("ORIG_SYSTEM_ADDRESS_REF", AddrSharedID); OracleContactIntComp.SetFieldValue("ORIG_SY