You need to sign in to do that
Don't have an account?
Losintikfos
trigger.new
Hi Experts,
I have this method that i am trying to use trigger to invoke byt keeps getting;
Save error: Method does not exist or incorrect signature: ServiceAccount.createServ(LIST:SOBJECT:Service__c)
Below is the method i am using to invoke my external webservice.
This is the trigger:
I have tried passing Array Primitive to the method and tried several options but won't work. Do anyone know what to do? experts advice please.
My requirement is to use the trigger to automatically invoke the apex class for remote process before insert.
Need your help experts!:smileysad:
I have this method that i am trying to use trigger to invoke byt keeps getting;
Save error: Method does not exist or incorrect signature: ServiceAccount.createServ(LIST:SOBJECT:Service__c)
Below is the method i am using to invoke my external webservice.
Code:
global class ServiceAccount{ @future static void createServ(){ Service__c sd = new Service__c(); Boolean rental = sd.Rental__c; String alias = sd.Billing_Alias__c; String freq = sd.Frequency__c; wsServiceAccount.ServiceAccountHttpSoap11Endpoint stub = new wsServiceAccount.ServiceAccountHttpSoap11Endpoint(); String call = stub.CreateService(rental, alias, freq); //return call; } }
This is the trigger:
Code:
trigger ServiceAccount on Service__c (before insert, before update) { ServiceAccount.createServ(trigger.new); }
My requirement is to use the trigger to automatically invoke the apex class for remote process before insert.
Need your help experts!:smileysad:
This will pass the new or updated Service__c objects to the createServ method one at a time for processing.
Your suggestion is exactly what i want to do but unfurtunatly keep getting error;
Save error: Unsupported parameter type SOBJECT:Service__c
After going through the apex language reference, i realised you can't pass SObject to @ future method, which is why i am kinda struggling at the moment.
I know the summer 2008 has been released, do i need to download a new version of wsdl to get this to work?
Expert ideas pls.
Actually,
Winter 09 release (api version 14) is out now, and you should be using the updated WSDL for your webservice.
Does your external WebService need to be executed before the Service__c is inserted into Salesforce? If you could do it after the insert/update, you could extract the ID of the Service__c object from the trigger and pass it as a string to the future method, and have that method, look up the data to pass to your callout.
Something like this, maybe:
This should allow your code to be more bulk safe, and limits you to one SOQL query even when a batch of items is processed.
Hope that helps.
I am getting some invokation to my external service following the guidance above!
:smileywink:
Message Edited by Losintikfos on 10-15-2008 03:20 AM
I am passing date to the external method;
Unfurtunately i am getting exception:
Debug Log:
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: NumberFormatException date string can not be less than 19 charactors faultcode=soapenv:Server faultactor=
I am pretty sure i need to do something to the raw value of date before passing it to the remote method.
Do anyone know what to do?
Which is pretty much what you've suggested! and did the job.
Thanks JimRae:smileywink: