function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VSN_ForceVSN_Force 

Group Update

Hello All,

 

I am new to SFDC platform. I have a production issue to be fixed.

 

The scenario is like this :

 

In few of the person accounts in our org, both the email field and personal email field have the same email address.

I will have to find those records and make their personal email address set to " " if it is same as Email field.

 

How can I approach this issue?

My thinking is :

 

1. Workflow

2. Trigger

3. Apex code / Batch Apex to loop thro all eprson acct records

 

Can you pls suggest me what could be the best solution for this?

 

Thanks.

 

~VSN

Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney

Hey,

Glad to know you've gotten ahead.

 

Insert Null Values is  a setting in DataLaoder, if you open up the settings from the toolbar, make sure that this option is checked.

 

Then try inserting null values. If leaving the field blank doesnt work (it should ideally), try putting in #N/A or NULL.

 

Hope that helps


VSN_Force wrote:

Ritesh,

 

I got past the initial stage. Now I have a set of records that have same email address in Email and personal email field.

So what I did is, tried making the personal email field empty for all those records and tried uploading the csv via dataloader. The result was succesful but when I did checked the records in Salesforce,com, they still had the personal email field value retained.

 

So where is it goinh wrong??...how to set a field empty value or null using SFDC dataloader??

 

Thanks for ur help in advance.

 

Regards,

~VSN


 

All Answers

Ritesh AswaneyRitesh Aswaney

Create a formula field on Contact of type Boolean (Checkbox) - DedupeEmail

Formula : Email == Personal_Email__c

 

Then do an extract via DataLoader for Contact Records where DedupeEmail = true

 

Blank out personal email addresses in a Text Editor.

 

Update via Dataloader matching against Id

 

You could potentially also write BatchApex to process records where the Formula Field has a value true, but dataloader would be simpler, in my opinion.

VSN_ForceVSN_Force

Ritesh,

 

I don see a boolean return type for formula..!..:(

 

~VSN

Ritesh AswaneyRitesh Aswaney

My bad - a text formula field would do. It could evaluate to the string literal 'true' for a match and 'false' otherwise.

 

It will do the needed - i.e. serve as a part of the where clause in your select query for extraction.

VSN_ForceVSN_Force

Ritesh...

 

I am getting this error, when i tried to compare the two email fields.

 

Error: Formula result is data type (Boolean), incompatible with expected data type (Text).

 

~VSN

VSN_ForceVSN_Force

Ritesh,

 

I got past the initial stage. Now I have a set of records that have same email address in Email and personal email field.

So what I did is, tried making the personal email field empty for all those records and tried uploading the csv via dataloader. The result was succesful but when I did checked the records in Salesforce,com, they still had the personal email field value retained.

 

So where is it goinh wrong??...how to set a field empty value or null using SFDC dataloader??

 

Thanks for ur help in advance.

 

Regards,

~VSN

Ritesh AswaneyRitesh Aswaney

Hey,

Glad to know you've gotten ahead.

 

Insert Null Values is  a setting in DataLaoder, if you open up the settings from the toolbar, make sure that this option is checked.

 

Then try inserting null values. If leaving the field blank doesnt work (it should ideally), try putting in #N/A or NULL.

 

Hope that helps


VSN_Force wrote:

Ritesh,

 

I got past the initial stage. Now I have a set of records that have same email address in Email and personal email field.

So what I did is, tried making the personal email field empty for all those records and tried uploading the csv via dataloader. The result was succesful but when I did checked the records in Salesforce,com, they still had the personal email field value retained.

 

So where is it goinh wrong??...how to set a field empty value or null using SFDC dataloader??

 

Thanks for ur help in advance.

 

Regards,

~VSN


 

This was selected as the best answer
VSN_ForceVSN_Force

Ritesh,

 

Thanks a lot.

It works.

 

~VSN

Ritesh AswaneyRitesh Aswaney

Brilliant ! :) Cheers .