Saturday, 24 March 2012

Loading Products and Price Book Entries

Product2:
Represents a product that your organization sells.

Pricebook2:
Represents a price book that contains the list of products that your organization sells
There are actually two Pricebook categories. One is Standard Pricebook and other is Custom Pricebook.
There may be more than one Custom Pricebook in an organization but only one Standard Pricebook.
In order to make a Product available for a Custom Pricebook(i.e. resulting PricebookEntry), the following conditions must be satisfied 
1. The Product must be in Standard Pricebook
2. The Product must be active in Standard Pricebook

PricebookEntry:
Represents a product entry (an association between a Pricebook2 and Product2) in a price book. PricebookEntry is actually a junction object between Product2 and Pricebook2 objects. Hence, it has two standard fields namely Product2Id and Pricebook2Id.

Loading Products:
 Load file must contain,
1. Name    
2. IsActive and other fields as needed by your application.

Loading PricebookEntries into Standard Pricebook:
Load file must contain, 
1. product2Id (use the Id's from the success log file of Product Insert Load)
2. pricebook2Id (get it by either from application/by Querying for Standard Pricebook)
3. UnitPrice
4. UseStandardPrice (True/False)
5. IsActive (True/False)
6. Currency ISO Code
7. other fields as per your application.






Loading PricebookEntries into Custom Pricebook:
Load file must contain
1. product2Id (use the Id's from the success log file of Product Insert Load)
2. pricebook2Id (get it by either from application/by Querying for Custom Pricebook)
3. UnitPrice
4. UseStandardPrice (True/False)
5. IsActive (True/False)
6. Currency ISO Code
7. other fields as per your application.

If Multi-Currency is enabled for your organization, then you are supposed to load one PriceBookEntry for each currency. Hence if you have "M" currencies in your organization and "M" new PricebookEntries are to be added..then a total of M*N entries need to be made.











Wednesday, 8 February 2012

Simple.......... but Powerful Report Naming Convention

Almost all of the salesforce pages contain Section Header with Object Name above and Record Name below, as depicted here


This helps us to recognize and analyse things faster. But this convention was not explicitly available in Report & Dashboards.


Whenever we name a new report in salesforce, conventions like Hyphen (-), Comma (,), Space etc., were used in between words and these were replaced by an underscore in their API Names on a TAB hit.


These conventions cannot be avoided as we try to make report labels more understandable and meaningful. Usage of these conventions would be high, when several report labels follow  same pattern like


1. User Report-Mexico-West
2. User Report-Mexico-North
3. User Report-Mexico-East
4. User Report-Mexico-South


Suppose if we name and save a report as below,



which results in,




Suppose if we want to display the section header following hierarchy, then follow the convention of using colon(:) between Title and Subtitle.
Below image illustrates a report labelled and saved as Users Report:West ,



Interesting.. Isn't it? ........ and Hence the post name "Simple.......... but Powerful Report Naming Convention"


This behavior  can also be noted when a report is under creation,





Note: This convention may be followed and not neccessary