The <apex: logCallPublisher> is another important component for designing the Log a Call action. With the help of the <apex: logCallPublisher>, we can do the following:
We can change the appearance and dimensions of the Log a Call action.
We can specify the fields which we need to display in action.
We can define the visibility and label of the submit function.
We can define the onSubmit functionality.
The <apex: logCallPublisher> component has the following attribute:
1. autoCollapseBody
The autoCollapseBody is a Boolean type attribute used to specify whether the Log a Call body is collapsed or not when it is empty.
Syntax
<apex: logCallPublisher autoCollapseBody="true"></apex: logCallPublisher>
2. entityId
The entityId is an Id type attribute used to specify the entity id of the record to display the Log a Call action. This attribute in the current version supports only case record ids.
Syntax
<apex: logCallPublisher entityId="caseId"></apex: logCallPublisher>
3. id
The id is a string-type attribute, i.e., a unique identifier that allows this component to be referenced by other components on the page.
Syntax
<apex: logCallPublisher id="logId"></apex: logCallPublisher>
4. logCallBody
The logCallBody is a string-type attribute used to specify the initial text value of the Log a call body when the action is rendered.
Syntax
<apex: logCallBody logCallBody="logBody"></apex: logCallPublisher>
5. logCallBodyHeight
The logCallBodyHeight is a string-type attribute used to specify the height of the log call body in em.
Syntax
AD
<apex: logCallBody logCallBodyHeight="20"></apex: logCallPublisher>
6. onSubmitFailure
The onSubmitFailure is a string-type attribute that specifies the JavaScript method invoked when the call is not logged successfully.
Syntax
<apex: logCallBody onSubmitFailure="failureMethod"></apex: logCallPublisher>
7. onSubmitSuccess
The onSubmitSuccess is a string-type attribute that specifies the JavaScript method invoked when the call is logged successfully.
AD
Syntax
<apex: logCallBody onSubmitSuccess="successMethod"></apex: logCallPublisher>
8. rendered
The rendered is a Boolean-type attribute used to specify whether the component is rendered on the page. The boolean value true is set as a default value for this attribute.
Syntax
<apex: logCallBody rendered="false"></apex: logCallPublisher>
9. reRender
The reRender is an Object type attribute that specifies the Ids of one or more components that need to be redrawn on the page when the call is successfully logged.
Syntax
<apex: logCallBody reRender="false"></apex: logCallPublisher>
10. showAdditionalFields
The showAdditionalFields is a Boolean-type attribute used to specify whether the additional fields defined in the action layout should be displayed.
Syntax
<apex: logCallBody showAdditionalFields="true"></apex: logCallPublisher>
11. showSubmitButton
The showSubmitButton is a Boolean-type attribute that specifies whether the submit button should be displayed.
Syntax
<apex: logCallBody showSubmitButton="true"></apex: logCallPublisher>
12. submitButtonName
The submitButtonName is a string-type attribute used for specifying the name of the submit button in the Log a Call action.
Syntax
<apex: logCallBody submitButtonName="Save Call Log"></apex: logCallPublisher>
13. submitFunctionName
The submitFunctionName is a string type attribute used to specify the function's name from JavaScript to publish the call log.
Syntax
<apex: logCallBody submitFunctionName="funcName"></apex: logCallPublisher>
14. title
The title is a string type attribute used to specify the title displayed in the Log a Call action header.
Syntax
<apex: logCallBody title="Log Call Title"></apex: logCallPublisher>
15. width
The width is a string-type attribute used to specify the width of the action, either in pixels or percentages.
Syntax
<apex: logCallBody width="Log Call Title"></apex: logCallPublisher>
Let's take an example to understand how we can use this component on the VF page:
ApexLogCallPublisherExample.vfp
<!-- apex page with case standard controller to demonstrate the functionality of apex logCallPublisher-->
<apex:page standardController="Case">
<!-- use logCallPublisher with some attributes -->
<apex:logCallPublisher entityId="{!case.id}"
title="Make a Call"
width="50%"
submitButtonName="Make Call"
autoCollapseBody="false"
showAdditionalFields="false">
</apex:logCallPublisher>
</apex: page>