i,m trying to write a trigger in SalesForce Opportunity which have to send the updated StageName to external webservice using predefined username and password.
here is sample code:
trigger isStageChanged on Opportunity (after update) {
for (Opportunity o : Trigger.new) {
Opportunity beforeUpdate = System.Trigger.oldMap.get(o.Id);
if(beforeUpdate.StageName != o.StageName) {
// Call WS
}
}
}
"Call ws" means to use link like: http://mydomain.com/webservice/index.php?username=MY_USERNAME&password=MY_PASS&stage=opportunityNewStage
The question is: Where can i store MY_USERNAME and MY_PASS in case i want to use this trigger on different SalesForce customers and to let them configure them after install? When i red the APEX Code Developers Guide i red that i can use a Web Services API to deploy my trigger and that way i can store user and pass on my server. Is it possible? On my server i'm using php.
I hope i am clear in my question.