Sunday, May 31, 2015

SalesForce.com: Simple Trigger Example on Task Object

Below is a sample code snippet on how to create a trigger on a task object. The trigger updates a field in task object whenever an attachment is added to the task object.



Written by Prabha Krishnamurthy

SalesForce.com: Dates and Dataloader

While uploading date fields, here is a quick tip to set the data type in Data loader and csv for error free loading.

In the csv file set the date column format to one of the below format.

yyyy-mm-dd
yyyy-mm-dd hh:mm:ss
yyyy-mm-ddThh:mm:ssZ
yyyy-mm-ddThh:mm:ss.sssZ

In Data loader, go to settings and check the “Use european date format” to yes.


Written by Prabha Krishnamurthy

SalesForce.com: Limitations with Task Triggers and Attachments

Notes and attachments are standard SalesForce objects and are limited to have any custom fields defined. However, the parent object they are associated with can have a custom field that can be updated on changes made in Notes and attachment object.  

There is an exception to this rule and if the parent object is an Activity (Task), then the custom field of this object can be updated only when there is an insert trigger happening on associated attachment object. Any updates to an attachment object will not trigger change on the custom field of Task object.

This is an existing limitation in SalesForce and please note that trigger on attachment will not have any impact on Task object for update or delete. In this case define trigger on the Task object instead of attachment object. For other parent objects, the trigger can be defined directly on the attachment object.

Written by Prabha Krishnamurthy

Friday, May 29, 2015

MSCRM 2015: Opportunity Products: What you need to know (Part 1)



I recently worked on a project heavily involved with opportunities and the product catalog. During this time, I became very familiar with all of the inner-workings of opportunity products. In this series, I’ll review a few tips that will help you along the way and hopefully save you some time trolling forums for answers.

Inline Edit View


The sub-grid that appears by default on the Opportunity form is the Inline Edit View and it is not customizable. I found this to be frustrating because my client was not using all of the fields that appear in that view and I wanted to remove them.



I also did not want users to be able to write-in a product, only add existing. 
 

In order to achieve both of these requirements, I decided to get rid of the Inline Edit View and create a standard view for my opportunity sub-grid. When you use a custom view and try to add a new product, it will open in a new window. If you want to edit the details of a product that’s already on your opportunity, you have to open it in a new window. While this isn’t the most ideal functionality, it worked for my client’s situation.