You need to sign in to do that
Don't have an account?
da wang
opportunity product related list bulk upload
i want to develop a function to upload bulk CSV data into profuct as below screenshot.
how to write the VF page and APEX code and how to deal with the csv file. i have no idea about the code develope.....
how to write the VF page and APEX code and how to deal with the csv file. i have no idea about the code develope.....
I tried this in the past and I think the best way to parce the CVS file its using an external server like heroku, but it can be done all native in apex, here are my ideas how to tackle this.
The thing that you need to take into cosideration, the products that you want to upload need to be in the pricebook selected for that opportunity.
Step 1: Form your upload button desing an upload page like this one:
http://developer.force.com/cookbook/recipe/uploading-a-document-using-visualforce-and-a-custom-controller
Step 2: In the controller do a "insert document" and save the document.
The next step that its to parce this document its the tricky part of salesforce. you can get the document.body and split the CVS parts based on the lines of the file and then commas of each line.
Here is some code to start with a custom solution within apex:
Let me know how it goes.
I have done step1 as you recommanded. but one thing is different , my requeirment is to upload csv data into opprotunity product related list not document folder just like below screenshot. After done step 1 , i upload one file , and it's been uploaded to document folder. i am a freshman , so its kind of difficult for me to write code to complete the requirment, so i just imitate and copy other's code .could you show me the whole code of my requeirment?.below is my salesforce account: could you help me in my SFDC environment? username: da.wang@salesforce.com password:199419adam Apex class:FileUploadController Page:OpportunityProducts. thanks a lot for your kind help.