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
Rahul BorgaonkarRahul Borgaonkar 

Webservice Apex Method with List As parameter

Hi,
I have a inner class and method as below. The class and method is defined in outer class WebsiteWS.
global without sharing class WebsiteWS 
{
	    global class wsAttendeeDetails
	    {
	        webservice Id websiteOrderId;
	    }

	    webService static wsOutputs wsPopulateOppEventContactDetails(List<wsAttendeeDetails> attendeeDetails)
	    {
	        system.debug('List<wsAttendeeDetails> attendeeDetails - ' + attendeeDetails);
	        return null;
	    }
}
I am trying to execute this method from Button using sforce.apex.execute.
var ret = sforce.apex.execute("WebsiteWS", "wsPopulateOppEventContactDetails", {"attendeeDetails" : [ { "websiteOrderId" : "11111" } ] } );
alert(ret);
I am not getting correct value in system.debug, getting null as below
15:51:24:928 USER_DEBUG [2209]|DEBUG|List<wsAttendeeDetails> attendeeDetails - (wsAttendeeDetails:[websiteOrderId=null])

Could you please help to find exact problem?

Regards,

Rahul
 
Sudeep DubeSudeep Dube
I think the method you have been  created  is return null , try to change retirn value/var then it will give you proper output