Toggle Side Panel

  • Home
  • Articles
    • All Articles
    • Blogs
    • Videos
    • Infographics
  • Consultants
    • Salesforce Product Expertise
      • Top Salesforce ConsultantsTop Salesforce Consultants
      • Marketing Cloud ConsultantsMarketing Cloud Consultants
      • Service Cloud ConsultantsService Cloud Consultants
      • Experience Cloud ConsultantsExperience Cloud Consultants
      • Analytics Cloud ConsultantsAnalytics Cloud Consultants
    • Salesforce Industry Expertise
      • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
      • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
      • Health Cloud ConsultantsHealth Cloud Consultants
      • Commerce Cloud ConsultantsCommerce Cloud Consultants
      • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
    • Salesforce Experts by Location
      • USATop Salesforce Consultants in USA
      • IndiaTop Salesforce Consultants in India
      • AustraliaTop Salesforce Consultants in Australia
      • United KingdomTop Salesforce Consultants in UK
      • CanadaTop Salesforce Consultants in Canada
  • Webinars
  • Marketplace
  • Advertise With Us
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Home
    • Articles
      • All Articles
      • Blogs
      • Videos
      • Infographics
    • Consultants
      • Salesforce Product Expertise
        • Top Salesforce ConsultantsTop Salesforce Consultants
        • Marketing Cloud ConsultantsMarketing Cloud Consultants
        • Service Cloud ConsultantsService Cloud Consultants
        • Experience Cloud ConsultantsExperience Cloud Consultants
        • Analytics Cloud ConsultantsAnalytics Cloud Consultants
      • Salesforce Industry Expertise
        • Non-Profit Cloud ConsultantsNon-Profit Cloud Consultants
        • Financial Service Cloud ConsultantsFinancial Service Cloud Consultants
        • Health Cloud ConsultantsHealth Cloud Consultants
        • Commerce Cloud ConsultantsCommerce Cloud Consultants
        • Manufacturing Cloud ConsultantsManufacturing Cloud Consultants
      • Salesforce Experts by Location
        • USATop Salesforce Consultants in USA
        • IndiaTop Salesforce Consultants in India
        • AustraliaTop Salesforce Consultants in Australia
        • United KingdomTop Salesforce Consultants in UK
        • CanadaTop Salesforce Consultants in Canada
    • Webinars
    • Marketplace
    • Advertise With Us
    • Contact Us
    • Discussions
    Close search

    Activity › Forums › Salesforce® Discussions › How to insert Account from Inbound email Attachment having Thousands of record?

    Tagged: Account, Attachment, CSV File, Inbound Email, REGEX, Salesforce Apex, Salesforce Error, Salesforce SOQL

    • Salesforce® Discussions

      How to insert Account from Inbound email Attachment having Thousands of record?

      Posted by Ajay Prakash on April 1, 2016 at 6:36 AM

      I am creating Account from CSV file which is received from Inbound Email. It is throwing Regex too complicated error.
      How should I resolve this problem? I have wrote following code -

      • This discussion was modified 10 years ago by  Ajay Prakash.
      • This discussion was modified 10 years ago by  Ajay Prakash.
      • This discussion was modified 8 years, 4 months ago by  Forcetalks.
      shariq replied 7 years, 6 months ago 4 Members · 5 Replies
      • Account
      • Attachment
      • CSV File
      • Inbound Email
      • REGEX
      • Salesforce Apex
      • Salesforce Error
      • Salesforce SOQL
    • 5 Replies
    • Ajay Prakash

      Member
      April 1, 2016 at 6:47 AM

      global class createAccountsFromMail implements Messaging.InboundEmailHandler{
      global String MyFile{get;set;}
      global String[] filelines = new String[]{};
      global List AccountList=new List();

      global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope){
      Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
      try{
      System.debug('HELLO There');
      for(Messaging.Inboundemail.BinaryAttachment at : email.binaryAttachments){
      System.debug('Mail contents');
      MyFile=at.body.toString().substring(0,5000);
      filelines=MyFile.Split('\n');
      System.Debug('File Lines----'+filelines.size());
      for(Integer i=1;i

      • This reply was modified 10 years ago by  Ajay Prakash.
      • This reply was modified 10 years ago by  Ajay Prakash.
    • Ajay Prakash

      Member
      April 1, 2016 at 6:58 AM

      Complete code is not showing here.If someone need then I can mail.

      • This reply was modified 10 years ago by  Ajay Prakash.
    • Naman

      Member
      April 18, 2016 at 2:01 PM

      Try using batch class to execute the logic. Splitting the string by '\n' also produce this issue so, need to avoid that.

    • Parul

      Member
      September 20, 2018 at 12:27 AM

      Hi,

      Also you have to go with some kind of integration tool (informatica, mulesoft) or scheduled data loaders (Command Line Interface of Data Loader) or import wizard.

    • shariq

      Member
      September 20, 2018 at 7:48 PM

      Hi,

      You can use apps present in app exchange, there might be a feature regarding it.

      Hope this helps.

    Log In to reply.

    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me
    • Public
    • All Members
    • My Connections
    • Only Me

    application solution

    Popular Salesforce Blogs

    Maximizing Your Marketing Potential with the Salesforce Marketing Cloud

    Blog in Salesforce

    In today's fast-paced digital world, businesses must keep up with the latest technologies and tools to stay ahead of the competition. One of the most…

    Audience, Behavior, Brand Awareness, Calls-To-Action, Campaigns
    Infodriven May 23, 2023
    1,370  Views
    Salesforce Data

    Top 5 Salesforce Data “Don’t’s” - Learn About it Here

    Blog in Data, Salesforce

    Data is the bloodline of any successful business – helping your team to uncover trends, achieve goals, and forecast where you’re headed. However, effective data…

    Bloodline, Business, Business Address, Business Goals, Business Process
    Access Global Jun 14, 2022
    2,000  Views

    How to Improve Salesforce Adoption Rates Through Customization

    Blog in Salesforce

    “Is this necessary?” “We’ve always done it this way.” “That is a steep learning curve to navigate.” All of us hear one or all of…

    AppExchange, Automate Process, Business, Business Goals, Configure
    LevelShift (formerly DemandBlue) May 17, 2021
    1,786  Views
    Footer Forcetalks logo

    support@forcetalks.com

    • twitterx

    Quick Links

    Advertise with Us

    Salesforce® Articles

    Dreamforce 2023

    Top Salesforce® Bloggers 2023

    Top Salesforce Consultants

    Get Listed

    Company

    Contact Us

    About Us

    Privacy Policy

    Terms & Conditions

    InsightHub

    Salesforce Blogs

    Salesforce Videos

    Salesforce Groups

    Salesforce Jobs

    © 2026 - Forcetalks ● All Rights Reserved

    Salesforce® is a trademark of Salesforce® Inc. No claim is made to the exclusive right to use “Salesforce”. Any services offered within the Forcetalks website/app are not sponsored or endorsed by Salesforce®.

    Try AuditMyCRM - It is a Salesforce CRM Audit tool which comprehensively scans your Salesforce org and gives you the list of errors or warnings you need to take care of.
    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.