• Hasini Hasini
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi all,

We have the below requirement:

1. Create a Vf page and a button named 'Upload CSV' . The csv file contains lines/rows, each row contains 2 columns each of which is name of two custom objects.
For example, the csv file can contain below:

CustObj1Name, CustObj1Name2
TestName1, TestName2
Name1, Name2

2. On click of the button 'Upload CSV', a batch class should parse the csv and should upsert the two custom object records picking their respective name from csv. i.e. If we have CustObj1__c and CustObj2__c as custom objects, then these two custom object records shud be upserted by populating their name field from csv, say CustObj1__c.Obj1Name__c shud be populated with TestName1 and upsert CustObj1__c, similarly CustObj2__c.Obj2Name__c shud be populated with TestName2 and upsert CustObj2__c


Please let me know on the feasible solution for the above. If you have any sample code, please share which would be very helpful to me.



Thanks a lot!

Hi all,

We have the below requirement:

1. Create a Vf page and a button named 'Upload CSV' . The csv file contains lines/rows, each row contains 2 columns each of which is name of two custom objects.
For example, the csv file can contain below:

CustObj1Name, CustObj1Name2
TestName1, TestName2
Name1, Name2

2. On click of the button 'Upload CSV', a batch class should parse the csv and should upsert the two custom object records picking their respective name from csv. i.e. If we have CustObj1__c and CustObj2__c as custom objects, then these two custom object records shud be upserted by populating their name field from csv, say CustObj1__c.Obj1Name__c shud be populated with TestName1 and upsert CustObj1__c, similarly CustObj2__c.Obj2Name__c shud be populated with TestName2 and upsert CustObj2__c


Please let me know on the feasible solution for the above. If you have any sample code, please share which would be very helpful to me.



Thanks a lot!