12.07.2015 Views

Open CTI Developer's Guide - Salesforce.com

Open CTI Developer's Guide - Salesforce.com

Open CTI Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Methods for <strong>Salesforce</strong> Application InteractionrefreshRelatedList()ArgumentsNamelistNamecallbackTypestringfunctionDescriptionThe name of the related list to refresh. For example, Contact for Contactsrelated list or Activity for <strong>Open</strong> Activities related list.Note that to refresh a custom related list created from a custom lookup field,listName must specify the ID of the custom lookup field.JavaScript method called upon <strong>com</strong>pletion of the method.Sample Code–JavaScriptfunction checkRefreshResult(result) {if (result.result) {alert('The related list is refreshed!');} else {alert('Cannot refresh the related list with the given listName! Makesure the listName is correct and the related list is on the page.');}}function refreshActivityRelatedList() {sforce.interaction.refreshRelatedList('Activity', checkRefreshResult);}function refreshHistoryRelatedList() {sforce.interaction.refreshRelatedList('History', checkRefreshResult);}function saveAndRefresh() {sforce.interaction.saveLog('Task', 'Subject=ImportantTask&WhatId=[15-characterID of an account to which you want to attach the task]', function(result) {if (result.result) {refreshActivityRelatedList();} else {alert('Could not save the object! Check the developer console for errormessages.');}});}Refresh History Related ListSave and RefreshResponseNameresulterrorTypebooleanstringDescriptionReturns true if the related list with the given name is refreshed, falseotherwise.If the API call was successful, this variable is undefined. If the API call failed,this variable returns an error message.22

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!