Thursday, July 2, 2009

Access Siebel from any external application, using URL with SWE commands

To access Siebel from any external application, using URL with SWE commands and query for a field value.

Create a business service and call the business service and method in URL.


BS:

Name of BS : GotoAccountsViewBS

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

{

if (MethodName=="Methodcall")

{

// declarations

var sLocation = Inputs.GetProperty("sLocation");

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

var oBC = oBO.GetBusComp("Account");

var AccountisRecord;

oBC.SetViewMode(3);

oBC.ActivateField("Location");

oBC.ClearToQuery();

oBC.SetSearchSpec("Location", sLocation);

oBC.ExecuteQuery(ForwardOnly);

AccountisRecord = oBC.FirstRecord();

if (AccountisRecord == true){


TheApplication().GotoView("All Accounts across Organizations", oBO )

}

}

oBC = null;

oBO = null;

}

return (CancelOperation);

}


URL to incorporate in the external application:


http://mycompanysiebel.com/callcenter/start.swe?SWECmd=InvokeMethod&SWEMethod=Methodcall&SWEService=GotoAccountsViewBS& sLocation=MYACCOUNT&SWERF=1

--
Any questions, Please contact me via siva.ganga@gmail.com

Tuesday, June 30, 2009

Email for 90 days notification using Outbound Communications Manager

//----start

//instantiate the business service and the propertysets

var bs = TheApplication().GetService("Outbound Communications Manager");
var inputs = TheApplication().NewPropertySet();
var outputs = TheApplication().NewPropertySet();

//Communication profile to be used - must be must be a current profile defined in the application
var CommProfile = "Siebel Remote";
var dEBBDate1 = new Date();
var sMonth1= dEBBDate1.getMonth() + 1;
var sYear1= dEBBDate1.getFullYear();
var sDay1= dEBBDate1.getDate();
var dEBBDate2 ;
var sdatenew ;
sdatenew = dEBBDate1.getTime();
sdatenew = ToNumber(sdatenew)+7776000000;
sdatenew = new Date(sdatenew);
var dEBBStDate1 = sdatenew.getMonth()+1 + "/" + (sdatenew.getDate()) + "/" + sdatenew.getFullYear();
var oOptyBO = TheApplication().GetBusObject("Opportunity");
var oOptyBC = oOptyBO.GetBusComp("Opportunity");
oOptyBC.ActivateField("Account Id");
oOptyBC.ActivateField("Id");
oOptyBC.ActivateField("Primary Position Id");
oOptyBC.ActivateField("Primary Revenue Close Date");
oOptyBC.SetViewMode(AllView);
oOptyBC.InvokeMethod("SetAdminMode", "Y");
oOptyBC.ClearToQuery();
// oOptyBC.SetSearchSpec("Primary Position Id", sPrimPosId);
var sOptyExpr = "[Primary Revenue Close Date] = '" + dEBBStDate1+ "'";;

oOptyBC.SetSearchExpr(sOptyExpr);
oOptyBC.ExecuteQuery(ForwardOnly);
var isOpty = oOptyBC.FirstRecord();
while (isOpty)
{
var sSalesRep = oOptyBC.GetFieldValue("Sales Rep");
var sOPtyName = oOptyBC.GetFieldValue("Name");
var sOptyId = oOptyBC.GetFieldValue("Id");
var sURL = "http://******.com/callcenter/start.swe?SWECmd=GotoView&SWEView=Opty+View&SWEPostnApplet=Opty+List+Applet&SWEPostnRowId="+sOptyId+"&SWEFullRefresh=TRUE";
var MsgToList = sSalesRep+"@***.com";
// var tMsg = tMsg + "Agy is "+sPoSkillAgyCd+", "+"Rep is "+sPoSkillRepCd+", " + "LoginName is " + sOldLoginName;
var MsgBody = "You have an opportunity "+sOPtyName+" which has a due date with in 90 days from now."
MsgBody = MsgBody+"\n"+"This can be accessed via the following link: "+sURL+ " .";
MsgBody = MsgBody+"\n"+"--";
MsgBody = MsgBody+"\n"+"Thank you";
MsgBody = MsgBody+"\n"+"Siebel Administrator";
var MsgSubject = "90 days notification for opportunity: "+oOptyBC.GetFieldValue("Name"); ;

//Where C:\ on the Siebel Server or the Siebel Client file system? Or where in a remote client?

// var AttachFileList = "c:\\test.txt";

inputs.SetProperty("CommProfile",CommProfile);

//for web client use 'Remote' instead of 'Local'
// inputs.SetProperty("ProcessMode","Local");
inputs.SetProperty("ProcessMode","Remote");
inputs.SetProperty("MsgToList",MsgToList);
inputs.SetProperty("MsgBody",MsgBody);
inputs.SetProperty("MsgSubject",MsgSubject);


//inputs.SetProperty("AttachFileList",AttachFileList);

bs.InvokeMethod("SendMessage",inputs,outputs);
isOpty=oOptyBC.NextRecord();
}
inputs = null;
outputs = null;
bs=null;

//----end
--
Any questions, Please contact me via siva.ganga@gmail.com

Adding tooltip to the activity calendar description:

In Siebel Tools,
go to the applet: Activity HI Calendar Applet
And In the applet user properties, search for "Description.Tooltip Fields".
add , new field at end.
ex :
Previous Value : Type, Description, Planned, Planned Completion, MeetingLocation, Comment
New Value : Type, Description, Planned, Planned Completion, MeetingLocation, Comment, Primary Owned By


--
Any questions, Please contact me via siva.ganga@gmail.com