Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Lead migration - leadsourcecode is outside the valid range

(0) ShareShare
ReportReport
Posted on by

I am not an expert in Dynamic CRM and I started a job a week ago. The project I am involved in is migration. I'm trying out KingsWaySoft and I'm running some migration tests. At this moment I can not migrate the lead entity.
I always have the message: CRM service call returned an error: A validation error occurred.  The value of 'leadsourcecode' on record of type 'lead' is outside the valid range.

I have no idea what to do to solve the problem....

lead_5F00_source.PNG  

lead_5F00_destination1.PNG

I used Text Lookup in the fields : 

input column: owneridname
destination CRM files: ownerid Choisir: Chose Target Fields(s)
how text lookup is performed: Chose Target Fields(s)
Lookup methode: Manually Specify
systemuser: Target: fullname
team: Target: name
Options: Ignore Case
Cache: Full Cache
=======================
input column: transactioncurrencyname
destination CRM files: transactioncurrencyid
how text lookup is performed: Chose Target Fields(s)
Lookup methode: Manually Specify
Target: currencyname
Options: Ignore Case
Cache: Full Cache

=======================
input column: createdbyname
destination CRM files: createby
how text lookup is performed: Chose Target Fields(s)
Lookup methode: Manually Specify
Target: fullname
Options: Ignore Case
Cache: Full Cache

*This post is locked for comments

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Lead migration - leadsourcecode is outside the valid range

    Hi Marcelo ,

    You need to check 'leadsourcecode' value in Dynamics CRM . Please check below reference where "Aileen Gusni" mentioned where you can get the value.

    community.dynamics.com/.../141457

    You just need to check the option set value and pass.

    Hope this helps.

  • Verified answer
    KingswaySoft Profile Picture
    545 on at
    RE: Lead migration - leadsourcecode is outside the valid range

    To expand on what Thomas stated, for this issue, you can try to enable Redirect rows to error output in the Error Handling page of the CRM Destination component, and then direct the Error Output (red arrow) to a destination component to log the failed records. This would help you identify the failed records and tell you what value of leadsourcecode is causing the trouble.

    Once you get the invalid leadsourcecode value, you can go to your target CRM instance and check the option values in the leadsourcecode column of lead entity. You can find this column via Settings | Customization | Customize the System | Components | Entities | Lead | Fields, double-click the leadsourcecode column to list all the Option values this OptionSet column has.

    Then, you can either create the options there manually (via UI) or use our CRM OptionSet Mapping component to manager the translation and mapping of CRM OptionSet fields (via SSIS).

    Please let us know if you have any further trouble.

    Thank you,

    KingswaySoft

    By the way, in case you were unaware, we have a CRM-CRM Migration Starter Pack: https://www.kingswaysoft.com/blog/2016/09/16/Announcing-Migration-Starter-Pack-for-CRM-Online-and-CRM-On-Premise

  • Verified answer
    Thomas David Dayman Profile Picture
    11,323 on at
    RE: Lead migration - leadsourcecode is outside the valid range

    I think for this problem is that there is a record which you are trying to create which hasnt got a correct leadsourcecode value.

    Usually the lead source code value is either 1,2,3,4,5 etc.. Check the option set field in Leads

    There might be a Lead record in your table which has a lead source code value of 1000000 which is doesnt exist in the option set. What you will need to do is update the incorrect records with a valid value. Then try and import it again.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans