Pages

Monday, January 28, 2013

Salesforce login parameter

As normal user, we access Salesforce.com from web browser https://login.salesforce.com to access production instance or https://test.salesforce.com to access sandbox instance (if you have any).

But, some organisations need to access Salesforce directly from another application (and not implemented SSO), we can add username and password include as login parameters to direct login to Salesforce, here we go:

https://www.salesforce.com/login.jsp?un=user@email.com&pw=secret

The same applied for sandbox:
https://test.salesforce.com/login.jsp?un=user@email.com&pw=secret

You also can redirect user to a specific record, such as: account, contact or report:

https://test.salesforce.com/login.jsp?un=user@email.com&pw=secret&startURL=/00190000005lXMZ

NOTE: Since your password is in the URL, everyone could see it, so be cautious.



Salesforce Searchable Field

As Salesforce admin, sometimes we confuse when user come to us and ask, why a record not return in search result when I search Phone Number or Email or a custom picklist field.

Here is the guide on searchable field types in using Salesforce global search:
  • All custom auto-number fields and custom fields that are set as an external ID field (you don't need to enter leading zeros.)
  • All custom fields type: email and phone
  • All custom fields type: text, text area, long text area, and rich text area
You see that FORMULA field is not searchable, it make sense because formula field is not stored in database.

When user search for a value, for records contained that value, global search result will include those records, even field contained for the search value is exist in a field that are not visible for that user, because of field-level security setting. Ideally, if user cannot see the value on that field, it should be not search-able for that particular user, vote for this Idea, currently it have only 160 point (9/9/15).


However, not all standard field is searchable, example: for Account only following fields are searchable:
  • Account Name
  • Account Name (Local)
  • Account Number
  • Account Site
  • Billing Address
  • Description
  • D-U-N-S Number (This field is only available to organizations that use Data.com Prospector)
  • Fax
  • Phone
  • Shipping Address
  • Ticker Symbol
  • Website
  • All custom auto-number fields and custom fields that are set as an external ID (You don't need to enter leading zeros.)
  • All custom fields of type text, text area, long text area, rich text area, email, and phone

For complete searchable fields by object, see this reference below.


Reference:


Salesforce converted currency in report

In Salesforce, there is a field type "currency", for example, Amount in Opportunity, and we can also create custom fields with the data type of currency.

If you enable multi-currency in your Salesforce instance, and if the record currency is not in your user currency, you will see your user currency show in parenthesis after the amount.

In the report, you will find the (converted) fields for each currency field. You can add it to the report like another normal field. But, you cannot add the converted field as a report filter (as of now).

Solution: use original currency as a filter and add currency code. Example: USD 300, SGD 500, JPY 10,000 and etc.

Thursday, January 24, 2013

How to add single quote at beginning and end of word

For you who do query a lot to a database, from: MSSQL, Oracle, including Salesforce.com, you may need to think is there anyway to add single quote at beginning and end of words and add comma after end of word. It is very time consuming if you need to add it manually if you want to query for 500 Id.

You can do this much faster using tool, such as TextPad, download from www.textpad.com and install it.

Let say you need to query for Id from an Excel file. Copy and paste the Ids into TextPad, example:


Go to Search menu and select Replace... or F8 for shortcut
in Find What: .+
in Replace With: '\0',
in Conditions: select Text and Regular expression 
and click Replace All.



And the result:


You may need to remove comma in last line. So you can put this Ids into your query filter, example:
SELECT Id, Name, Email FROM Contact Where Id IN ('0038000000zYkACAA0',
'0038000000zYkE5AAK',
'0038000000zYkJWAA0',
'0038000000zYlBIAA0',
'0038000000zYl8xAAC',
'0038000000zYkKSAA0'
)


If you are using Notepad++ since it is free, change to this:
in Find What: .+
in Replace With: '$0',
in Search Mode: select Regular expression 


Wednesday, January 16, 2013

Salesforce: How to get Approval Process status

Out-out-the-box, Salesforce.com has Approval Process featured with lock mechanism to lock record has been submitted for Approval, so user unable to change the record.

But, Salesforce.com do not provide approval history by default. So, user cannot run a report to show which records has not approved or approved or rejected. Ideally, admin should configured field update actions to update a field with current status: pending, approved, rejected or recall.

I meet a situation where approval process has been setup and deployed for few months back, but later user  realize unable to run report on the approval status. How we can get the approval status for all opportunity has been submitted for approval? Is it possible, any workaround?

YES, as long as you are in Enterprise Edition or Unlimited Edition or Professional Edition with API enabled.

Here is the steps:
1. Run SOQL with query syntax Select p.TargetObjectId, p.Status from ProcessInstance p then  export into CSV or Excel file.

2. Export all Opportunity with Id into CSV or Excel file.

3. Open both files in Microsoft Excel as two worksheets, then use VLOOKUP() function in Microsoft Excel to get all Opportunity with approval Status from ProcessInstance object. Status should be: Pending, Approved, Rejected, Removed.

Good luck and hope this solution help.

Friday, January 11, 2013

Salesforce: Master-Detail relationship (roll-up summary)

One of the most advantage using Master-Detail relationship compare to Lookup relationship is Roll-Up Summary. In Master-Detail relationship, we can create roll-up summary field in master record to summarize / count data from child records. I wrote a blog earlier for Master-Detail relationship. This blog on roll-up summary field and the field type.

More items to notice when create roll-up summary field:
Parent record is locked
If you implement approval process with lock record in master object, user will not able to create new child record if Sharing Setting in Master-Detail option is Read/Write.
Solution: change the sharing setting to Read Only.



Validation rule on parent record
If user not able to edit parent record because of validation rule, and you have roll-up summary in parent record, user will not able to create or edit child record.
Solution: remove roll-up summary fields.

Can I change field type from Master-Detail to Lookup relationship?
Yes, make sure there is no roll-up summary fields in parent record, also in Deleted Fields (erase from Deleted Fields).

Can I change field type from Lookup to Master-Detail relationship?
Yes, all parent record should be not blank.



Page-level ad