function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mk2013mk2013 

Open new URL and insert SF record in a button click

Scenario:

I have a button on a custom object. In the button click the content source is URL and that URL opens up in the existing window with a sidebar. So when user clicks button they are taken to the uRL which is a J2EE webapp.  User performs some actiity in that application and a new object is craeted in J2EE webapp. I need to create it's corresponding custom object in SF.  I was trying to do this from J2EE webapp using the SOAP API and it worked fine. But all this time I was using the web app which is hosted on my local server. Now when I point the URL to the real production server, I get security error.

 

My question is, is there any way to communicate back to SF when using a URL button? if there any such way to communicate and tell back to SF, that a java record is created and go ahead and insert corresponding custom object in SF, then I do not need to find any solution for security as I can take care of inserting in SF in apex code.

Please note that the button has to be with content source as URL as I have to open that web app in current window.

 

Anybody came accross such situation, please help.

 

Thanks,

mk2013

ForcepowerForcepower
Here's one option:
You could build the screen within SF; collect all the data needed for the JEE Web App and send it over on the URL; the app does the insert and returns a value indicating success / failure; then you create your record on SF.
Best,
Ram
mk2013mk2013

Thanks Ram for quick response. But I am not supposed to create a VF page and use the existing j2ee app as j2ee app has avery extensive functionality and SF side team does not want to add any VF pages. I am just integrating the SF with j2ee.

 

mk2013

ForcepowerForcepower
In that case, you could use the Salesforce API and just do the creation of the record on SF through the JEE App. You can designate an API user for use by this app and may be lock down the IP range from which it can logon etc. That would be a way to accomplish your goal.

Ram
Bhawani SharmaBhawani Sharma
Get enterprise wsdl for Salesforce. Parse it in Java application and create client. It will give you method for login, create, update, search etc..Using this you can easily talk to Salesforce.

You can use below link for reference, how Java can talk to Salesforce:
http://developer.force.com/codeshare/projectpage?id=a063000000EXDULAA5