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
dbrightdbright 

Update fields with a WebService

I finally figured out how to publish my wcf wsdl so that SalesForce accepts it.  Now I want to call it.

My goal is to update a custom field, ie. "Time Spent Golfing" in the account object.

So everytime the user hits "some button" in salesforce, it goes to the webservice with a series of account ids and updates the "Time Spent Golfing" field.  What's the best way to accomplish this ?  I tried hooking up triggers (and a testing function just to see it work) and they both say "cannot make an outside call."  Regardless, I don't even want it to work through triggers, but just some button.

Can anyone suggest a course of action ?

Thanks in advance,

-D
BoxBox

Hey,

You can either use Visual Force to initiate the webservice through a button or an scontrol.  The generic could would be:

Java Script:

var result = sforce.apex.execute('CMyWebServiceClass','SomeMethodInMyClass', { pParam:"{!object.MergeField}"} );

or visual force you could use a controller and so therefore wouldn’t necessarily require a webservice

<apex:commandButton action="{!MyMethodInTheController}" value="Push Me" id="theButton"/>


Hope that points you in the right direction