• Sanjeev R 1
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 6
    Replies

I have a visualforce page that is having a file uploader on it and it take a CSV file, as this CSV file can have large amount of data, and have to perfrom some bussiness logic to data before importing it into SFDC therefore I have written controller class to it. After performing all operations I have List Collection for my custom object..

List<Credit_Item__c> lstCrI;

nameFile = contentFile.toString();
filelines = nameFile.split('\n');
lstCrI = new List<Credit_Item__c>();

 for (Integer i=1;i<filelines.size();i++)
 {
      // extract data here from each row of CSV     

      Credit_Item__c objCr = new Credit_Item__c(); 

      // business logic here and assignment of "objCr "

       lstCrI.add(objCr);
}

 try{            
            insert lstCrI;    
}
        catch (Exception e)
        {
            //Database.rollback(sp);
            ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured. Please check the and try again later');
            ApexPages.addMessage(errormsg);
        } 


Now this may create problem in data in List collection is huge...
insert lstCrI;
 

Therefore I need to have a btach here on this list collection..

Requeting to please guide me for this as I m getting examples that the querrying things directly from database...in start() method, as I have a list collection here that I need to process in Batches

thanks in advance
Sanjeev

Requesting to please guide for following tasks

I need to extract data from CSV file and physically hold that CSV file somewhere(I m unable to figure out)... file can have large amount of data so please help me out where can I upload this file(a procedure) and data extraction on file upload.

thanks,
Sanjeev

I need to populate Custom object using CSV(xls) import using Apex and visualforce, 
I m following this link
http://www.forcetree.com/2010/08/read-and-insert-records-from-csv-file.html

But requesting to please me the number of records(limitation), I can have via this functionalilty,can I upload bulk records using this.

thanks,
Sanjeev

I have a class named "ctrlMultiClone"
and a constructor to this class as 

private ApexPages.StandardController standardController;
 public ctrlMultiClone(ApexPages.StandardController standardController)
    {
        this.standardController = standardController;
    }

requesting to please guide how to get the code coverage for this part.

As I have a custom buttom on Opportunity page lagout that is using this class for Cloneing Opportunity with Custom related list..
All functionality working as desired execpt the code coveage part for the above code

Thanks in advace
Sanjeev

I have a requirement that before inserting data I need to look for NAMES(codes) that are avavilabe some on the web in SQL SERVER database
I mean I have my SQL SERVER database accessible on the web... I need to query that database(table) from Apex and get the names of all the codes availabe like and hold that in a list collection in apex...like

List [] String  lstName = Select NAME from distributors;
(I mean in need to populate this list from SQL SERVER in apex.)

from here I can check if the incoming record has any of the name that is availabe in this list from SQL .. I will proceed with my code...

Please guide me is their a way to do so..its bascially etablishing connection between salesforce to SQL SERVER(or any other database).

Thanks in advance.
Sanjeev

I have before update trigger on Opportunity.
Basically I need to bulkify the trigger..

When uploading data via data loader I will have list of opportunities

Oppounity[] getOpps = Trigger.new;

Now need to find the email address of Contact (Lookup) with each of these incoming opportunities..

If I will put a SOQL qurey in for loop for each opportunity.. it will hit the governer limits if I have says +100 records...

How can I have a workaround for this in apex ... so that I don't need to make a SQOL query inside the for loop in this case


thanks in advance

 

I m preparing to upload our Product and price books to salesforce.
need help ... with the CSV formats that need to most efficiently do that.

thanks in advance
Sanjeev
I have a field update workflow... the source field in having like below

xxxxxxxxxxxxxxxxxxxxxxxxx ABCD: yyyyyyyyyyyyyyyyyyyyy

x denotes can vary in length. ( this is some data here )
ABCD: is fixed characters sufix some data again I m denoting that by "y"  here

I need to split data and need only things before "ABCD:"

is that possible in field update... please guide me for the workaround..

Thanks in advance

I have a task and calendar event list.. 

What I need is to keep log of the user's GPS location (how to get this GPS location in salesforce), time, date when they click to VIEW  these Task or calendar event... 
How can I keep this record and where ...
is ActivityHistory the right place to store this information 

requesting to please guide me for this...

thanks is advance

I need to populate Custom object using CSV(xls) import using Apex and visualforce, 
I m following this link
http://www.forcetree.com/2010/08/read-and-insert-records-from-csv-file.html

But requesting to please me the number of records(limitation), I can have via this functionalilty,can I upload bulk records using this.

thanks,
Sanjeev

I need to populate Custom object using CSV(xls) import using Apex and visualforce, 
I m following this link
http://www.forcetree.com/2010/08/read-and-insert-records-from-csv-file.html

But requesting to please me the number of records(limitation), I can have via this functionalilty,can I upload bulk records using this.

thanks,
Sanjeev

I have a class named "ctrlMultiClone"
and a constructor to this class as 

private ApexPages.StandardController standardController;
 public ctrlMultiClone(ApexPages.StandardController standardController)
    {
        this.standardController = standardController;
    }

requesting to please guide how to get the code coverage for this part.

As I have a custom buttom on Opportunity page lagout that is using this class for Cloneing Opportunity with Custom related list..
All functionality working as desired execpt the code coveage part for the above code

Thanks in advace
Sanjeev

I have a requirement that before inserting data I need to look for NAMES(codes) that are avavilabe some on the web in SQL SERVER database
I mean I have my SQL SERVER database accessible on the web... I need to query that database(table) from Apex and get the names of all the codes availabe like and hold that in a list collection in apex...like

List [] String  lstName = Select NAME from distributors;
(I mean in need to populate this list from SQL SERVER in apex.)

from here I can check if the incoming record has any of the name that is availabe in this list from SQL .. I will proceed with my code...

Please guide me is their a way to do so..its bascially etablishing connection between salesforce to SQL SERVER(or any other database).

Thanks in advance.
Sanjeev

I have before update trigger on Opportunity.
Basically I need to bulkify the trigger..

When uploading data via data loader I will have list of opportunities

Oppounity[] getOpps = Trigger.new;

Now need to find the email address of Contact (Lookup) with each of these incoming opportunities..

If I will put a SOQL qurey in for loop for each opportunity.. it will hit the governer limits if I have says +100 records...

How can I have a workaround for this in apex ... so that I don't need to make a SQOL query inside the for loop in this case


thanks in advance

 

I have a field update workflow... the source field in having like below

xxxxxxxxxxxxxxxxxxxxxxxxx ABCD: yyyyyyyyyyyyyyyyyyyyy

x denotes can vary in length. ( this is some data here )
ABCD: is fixed characters sufix some data again I m denoting that by "y"  here

I need to split data and need only things before "ABCD:"

is that possible in field update... please guide me for the workaround..

Thanks in advance

I have a task and calendar event list.. 

What I need is to keep log of the user's GPS location (how to get this GPS location in salesforce), time, date when they click to VIEW  these Task or calendar event... 
How can I keep this record and where ...
is ActivityHistory the right place to store this information 

requesting to please guide me for this...

thanks is advance