+ Start a Discussion
aedlsaedls 

Create new Task through CCTIButton

I used a CCTIButton class to created a button in the Softphone GUI to navigate to linked Task URL. But I don't know how to get the current call who_id (Contact/Lead) or what_id (Account/Opportunity/Campaigne) that I need in SetLinkURL function parameter. What I am trying to accomplish is to mimic the 'Call A Log' functionality in the Activity History section of Contact or Account Page.

Is there any API I can use to get those information?

Best Answer chosen by Admin (Salesforce Developers) 
werewolfwerewolf

Well just setting the CCTICallLog to visible=false and saveOnEnd=false (and maybe overriding OnCallEstablished to ensure that it stays false) should achieve the end of having a call log present to track those items.

All Answers

aedlsaedls

I know everyone is wondering why I am doing this since there is a current call log in the softphone. Unfortunately my client have a specific way of logging their calls that the fields they need is not in the Current Call Log GUI. So we decided to disable call logging and create a button that will create a new task related to the current call.

werewolfwerewolf

Well, that information would be in the CCTICallLog associated with the call.  Even if it's not visible, there's still a CCTICallLog associated with it collecting that data.  Or you could manually pick up the ADD_LOG_OBJECT calls by overriding UIAddLogObject, but you'd have to mimic the logic in CCTICallLog to know what goes in the Who and what goes in the What.

aedlsaedls

These are the things I tried yesterday:

1st, I disabled call logging in OnCallDialing event and then in OnCallEstablished I tried to retrieved the CCTICallLog of that call through GetCallLogForCallId function. But it returns null maybe because I disabled call logging in OnCallDialing?

2nd, I disabled call logging in OnCallDialing event and then instantiate/create CCTICallLog object manually. Then in OnCallEstablished event I retrieved the CCTICallLog object of that call through object call id. From that I was able to get the selected whoid and whatid. But by doing that it show the 'Current Call Log' GUI' and still creates a log of that call when the calls end. I need to check today if setting the call log SetSaveOnEnd(false) and SetVisible(false) will help. Since I manually created the CCTICallLog object can I clear the log after I retried the information I need?

3rd, I was able to see these parameters in the UIAddLogObject when it fires, KEY_ID, KEY_OBJECT_LABEL, and KEY_OBJECT_NAME which is the things I need in creating my button's link Url. If I will use this how to I know which call (line 1, line 2 or line 3) this objects attached into?

 

With different approach I mentioned above which one is the best solution and what are the additional things that I need to achieve my goals. And as you said "that information would be in the CCTICallLog associated with the call.  Even if it's not visible, there's still a CCTICallLog associated with it collecting that data"  how can I retrieve this CCTICallLog object? Your help is very much appriacated. Thank you.

aedlsaedls

This is what I achieved at this time:

In my 2nd approach in my previous post, I set SetSaveOnEnd(false) and SetVisible(false) in OnCallEstablished event and the Current Call Log was hidden and it didn't saved a call log from Current Call Log GUI which is the one I am trying to archieved in the first place.

In my 1st approach in my previous post, I re-enabled call logging the way the standard CTI Toolkit and in  OnCallEstablished sets  SetSaveOnEnd(false) and SetVisible(false) to override the values that was set in the based class. Because werewolf said that "Even if it's not visible, there's still a CCTICallLog associated with it collecting that data" .

Werewolf thanks for the idea and what do you think? Am I doing the correct way?

werewolfwerewolf

Well just setting the CCTICallLog to visible=false and saveOnEnd=false (and maybe overriding OnCallEstablished to ensure that it stays false) should achieve the end of having a call log present to track those items.

This was selected as the best answer