Pages

Monday, December 31, 2012

Salesforce Customer Community

You have technical question on Salesforce.com configuration? There are few place to ask questions:

1. Salesforce Customer Community
This is forum supported by Salesforce and answer by Salesforce user community global. Post your questions from http://success.salesforce.com/answers. Usually a 'hero' (like SteveMo, phiberoptik, etc) will answer your questions. But as this is a forum, don't expect your questions will always response. Try to post your questions as clear as possible.

This forum particularly only for Salesforce admin, if you are not admin, please check with your admin before post questions here.

2. Salesforce Support
Open a case from 'Help & Training' link next to your name in Salesforce.com top right corner. Click "Contact Support" and "Open a Case". You also can "Ask the Community" from this page, which will be redirect to the same Customer Community above.

If you do not purchase Premier support or using Unlimited Edition, please expect 2 business days response. For Premier support customer, response time is 2 hours.


As today is the last day of 2012, I would like to say "Happy Holiday and Happy New Year 2013, may the year of 2013 ahead bring all of us a better health, prosperous in love and live. GBU!"

Also, today I hit rank #5 for the first time in Salesforce Community Support.





















Using Salesforce Content and Chatter File to share file

Two months ago, I wrote a blog on how to publish image or document to public using Salesforce.com easily using Document. It works well, but Document have some limitation, very basic and do not have security:
- Cannot set password protection
- Cannot set expiration date
- Do not have visibility on view count, first and last file viewed
- Do not link to a record in Salesforce
- Do not have build-in preview
- Do not have version capability
- Maximum up to 5 MB of file size, more information here
But, document still a good option to sharing file internally with security of access implemented in Folder.

In this blog, I would like to share using Content Delivery and Chatter Files to share file with public.

Content Delivery

1. Enable Content Delivery.
Contact Salesforce support to activate Content Delivery (if it has not been activated), don't be afraid as this feature is free. To check if Content Delivery is activated, navigate to Setup - Customize  - Salesforce Files - Settings - Content Deliveries, if you see Content Deliveries menu here, your instance already has been activated with Content Delivery. Make sure Enable content deliveries is checked.


2. Add Content Delivery related list to the page layout, example to Account.

3. From object (in this sample Account) page layout, scroll to Content Deliveries related list added and click button Deliver Content.

4. Choose a file to upload and follow the wizard, you can rename delivery name, set notification, expiration date, and password. If your file is Microsoft Office file, you have more option for Delivery Method.


5. Done. You can pass the URL to your business partner securely and you know if when he open the file.

Using Content Delivery, you can upload file size up to 2 GB, compare this to Document which only 5 MB. For more information on setting Content Delivery, click this link


Chatter Files

Another option to publish file using Chatter File.

1. To share via Chatter File, you need to activate in Content Delivery as well, see points above to activate Content Delivery.

2. After Content Delivery activated, make sure Enable Creation of Content Deliveries for Chatter Files is checked.


3. Once Enable Creation of Content Deliveries for Chatter Files is checked, to allow user to share file via link, add permissions Create and Share Content Deliveries for Chatter Files in user profile to allow user to share file via URL.

4. Go to Files tab, upload file. You will see a new menu Share via link



5. Done. URL created will have the same format with Content Delivery link.

For more information on sharing Chatter files via link, click here


Few items to note using Content Delivery and Chatter Files
  1. Using Chatter File, you do not have option to download in PDF, enable password, enable expiration date, notification and timestamp when the file open.
  2. Although file uploaded via Content Delivery will be in Chatter Files, but you will not have "Share via Link" menu option.
  3. Both Content Delivery and Chatter File support up to 2 GB of file size limit.
  4. Both Content Delivery and Chatter File support file preview.
  5. Both Content Delivery and Chatter File allow you for upload new version. To upload new version for Content Delivery file, go to Content Detail Page in Chatter File.
  6. To delete file uploaded via Content Delivery, go to Content Detail Page in Chatter File.

Reference:



Wednesday, December 19, 2012

Cross-Object Workflow in Salesforce.com

With Spring '12 release, cross-object field update in workflow rules and approval processes is now support standard objects. Both custom-to-standard and limited standard-to-standard relationships are supported. This feature only available in Enterprise and Unlimited edition.

Only Master-Detail relationship support for cross-object workflow, so it is not for objects with Lookup relationship.

Here is a sample case of using Cross-Object workflow.
Master object: Customer__c
Child object: Order__c
Company would like to know how total amount and when latest order for each customer, use payment date instead of order date. Payment date will be blank when customer have not make payment.

Here we go:
1. Create a workflow in Order 
Evaluation Criteria : Evaluate the rule when a record is created, and every time it’s edited
Rule Criteria:
NOT ISBLANK( Payment_Date__c ) && 
( Payment_Date__c >= Customer__r.Payment_Date_hidden__c || 
ISBLANK( Customer__r.Payment_Date_hidden__c ))

Explanation:
- if Payment Date in order is blank, stop workflow
- if Payment Date in order is newer than stored Payment Date in customer, proceed workflow OR if stored
Payment Date in customer is blank



2. Create a field update action in Order
Update Payment Date in Customer
Select object = Order
Field to Update = Customer, the select field Payment Date
Formula Value = Payment_Date__c from Order



3. Create a Roll-Up Summary field in Customer for Total Amount
Create new Roll-Up Summary field from Customer object
Summarized Object = Orders
Select Roll-Up Type = SUM
Field to Aggregate = Amount
Filter Criteria = Payment Date NOT EQUAL TO blank


Last one, remember to Activate the workflow.

If you see in above process, workflow in Order will update field in the parent object Customer. So, it is cross-object workflow field-update.

The same solution you can use to update Account from Opportunity, example: if opportunity is Closed Won, automatically update Account Type to Customer.


For more information and standard objects supported, see this release document and find section Cross-Object Workflow. 

Thursday, November 29, 2012

Record Type in Salesforce.com

If you are using Salesforce.com with Enterprise, Unlimited and Developer edition, Record Type is a powerful feature. We can define business processes, picklist values, and page layouts to different users based on their profiles. So, even for the same object, user can have different page layout with different fields, different picklist value and etc.

But, sometimes admin overkill of Record Type usage. Not all condition need to use record type, may be a custom picklist field is enough. Please note that record type is different with a normal custom field and you cannot just edit record type like normal picklist field.

So, when do you need to setup record type?
1. Different Page Layout
Same user need to see different page layout based on a type. User will see different field position, required fields, buttons, related list for the same records.

2. Different Picklist Value
Configure available values in picklist field depends on the record type.

3. Assign record type only for certain profiles
We can set available record type and default record type for each profile.

This is some scenario you do not need to setup record type actually
1. Use as Type picklist
This is very bad, do you notice once you have record type, when user create new record, they have to select a record type before come to the main screen, so please plan ahead correctly.

2. Page layout usage
Not always need to have record type to differentiate user not see some fields in page layout. Admin can adjust using field level security, so some profiles will NEVER see that field, in page layout, report, etc.

Once you have more record type, it is more effort need to maintain, so if possible use less record type.

Here link to record type cheat sheet from Salesforce.com

Sunday, November 18, 2012

Salesforce.com Queue SOQL

Queues allow groups of users to manage a shared workload more effectively. A queue is a location where records can be routed to await processing by a group member. The records remain in the queue until a user accepts them for processing or they are transferred to another queue. You can specify the set of objects that are supported by each queue, as well as the set of users that are allowed to retrieve records from the queue.

Queues available in almost all Salesforce.com edition, from: Contact Manager, Group, Professional, Enterprise, Unlimited, and Developer. Queues can be created for Leads, Cases, Knowledge article version, Service contract and custom object which not a child object in a master-detail relationship.

SOQL to query all queue:
Select g.Id, g.Name, g.Email from Group g where g.Type = 'Queue'

A queue can assign into one or  many objects, here SQOL to retrieve object assigned in a queue:
Select q.Id, q.QueueId, q.Queue.Name, q.SobjectType from QueueSobject q

Note: you can you Apex Data Loader to mass insert or mass update the data in Group and QueueSobject object.

Click here for Salesforce.com help link for queues overview.

Wednesday, November 14, 2012

Salesforce: Custom Button to pre-populate Fields

Out-of-the-box, when we create a new record from a parent object related list, Salesforce.com provide parent name pre-populated in child object. This is efficient and save time, user do not need to look for the parent record again.





This is good, but, often we need more fields to be pre-populated for some scenario and make our (read: Salesforce users) life easier :)
We can make this happen by create new custom button whether in related list or in page layout. In this sample, we'll use Account as parent and Opportunity as child.

NOTE: This is considered a URL hack and it is not supported by Salesforce. Using undocumented query strings is absolutely discouraged as Salesforce can change them at any time without notice.

Custom button in page layout
Go to Account object in Setup menu and choose Buttons and Links. Click New button and select option as screenshot below. Once button created, you need to add the button into Account page layout.


Custom button in related list
Go to Opportunity object in Setup menu and choose Buttons and Links. Click New button and select option as screenshot below. Once button created, you also need to add the button in Opportunity related list in Account page layout.





OK, now we understand how to create the custom button, but what is the URL??? Here we go...

If you click Opportunity button in related list, see the URL
https://na1.salesforce.com/006/e?retURL=%2F0019000000DjwR5&accid=0019000000DjwR5&RecordType=01290000000NLfk&ent=Opportunity

So, what is the parameters and values? Let's parse it:
https://{instance}.salesforce.com/{object_prefix}/e?retURL=/{!Object.Id}&accid={!Object.Id}&RecordType={RecordTypeId}&ent={object_name}

In this sample there is record type in Opportunity and we want to skip Record Type selection page when user click new Opportunity by populating Record Type Id in the URL. So, this would be the URL:
/006/e?retURL=/{!Account.Id}&accid={!Account.Id}&RecordType=01290000000NLfk&ent=Opportunity


Now, we want to pre-populate other field from Account. Here we go... you need to find out the Id of textbox from web browser, in page edit the record and right click at textbox then select Inspect element

Once you get the id, add it into the URL:
/006/e?retURL=/{!Account.Id}&accid={!Account.Id}&RecordType=01290000000NLfk&00N90000000iQg4={!Account.Hello__c}&ent=Opportunity


Custom object
Parameter for pre-populate for lookup to an custom object id different, see sample below:
https://na1.salesforce.com/a0E/e?CF00N900000022p5z=Object+2A1&CF00N900000022p5z_lkid=a0D90000001OPvT&saveURL=%2Fa0D90000001OPvT&retURL=%2Fa0D90000001OPvT

Let's parse it:
https://na1.salesforce.com/{object_prefix}/e?CF00N900000022p5z={parent_object_name}&CF00N900000022p5z_lkid={parent_object_id}&saveURL=/{parent_object_id}&retURL=/{parent_object_id}

Notice that parent name is CF00N900000022p5z and parent id is CF00N900000022p5z_lkid and a new parameter saveURL to redirect the page after user hit Save button.


Considerations
Before you add more and more fields pre-populated, please consider this:
  • Sometime, if field in child object is not edit-able, consider to use formula field in child object
  • If the field do not need to copy from parent, you can hardcode it into the URL
  • To pre-populate data with some logic, you need visualforce page with apex code.

Video
Video created by 'Christian Deckert' is simply good to guide you step-by-step in creating URL for your custom button.


Auto-save
Some of you may looking for a way to autosave the record, Salesforce used to support parameter save=1, but for security reason to prevent Cross-Site Request Forgery (CSRF), this parameter has been removed.
You may look for AJAX toolkit to update + save record from a button.

Page-level ad