As of May 31, 2023, we have updated our Code of Conduct.

Hot answers tagged

12 votes
Accepted

Trigger not updating field in Test Class

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 ...
Novarg's user avatar
  • 5,176
6 votes

Can't create Apex Class, need to convert lead via REST

The Partner API SOAP method convertLead() is at its core an HTTP POST request where the Body is XML that conforms to to the WSDL. There is nothing stopping you from building up that XML string and ...
Daniel Ballinger's user avatar
6 votes
Accepted

Address field: Set Address via Apex

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 ...
sfdcfox's user avatar
  • 468k
6 votes

Cannot get Unit Test to pass in order to push trigger to production

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 ...
Christian Carter's user avatar
6 votes
Accepted

'Unexpected syntax: 'mismatch input 'insert' expecting RCURLY' on apex test class for trigger

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 ...
sfdcfox's user avatar
  • 468k
5 votes
Accepted

When one merges accounts, contacts or leads what happens to lookup relationships?

According to this documentation, they will move: Any related items from any of the duplicate accounts will be associated with the newly merged account.
Sebastian Kessel's user avatar
5 votes
Accepted

How does Pardot Prospect Sync work?

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 ...
zainogj's user avatar
  • 1,854
5 votes

Lead Status Converted Value to Contact Status

From the docs: When you convert a lead, data in standard lead fields is transferred into standard account, contact, and opportunity fields. For custom lead fields, the data is mapped to custom ...
Shailesh Deshpande's user avatar
5 votes
Accepted

Visualforce customization isn't displaying multiple fields

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 ...
cropredy's user avatar
  • 67.6k
5 votes

Is there a way to hide/disable standard Salesforce button clicked

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 ...
cropredy's user avatar
  • 67.6k
5 votes

Can anyone suggest a good Mass Duplicate Leads Merge Free tool?

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 '...
Derek F's user avatar
  • 56.1k
5 votes

Lead before update runs on insert

A typical reason for this is that you have Lead Assignment rules. Once those execute, a new owner is assigned and hence the Lead object is updated. You can see this in the debug log if you enable ...
cropredy's user avatar
  • 67.6k
5 votes
Accepted

Prevention of Lead conversion as it has a time based action queued

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 ...
Santanu Boral's user avatar
5 votes

Is Lead.Name 100% predictable?

The documentation on Lead seems pretty clear: Name Description Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.
Adrian Larson's user avatar
  • 148k
4 votes
Accepted

REST api Post lead got invalid field when post to group edition

This error is specific to a user that doesn't have access to a particular field. As far as I'm aware, Website is a standard field that appears in all editions that support leads (all but personal ...
sfdcfox's user avatar
  • 468k
4 votes
Accepted

Can i get the Lead ID once it has already been converted?

You can use a standard report type of 'Leads with converted lead information'. Add a filter of Converted = true This will give you all your converted leads, the contact, opportunity, and account ...
Chris Duncombe's user avatar
4 votes
Accepted

New leads bypass assignment rules because of SOAP API

When using the SOAP Partner API you will need to set the AssignmentRuleHeader. With this you can control if the default assignment rule should be applied, or if an alternative rule, identified by the ...
Daniel Ballinger's user avatar
4 votes
Accepted

How to view converted Lead info?

In the Reports tab, create a new report using "Leads / Leads with converted Lead information" if you want to get account, contact, and opportunity information side-by-side with the lead, or you can ...
sfdcfox's user avatar
  • 468k
4 votes
Accepted

How can I get the Campaign IDs of Leads through triggers?

[SELECT Id, CampaignId, LeadId FROM CampaignMember WHERE LeadId IN :leadsInTrigger ] Using this query you get all campaign member for the leads that are in your trigger scope. From that you should be ...
Nielsm's user avatar
  • 2,074
4 votes
Accepted

How to convert a LEAD to Person-Account directly (without any API or code)?

From this answer at Salesforce Developer Forums, it appears that when Person Accounts are enabled in your Org you can make the Company on Lead optional and remove it from the page layout. Do you ...
Dave Humm's user avatar
  • 5,073
4 votes
Accepted

Why is LastModifiedDate not listed as a standard field in the UI?

Its a system generated date that is not listed in the standard field list. You will also notice that Created Date is not listed there. These field still exist. You can confirm by doing a simple ...
Chris Duncombe's user avatar
4 votes

Trigger not updating field in Test Class

Among the other answers here you will still need to move this line to be after you insert your task. Lead Getleadupdated = [SELECT Status FROM Lead where ID = : createlead.id]; Otherwise the value ...
dBeltowski's user avatar
  • 3,028
4 votes
Accepted

How can I modify the layout of the Leads Home Page?

Shortest answer: you can't do this with customization. Shorter answer: It has been rumored that this might be something you can customize in Lightning (in a future release), but there's no way to do ...
sfdcfox's user avatar
  • 468k
4 votes
Accepted

Trigger Process Builder when user receives lead, not queue

In your Process Builder criteria diamond check the Lead OwnerId starts with 005 This will tell you whenever a Lead is assigned to a User instead of a Queue
dBeltowski's user avatar
  • 3,028
4 votes

Query Only Duplicated Records

You must have got a success file stored on your local machine after insertion of records. Take the last files from the two record insertion files and take the id's from them. Delete those id's via the ...
Ruchi's user avatar
  • 1,515
4 votes

Query Only Duplicated Records

I would recommend in an urgent scenario like this (and assuming you have the "power" to be so decisive) using the Developer Console to run some Anonymous Apex to draw out a list and delete the ...
Simon Lawrence's user avatar
4 votes
Accepted

How to add a map widget to a Lead object?

Supporting @Adrian's comment, I am providing my answer. Rather than using "Google Maps API" (which is not fully FREE), I have used <apex:map> component which is in-build in Salesforce and takes ...
Santanu Boral's user avatar
4 votes

Assign leads from few queues as per round robin rule

You can look for the options to use Omni-Channel for lead assignment. Use Omni-Channel to create work items from Salesforce records and route them to the most qualified, available agents in your ...
Santanu Boral's user avatar
4 votes
Accepted

Avoiding creating duplicate Contacts in Marketing Cloud when using Sales Cloud records

Generally speaking, we create Automations that do a Query/Extract/Import to All Subscribers for any email address that's associated with an unsubscribed Subscriber Key. This obviously doesn't prevent ...
Adam Spriggs's user avatar
  • 29.6k
4 votes
Accepted

Automation on lead merge

Using the after delete trigger via MasterRecordId is documented to be the only way to trigger on a merge: If your application requires special handling for deleted records that occur as a result of ...
David Reed's user avatar
  • 91k

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