Hot answers tagged

11

The error is in your Status. In the trigger you've got: if (l.Status =='Open- Not Contacted') (note the n- N), and in your test class you create it as: ld.Status='Open -Not Contacted'; (note the n -N). That misplaces whitespace is probably the reason why that line is not getting covered Edit: Try to use constants for this kind of things. It will make ...


10

When converting leads, you are prompted to add to an existing account or contact. After you convert the first one, you can attach to an existing Account. Note, that I like using leads for only un-qualified leads. Once I have qualified them, I convert them to an Account of type Prospect and then create an opportunity that I start tracking.


9

This seems to be possible. I just performed this simple test as a user without that permission without any problems, so if I understand the question correctly I think the answer is yes. Page: <apex:page controller="TestQueueMembership"> <apex:messages /> <apex:form > <apex:commandButton value="Test" action="{!toggle}"/...


8

Depending on how many leads you are getting daily, you may be able to plead your case to your rep and get the value increased. Shell Black has verified this is possible. If it is consistently much higher, you would be better off creating a custom solution to generate your leads via the API.


8

Leads have specific uses: queues, lead assignment rules, auto response rules, web-to-lead, "unread by owner" field, campaign integration, and reporting. Let's go over each feature in more detail, shall we? Queues Queues let groups of people pick from a common pool of leads they want to follow up on. Very few organizations use this feature as it is, I ...


8

Great observations. I've encountered these are two variations: someone who logs into the AppExchange and clicks Get It Now will have: lead source SFDC IN|PackageName appropriate campaign membership a Trial license created someone who holds the package install link (eg by copying it out of the URL) will get: lead source Package Install no campaign ...


6

There is the idea that is worth promoting: Create workflow based on unread leads As you have found, the IsUnreadByOwner field changing doesn't fire an update trigger. Could you use the difference between the CreatedDate and LastModifiedDate fields in a formula to indicate the record has been processed? Maybe combined with the OwnerId and LastModifiedById ...


6

Your problem is in this piece of code: List<Contact> leads = [ SELECT Id, Email FROM Contact WHERE Email IN :leadEmails ]; for(Lead singleLead:leads){ singleLead.Status = 'Converted'; } Notice how yourleads variable is a List<Contact>. You then try to loop over that list and cast each item in the ...


6

I don't think you can attached related items to a converted lead. When a lead gets converted all the Attachments and activities get transferred to the Account and/or contact. Since you are importing, do you have an equivalent Account or Contact for the converted lead? You import the activities and notes and attachments to those records instead. Or ...


6

Lead reassignment within a trigger can be done with future methods such as the following. Your after insert / after update trigger will need to collect up a set of lead ids that qualify for reassignment and then once all other afterinsert/afterupdate operations are complete, call the future method below: Note use of DmlOptions: @future public static void ...


6

The documentation doesn't clearly state "why not" (and this is a very common scenario with the documentation) in regards to leads and Sandbox installs, but I'd take an educated guess and say that Sandbox installs would most likely duplicate leads from one of the other four sources (production installs, test drives, demos, or trials), and are therefore too ...


6

Figured this one out myself - hopefully this answer helps someone else. In the lead settings, there is a setting to Override the existing record type with the assignee's default record type. Updating this to keep the existing record type solved the issue for me. See screen below:


6

Steve, I'm guessing the problem is that you don't have any Zip_Code__c objects defined in the test environment! Remember, tests run with no standard SObjects, they don't have access to your data. You need to manually create any objects you're going to use. How does the following work for you? @isTest private class AssignLeadOnCreate{ static testMethod ...


6

You can't put "executable" code outside of a method. Also, to actually have a unit test, you need a method marked with @isTest or testMethod. You also have a few other minor issues. @isTest public class TestNoteOnInsert { @isTest static void test() { Lead testLead = new Lead(); testLead.FirstName = 'Test first'; testLead.LastName ...


5

Short answer, yes, if the object is in a time-based queue, and its criteria changes to no longer fire that rule, it will be removed. Longer answer, this article details the common approaches to the problem you're seeing and may give you some ideas for other solutions to the problem.


5

On your first question: We have configured our AppExchange listings to receive a new lead on install regardless of the type of org. This is just a matter of adjusting settings on the Leads tab of the publishing console in AppExchange and associating a Campaign record with the "Send me leads on install" line. Combined with a lead assignment rule we get an ...


5

You can make the field not required by requesting Person Accounts be enabled in your organization. Failing that, there would necessarily be a before insert trigger in play. It may be in a managed package installed, in which case you may not be able to determine the origin of the update.


5

I've recently tested for all the cases dealing with Leads coming from the AppExchange (SFDC-XX) and Leads coming from an actual Package installation. As expected, it's pretty confusing at times. Here's a flowchart that explains everything, depending on whether an individual chooses to install your app on a Production/Dev org or a Sandbox.


5

The two most highly rated free de-duping Apps on the App Exchange are Dupe Catcher and Duplicate Check. Some of the features in the latter are available only in the paid version while everything in Dupe Catcher is completely free. As part of full disclosure, I'm not financially associated with either company but have met some of the employees of Symphonic ...


5

You set the individual fields, such as BillingStreet, BillingCity, BillingState, BillingPostalCode, and BillingCountry (plus the geolocation codes, as well, if you prefer). The address complex field is a convenience field derived from the parts, just as a contact or lead's "Name" field is really a concatenation of the various parts of their name (first, last,...


5

According to this documentation, they will move: Any related items from any of the duplicate accounts will be associated with the newly merged account.


5

Found it - at least the closest I could find: If you're using a custom field in Salesforce on both leads and contacts, we pull the name of the Salesforce field from the contact field ID. ... We recommend that each Salesforce custom field you map has its own unique API name as Pardot will not respect case sensitivity when syncing. For example if ...


5

The reason for this issue is that the relatedList is not named "Campaign Histories" Use: <apex:relatedList list="CampaignMembers"/> apex:relatedList list= values have to be valid relationship names taken from the schema. The friendly name as shown to the user is confusingly only tangentially related to the real relationship name.


5

To hide the button This can be done with record types and page layouts Create two record types - one for Leads with stages up to but not including the stage that allows conversion one for Leads in stages that allow conversion Create two page layouts (use page layout assignment) one for the first record type,. Remove the Convert button on the page ...


5

This is probably one of those situations where you have a tradeoff between cost and time. When I (well, me and my intern) needed to sort through roughly 30,000 Contact records to 'deduplicate' and 'merge' when my org implemented the feature to allow Contacts to be related to more than one Account, we used Microsoft Excel to handle the bulk of the work. The ...


5

I think, you are creating time based action based on created date and this time based action is getting queued. I would suggest you to create a separate datetime field, let's say Action DateTime which will initially be populated as created date + 7 days. If any action has taken on the lead then mark this Action DateTime as blank. Your time based action ...


4

This could be a Scheduled Apex Class. It could run once a day, or week, find all the matching Leads, group them by User and email each applicable user with their list of neglected Leads. It will remind them every day/week/whatever for an indefinite period of time until they fix the offending records. This is not a huge amount of work, but if you don't need ...


4

Whenever we try to get from Map we usually put a null check to avoid null pointer exceptions For example for ( Account account : [SELECT PersonEmail FROM Account WHERE PersonEmail IN:leadMap.KeySet()] ) { // Lead newLead = leadMap.get(account.PersonEmail); Modified like this for ( Account account : [SELECT PersonEmail FROM Account WHERE ...


4

The Web-to-Lead function allows you to set up a form post to Salesforce to create new Lead records - documentation, video.


4

I believe when Converting a Lead, it sets the Opportunity Stage to the first Stage listed in your Sales Process. Please check the first stage in the Sales Process that pertains to your Opportunity (depending on the Record Type)


Only top voted, non community-wiki answers of a minimum length are eligible