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

    Display Bar Chart

    Learn How to Display Bar Chart in Salesforce Lightning Web Component

    Blog in Lightning, Others

    Introduction The graphical representation of information and data is known as data visualization. Data visualisation tools make it easy to see and understand trends, outliers,…

    Bar Chart, ChartJS, ChartJS File, Charts, Child Component
    Anuj Apr 21, 2021
    21,824  Views
    Multi-Factor Authentication

    Multi-Factor Authentication in Salesforce - The Brief Guide

    Blog in Salesforce Security

    Cybercrimes, phishing attacks, Security breaches etc. are the terms that are known by everyone nowadays. Security has become a major issue and the reason behind…

    Authentication Method, Business Hours, Cloud-based Solutions, Connectivity Issue, Credential Stuffing
    Tanya Joshi Feb 17, 2022
    2,886  Views

    How to Choose the Right Salesforce Implementation Partner in the USA?

    Blog in Salesforce Implementation

    Partnering with the right Salesforce Implementation Partner in the USA is a pivotal step in ensuring the seamless adoption and optimization of the Salesforce platform…

    Assess Needs, budget, Change Management, Client References, Collaboration
    Kizzy Consulting Oct 9, 2023
    1,265  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.