Toggle Side Panel

  • Blogs
  • 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
  • Contact Us
  • Discussions
More options
    Sign in Sign up
    • Blogs
    • 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
    • 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, 5 months ago by  Ajay Prakash.
      • This discussion was modified 10 years, 5 months ago by  Ajay Prakash.
      • This discussion was modified 8 years, 9 months ago by  Forcetalks.
      shariq replied 7 years, 11 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, 5 months ago by  Ajay Prakash.
      • This reply was modified 10 years, 5 months ago by  Ajay Prakash.
    • [adinserter block='9']
    • 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, 5 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

    Popular Salesforce Blogs

    Salesforce Elastix Integration | All You Need to Know

    Blog in Salesforce

    In the dynamic landscape of customer relationship management, Salesforce has emerged as a game-changer. Businesses are continually seeking innovative solutions to enhance their CRM capabilities,…

    Better Customer Insights, Boost Innovation, Business Environment, Call Logging Experience, Click-to-Call Experience
    Variance InfoTech Dec 20, 2023
    1,402  Views
    Salesforce to Salesforce Integration using Rest API Callouts

    Salesforce to Salesforce Integration using Rest API Callouts

    Blog in Salesforce integration

    "Integration" itself is a vast topic, though with a bit of understanding and practise one can master any skill whatsoever. Answering the question posted here is…

    Apex Rest Webservice, API Callouts, Rest Callout, Salesforce to Salesforce Integration
    Ap Mishra Jun 14, 2017
    41,218  Views

    Case Study: Empowering Global Pharma Customer Support

    Blog in Salesforce

    Transformative impact of the Salesforce Service Cloud Call Center Solution on enhancing customer support across multiple countries within the pharmaceutical industry. The pharmaceutical industry operates…

    Business Process Transformation, Call Center Solution, Call Control Application, Case Management, Case Routing
    Triple Innovations Oct 5, 2023
    1,543  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®.

    We use cookies to enhance your browsing experience. Please see our privacy policy if you'd like more information on our use of cookies.