You need to sign in to do that
Don't have an account?

Creating an app to be published on appexchange
Hi
I am creating an app to be published in appexchange and got a query.
I have an external webservice call (with authentication) from my custom object. I want the webservice URL, username and password to be setup when user try to install the app, how do I achieve that and how do it access those parameters in my apex class.
Regards
Rohit
Okay, you can either make a custom setting (https://help.salesforce.com/help/doc/en/cs_about.htm) or a custom object with those fields. Then using the post install script you can populate a default set of parameter on install(if there is a test account you want to provide to your customers), or just let them edit the custom setting/custom object data and your apex class will query the fields from that before making the web service call.
All Answers
you can use the post install script
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_install_handler.htm
Thanks Mukul
But I am new to this post install script. Can you advice or provide some sample code as to how can I create 3 fields (serverURL, username, password) during installation/ configuration of the app and how do i use those 3 parameters in my classes in the app.
There is sample code in the link I gave.
Yes, there is a sample code but that only gives information as to how you can send email after the installation.
There is no mention as to how I can create and use dynamic fields - serverURL, username and password while making an http call to external webservice from salesforce.
By creating the fields, do you mean creating the metadata in the object ? If yes then I dont think there is way.
If you are talking about creating a record in an object X that has fields serverURL, username and password then the code is there in the link. The following shows an example of creating an account with name field being "Newco"
Hi Mukul
Thanks a lot once again.
What I am doing is:
I have created a class where in I am making a call to external webservice. So for, this I have provided a serverURL, username & password. Now I want to publish this app in appexchange and make it available for others. However, I want others to modify the serverURL, username and password. I don't know what is the exact term i should use for these types of variables/ fields but in any other app outside salesforce, these are called configuration parameters or run-time parameters.
Okay, you can either make a custom setting (https://help.salesforce.com/help/doc/en/cs_about.htm) or a custom object with those fields. Then using the post install script you can populate a default set of parameter on install(if there is a test account you want to provide to your customers), or just let them edit the custom setting/custom object data and your apex class will query the fields from that before making the web service call.
Thanks Mukul. Custom Setting is the solution for me. That's what I was looking for. Thanks a lot again!!!