+ Start a Discussion
Lucas Arruda 8Lucas Arruda 8 

Anonymous Blocks using a object as a param

Hello,

I'm tryin to execute a method using the anonymous execute functionality, however the method that i'm trying to execute it is using a object as a paramter, and when i try to pass an Id de execution gives me an error saying that the param type for string is invalid.

className.doTransfer(transfer__c pTransf)

So I want to know how can I execute this method.

Thank you!
Best Answer chosen by Lucas Arruda 8
Raj VakatiRaj Vakati
Hi Lucas , 

Please try like this. 

transfer__c pTransf = [Select Id from transfer__c  limit 1] ; 

className.doTransfer(pTransf)



 

All Answers

Raj VakatiRaj Vakati
Hi Lucas , 

Please try like this. 

transfer__c pTransf = [Select Id from transfer__c  limit 1] ; 

className.doTransfer(pTransf)



 
This was selected as the best answer
Lucas Arruda 8Lucas Arruda 8
Hello Rajamohan!

It worked like a charm! Thank you very much!