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
keady@sfdckeady@sfdc 

how to call webservice method inside static method?

Hi All,

I have 2 methods,

1. public pageReference test1(){} method -- called from detail page button

2. webservice static String test2(){} method -- called from custom button on the vf page

 

These methods has same code, but the invocation is from different places.

is there any way to create a common method out of these 2 methods so that it holds the common code and we can just have a call to that common method in test1() and test2().

 

please advice...

SammyComesHereSammyComesHere

You can make use of actionFunction and create a single non static instance method ..

It should work