Random SF Tips, Tricks & Gotchas
ISSUE: Can't create a new Campaign
- Are you in Unlimited, Developer or Enterprise Edition? If you're in Professional Edition, Campaigns will not be available.
- Only "Marketing Users" can create Campaigns. Check that your user account (or the one needing access) has the Marketing User checkbox selected.
ISSUE: Google Adwords, Sandboxes, and Deployment Procedures...
- Assuming you're not using the now standard "Google Ad-Words" application given to all NPOs (and most NPOs won't...), make sure it is uninstalled PRIOR to generating a new sandbox for development.
- Failure to uninstall prior to sandbox deployment (you cannot uninstall it within the sandbox) will cause the application deployment back to the production instance to be... non deterministic.
Tip: deploying custom fields from Sandbox to Production
Let's say you've already created a sandbox environment, and then you add some new custom fields to standard objects in your production environment. Now you want to add those fields to the sandbox.
Fire up Eclipse, and in your Force.com project open up src/unpackaged/package.xml. Find the XML element with the name of “CustomObject” and add in some new subelements with the value of the standard object. It should look like this:<types>
<members>*</members>
<name>CustomObject</name>
<members>Contact</members>
<members>Account</members>
</types>
Then, run the “Refresh from Server” functionality by right-clicking on src/objects and accessing the Force.com menu. Your standard objects should then appear.
Then go ahead and copy the xml for the field definitions from the standard object. Hopefully that will work!
Source: http://salesforceonrails.com/2008/custom-fields-on-standard-objects-in-the-force-com-ideTIP: Use Cross-object formulas to display field values from a related object
We used to have to write apex code if we wanted to pull field values from a related object onto another object. Back in the old days, if you had a custom object "Sponsorship", with a lookup relationship to Contact, and you wanted to display the Contact address on the Sponsorship object, you would have had to write code in the Sponsorship insert trigger to pull those values from Contact. And also code in the Contact update trigger to update those values on the Sponsorship object if they changed. Not to mention the test cases. What a pain! But now we have cross object formulas that will accomplish the same thing with no coding. To create a cross-object formula:
- Create a new field of type Formula on the object where you want to display the stuff from the related object.
- In the Advanced tab, choose Insert. This will bring up a list of available fields.
- Any field with ">" after it means it's a related object with more fields available. Click on it, and you will see all the fields from that related object.
- Choose the fields you want to display and proceed.
- Just remember, cross-object formulas are NOT roll-ups, they allow children to reference parents, but not parents to reference children.
TIP: Add a "Find Duplicates" button to the Account/Contact layout
Found a nifty way to add a link to the layout for Accounts and/or Contacts that will allow you to check for duplicate records-
For Accounts:
-
Create a Web Link for the account object as: https://na1.salesforce.com/merge/accmergewizard.jsp?srch={!Account_Name}
-
Add that Web link to your page layout call it "Find Duplicates."
-
Now go to an account and click the link!
For Contacts (Remember this will only find contacts that belong to the same account. It may be possible to modify the link to work across all accounts.) :
- Create a Web Link for the contact object as: https://na1.salesforce.com/merge/conmergewizard.jsp?retURL=%2F00130000004PRSX&id={!Account_ID}&srch={!Contact_FullName}
- Add that Web Link to your page layout
- Go to a contact and click the link!
