2

I'm trying to generate apex class from wsql in order to use the soap api calls in post-install scripts for an application I'm developing on Salesforce.

But when I use the Salesforces interface to generate the classes I get this error on the last file: "Error: partnerSoapSforceCom Error: unexpected token: 'delete' at 711:51"

The line is the following: "public partnerSoapSforceCom.DeleteResult[] delete(String[] ids) {"

It seems that delete is a reserved word in Apex language. So Can I rename it without breaking everything?

ps: I also search samples showing how to call a soap endpoint from apex classes...

1

You have to rename delete, update create methods before creating the Apex class. Check this link https://github.com/financialforcedev/apex-mdapi, under the "How to create your own MetadataService.cls", you will find the answers.

  • Thanks a lot I will give it a try. I also find this link which indicate the same solution – Philippe May 23 '13 at 12:17
0

You have to change method name by appending SObjects in delete, upsert, merge, update and undelete methods as seen below from generated apex class from wsql in order to use the soap api calls in post-install scripts for an application


public partnerSoapSforceCom.DeleteResult[] deleteSObjects(String[] ids) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.