Authored by Zishan Razzaq

Wednesday, August 21, 2013

Lookup Field is on Page Layout but Users can not see it???

Hi everyone:

Scenario:

I got an email, where the User can not view this one field which is a lookup to another object within the current object but yet the had the following:
  1. FLS- Field Level Security - the field was visible to there profile
  2. It was on the page layout that was assigned to there profile
  3. Even checked the Accessibility Access within the field and it was required.
So then what can be the issue?

WHY CAN'T THIS USER OR ANYONE WITHIN THIS USER's PROFILE SEE THIS FIELD?
(THIS WOULD BE A GOOD SCENARIO FOR A SFDC ADMIN INTERVIEW)

SOLUTION:

The reason they can not see that field even with all the permissions there... The User's profile does not have access to that related object that field is looking up to.

So navigate to the user profile, go to the object that the lookup refers to and provide it read access or whatever your business requires to have access to.

Go back to the page log under that user and they now should see the field and everything should work properly....


Hope this helps
thanks
Zishan R

Monday, August 19, 2013

Field Integrity Exception - When trying to set Use Standard Price to True on Product via Dataloader

Hi all:
Scenario:
As an admin, I recieved a request to have all products within a particular Pricebook to utilize the Standard Price.

Issue:
When you try to update the USESTANDARDPRICE checkbox field in Salesforce via. Apex Dataloader for that product within that pricebook, you get an error:
"Field Integrity Exception"...

WHY???
Because when you try to do it thru Apex Dataloader, you have to update the price as well as updating that checkbox.

Picture it out:
I will walk thru the Manual Way and then thru Dataloader:

Manual Way:

1. Click on the Product Tab
2. Choose the Pricebook and click on Go








3. You will see a list of all your products under that pricebook.










4. If you select a product and Click on Edit, you can change the setting of that product to utilize the Standard Price and click save it will save. Which means everytime an user selects this product it will utilize the Standard Price automatically.

As you can see the List Price is now grayed out and the list price has changed or been overrides by the Standard Price once that is checked.



This done is the Manual Way but what happens if you have 1500 or more products then what...

Apex Dataloader way:

1. Export all the data from the PricebookEntry object for just the Standard Price Book.







a) Make sure you check off "Show all Salesforce objects"
b) Select Price Book Entry Object
c) Name this file "PricebookEntryStandardPriceBook.csv"
d) Click Next

 





 

2. Now time for our SOQL Query:
You can Select each field or copy and paste this SOQL query into the query box:

Select Id, Name, Pricebook2Id, Pricebook2.Name, Product2Id, Product2.Name, CurrencyIsoCode, UnitPrice, IsActive, UseStandardPrice FROM PricebookEntry where Pricebook2id='00B50000005ZRbX' and IsDeleted=False

NOTE:*****Pricebook2id='00B50000005ZRbX' <== This is my Standard Pricebook Id, you can get this id off from a report or Manage Pricebooks or thru the URL of the Pricebook record you are on.

Click on Finish and done exporting out all Standard Pricebook.

Now we need to Repeat these steps for the Pricebook you would need to update.
Remember to name the CSV file a different name
and Update the Pricebook2Id within the SOQL

Now, you can do this in access and run a query to update the UnitPrice to the pricebook affected from the standard pricebook or use Excel via VLookup..

What needs to be done is:
 1. Open your StandardPricebook csv
 2. Open your "Otherpricebook" csv
 3. Update the UnitPrice on the "Otherpricebook" to match the StandardPricebook Unit Price and Set the UseStandardPrice checkbox to True on the products that need to be updated.
4. Once done and you are comfortable, then it ready to Update via. Apex Dataloader.
5. The mapping of fields would be similar to this screenshot:



a) Make sure you check off "Show all Salesforce objects"
b) Select Price Book Entry Object
c) Make sure you select the correct file to "Update"













This is the way to update UseStandardPrice checkbox via Dataloader.

Hope this helps
Zishan R.