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

    Profiles in Salesforce

    Users and Profiles in Salesforce - Learn All About It

    Blog in Salesforce

    Users Who is a User in Salesforce?  A user is anyone who logs into the Salesforce platform or we can simply say anyone who has…

    App Builders, App Managers, Custom Profile, Employees, Organization
    Mohit Kumar Aug 31, 2022
    4,173  Views

    Talend Open Studio - Salesforce To Salesforce Data Migration

    Blog in Others

    Talend Open Studio - Salesforce To Salesforce Data Migration It is a open source java based software used to migrate data from one source to…

    Palette Section, Salesforce Data Loader, Salesforce Data Migration, Salesforce Fields, Salesforce Migration
    Ajit Apr 29, 2016
    8,860  Views

    5 Features in Salesforce's Winter '24 Release for the Experience Cloud

    Blog in Salesforce Releases

    Hey there! Exciting news ahead! The Salesforce Winter 2024 Release is bringing a bunch of cool stuff to the Salesforce Experience Cloud. All these new…

    Component Management, Component Selection, Component Variations, Custom CSS Styling, Dynamic Experiences
    Advanced Oct 13, 2023
    1,275  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.