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 9 years, 8 months ago by  Ajay Prakash.
      • This discussion was modified 9 years, 8 months ago by  Ajay Prakash.
      • This discussion was modified 8 years, 1 month ago by  Forcetalks.
      shariq replied 7 years, 2 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 9 years, 8 months ago by  Ajay Prakash.
      • This reply was modified 9 years, 8 months 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 9 years, 8 months 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

    API Versions

    API Versions in Salesforce - All You Need to Know

    Blog in Others, Salesforce

    As a feature of a controlled Metadata API delivery and source control procedure, it is essential to see how API forms impact functioning examples, particularly…

    Apex Trigger, API Adaptation, API Form, API Forms, API Rendition
    Pooja Apr 22, 2021
    4,364  Views

    An Ultimate Guide on How to Import Data in Salesforce

    Blog in Data, Data Migration

    Data is an integral part of an everyday business and the effectiveness of its management determines whether the business will be a success or not.…

    API calls, AppExchange, Bulk Data Load Jobs, Business, Campaign Members
    Angie Aug 19, 2021
    6,725  Views

    Optimizing Fleet and Delivery Management with Salesforce and IoT Tracking Integration

    Blog in Salesforce Data integration

    Fleet and delivery management has become more complex due to rising consumer expectations, fuel costs, and logistics disruptions. In fact, according to Deloitte, 79% of…

    George Aug 4, 2025
    1,113  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

    © 2025 - 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.