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
Ad_InfosysAd_Infosys 

Format of Date parameter passed to web service

I have a webcervice as:
 

global class Pipeline {


  WebService static opportunity[] Apptaker(date adid){

.....

....}

static testMethod void apptakertest() {

sobject[] result= pipeline.Apptaker(2008-06-04);

...

}

 

I am getting error in the apptakertest() at date format. It is not identifying the date.

 

Thanks in advance

 

micwamicwa
You have to declare your class global instead of public if it has a werbservice method.

Try that code:
Code:
sobject[] result= pipeline.Apptaker(Date.newInstance(2008,6,4));

 



Message Edited by micwa on 06-06-2008 06:38 AM
Ad_InfosysAd_Infosys

That was a miracle!!! Never had idea about it. Instead not mentioned in apex reference guide :(

One more query, if you can help.

opp=[select account.fax, apptaker__c, name, ownerid  from opportunity where apptaker__c=:adid and stagename='Prospecting' order by closedate desc];

Here in 'order by closedate'  close date is a field name, I want a work around if I can use any variable, like the popular binding variables. Lets say if I can use a variable into which I can change the field name as per convenience
 
 
Thanks in advance.
micwamicwa
you have to wait for the summer08 release where dynamic SOQL statements are possible:

http://www.salesforce.com/us/developer/docs/apexcodepre/index_Left.htm#StartTopic=apex_dynamic_soql.htm|SkinName=webhelp