You need to sign in to do that
Don't have an account?
Java Code to salesforce
Hi All,
I have been looking for devising a solution but I keep on heading a roadblock. Ryan from Salesforce and sfdcfox helped me a lot.
Say a requirement is user shall be able to browse for a file, select it, and then store it's name and path in salesforce custom fields.
Fetching a file name and storing it in Salesforce is absolutely feasible. But the main issue I have been facing from day one is to actually fetch a path and store it in salesforce custom fields.
here's a very simple java code that can do it: But how can I do the same in salesforce?
import java.io.*;
import javax.swing.*;
public class FilePath1 {
public static void main(String[] args) {
try{
JFileChooser fc = new JFileChooser();
fc.showOpenDialog(null);
File file = fc.getSelectedFile();
String filename = file.getName();
System.out.println("File Name " + filename);
System.out.println("Path : " + file.getPath());
}
catch(Exception e){
// if any error occurs
e.printStackTrace();
}
}
}
Puneet I am afraid I don't understand. Could you please elaborate?
Thanks!!