Pages

Thursday, March 27, 2014

Salesforce: Not able to see Quota in User detail

In previous blog, we shared about how to make a super user able to edit any user Quota using Delegated Administration. This is working fine, until one day, one of my super user complain that she no longer able to edit the Quota, because the Quota related list is not showing at all in the user detail.

After long check, this is caused by user profile do not have read permission on Product.
We removed read permission on Product in a clean-up activity, simply because we do not use Salesforce Product. But, that cause Quota related list in User detail gone and super user not able to edit it.

Look at Forecast Settings from Setup | Customize | Forecasts (Customizable) | Setting, we use Forecast Type = Use Product Families.



After enable read access on Product, all working back as usual :)


Monday, March 17, 2014

How to change email sender in Salesforce?


By default, when you send email from Salesforce from Send an Email button, you will not select the email sender, it will be user name with corresponding email address.


But, in some case, user need to send email using other email address. Example: for team service.

Here few ways configuration you can do out-of-the-box from Salesforce:

1. Outgoing Email Settings
This setting do not need admin to enable or change it, user can do it by themselves. This setting is good when only effect to a few user and do not need to change the sender user name.
Go to Setup | My Stettings | Email | My Email Settings
Look for information on Email Address and change the email address.
You need to verify the email address, Salesforce will send email address to the new email address for you to verify. Once done, you will see option From with email picklist when send email, but username will remain the same. This email will be default email address when send email.



2. Organization-Wide Email Addresses
This setting will need system administrator involvement and will effect to users in a profile, many profiles or ALL users.
Go to Setup | Email Administration | Organization-Wide Addresses
Click Add button and enter Display Name, Email Address and Select Profile or All Profiles.

When you send email, this email will be available as a picklist for user with profiles allowed to use this Organization-Wide Email Addresses. You'll notice the sender name is different with user name.



Reference:

Saturday, March 15, 2014

How to change Salesforce text colour?

As you all aware, Salesforce text in web user interface (UI) is only with black and dark grey colour, that's all and you not able to configure it.
But, is it possible if I need to have a red colour for some text or text with some conditions in the page layout so my user can notice something quickly?

Yes, but it is not easy, meaning you need to do something. Visualforce and with apex code if necessary.

Here a sample visualforce page using standard Account controller for account page layout:

<apex:page standardController="Account">
<apex:outputText value="The unformatted time right now is: {!NOW()}" />
<br/>
<font color="red">
<apex:outputText value="The formatted time IN GMT IS : 
{0,date,yyyy.MM.dd G 'at' HH:mm:ss z}">
<apex:param value="{!NOW()}" />
</apex:outputText>
</font>
</apex:page>

As you can see, we just use standard HTML <font> color attribute, this mean you can use other standard HTML tags in visualforce as needed.

Add this visualforce page into Account page layout and you are done.


This is the result, see text in red:


Make sure your visualforce is using standardController rather than Controller, if you need logic with apex class, add extensions in vf page, example: <apex:page standardController="Account" extensions="MyController">
Otherwise, you will not able to add the visualforce page into standard page layout.


Reference: How to embed Visual Force page in a page layout?


Saturday, March 8, 2014

Salesforce: How to Send Email with Default Template?

Send an Email is standard Salesforce functionality, if your Salesforce admin make the button visible in Activity History related list for that object page layout, user can just hit the button and enter email detail -- To, Additional To, CC, Subject, and Body. Email should related to a record. Optionally, user also able to select a Template, where within template, email Subject and Body can be determined using merge fields. This will increase user productivity when user always send email with the same format.

But, can we make user even more productive? When user hit Send an Email button, template will be auto select, and recipients also auto populated based on field in the record.

Yes, this is possible to use custom button and URL hack, meaning there is no support from Salesforce and it maybe break one day if Salesforce change in their back-end.

Scenario: to send email from Opportunity record, template is auto-populate, email Related To auto related to the opportunity, Additional To auto populate from an email field in Opportunity, CC will come from another field and hard-coded with another email address.

1. Create a custom button at the object


2. Let's analyze the script:
location.replace('/email/author/emailauthor.jsp?retURL=/{!Opportunity.Id}&p3_lkid={!Opportunity.Id}&p24={!Opportunity.Email_Custom__c}&p4={!Opportunity.Acct_Email__c},myemail@gmail.com&template_id=00X50000001FypB&p5=xyz');

another sample to implement this for Case:
location.replace('/email/author/emailauthor.jsp?retURL=/{!Case.Id}&p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&p4=yujohan@gmail.com&template_id=00X50000001FypB&p5=xyz');

Explanation:
retURL : used when use hit Cancel button, page will be back to original report, in this case is Opportunity
p2_lkid : this is id for To
p3_lkid : this is id for Related to, see screenshot below on how to get that Id
p24 : this is id for Additional To
p4this is id for CC, see have 2 email address here, one from a merge field and one is static
template_idthis is field id to determine which email template to be auto load, you can get the template Id from template URL, example: https://na3.salesforce.com/00X50000001FypB?setupid=CommunicationTemplatesEmail

Now, how to get the id? If you are using Google Chrome, right click edit page in Salesforce and select "Inspect Element", see screenshot below:



See that id "p24" is related to Additional To, using the same way you can get all field id to use :)


Note
  • This custom button need to add into Opportunity page layout, button will be in Opportunity detail, not in the Activity History
  • You can implement the same for other object: Case, Contact, custom object and etc.




Friday, March 7, 2014

How to load Created By, Created Date, Last Modified By ID, Last Modified Date in Salesforce?

By default Created By, Created Date, Last Modified By ID, Last Modified Date will be auto-populated when user create or edit a record. But in some scenario, admin need to populate that information manually, example: for legacy data migration.

We have an issue when need to load Close Date for Case records. We can load close date manually, but the issue is, our Close Date is before today date and Salesforce not allow it.

The solution, we need ability to load Created Date before Close Date.

In order to have edit access to these fields, log a ticket to Salesforce.com Support, provide information of how long you need this to be turn on and the business justifications.
Salesforce.com Support can enable edit audit fields, which allows users to set these fields when creating the record. Since these fields are intended to be audit fields, users will only be able to set them on CREATE, not UPDATE.

Reference
How to specify the values in Created By, Created Date, Last Modified By ID, Last Modified Date

Monday, March 3, 2014

Salesforce: List View not visible in Change Set

When you have many List View available to all users or certain group of users, you can deploy the List View using Change Set. List View deployed will include Name, Filter Criteria, Fields and Visibility. This is good after user tested and sign-off in a sandbox.

Of course you can create the List View manually, but it is prone with human error, some items may not properly re-create.

Some of you may experience when try to add a List View into Change Set Component, but you do not see that List View. Why???


Scenario below may cause the list view is not visible:

1. Check the Filter Criteria of that List View. Confirm that List View is not filtered by a Queue. Even you can deploy Queues as component, but any object referencing a Queue cannot be moved through Packaging or Change Sets.

2. Check the Visibility of the List View. Confirm it is either Visible to all users (Includes partner and customer portal users) or Visible to certain groups of users. List View Visible only to me will be not visible in Outbound Change Set component.


ReferenceSalesforce Change Set


Last update: 24 Jun 2016