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
nagnknagnk 

Error Error: Compile Error: unexpected token: 'public class Con_Opt_Invoke_Class' at line 1 column 0

public class Con_Opt_Invoke_Class{
 @future(callout=true)
  public static void Con_Opt_Invoke_Ins_Mtd(Id d)
  {
    Opportunity optrec=[select name, description, account.name from Opportunity where id=:d];
  
   sobjectPartner3.Soap        obj1  = new sobjectPartner3.Soap();
    sobjectPartner3.LoginResult lr    = obj1.login('adminnaveen@gmail.com','Rn98481649#');

    Con_OpportunitiesCLS.Pub_OpportunitiesCls  obj = new Con_OpportunitiesCLS.Pub_OpportunitiesCls();

    obj.sessionHeader           = new Con_OpportunitiesCLS.sessionHeader_element();
    obj.sessionHeader.sessionid = lr.sessionId;

    obj.Pub_InsertOptMtd(optrec.name, optrec.description, '0019000000RcEWX');
  }
}
Abhishek BansalAbhishek Bansal
Hi,

I copied and pasted the same code of your class in my apex class and it saved successfully.
Please check the componenet in which you are trying to save the apex class.
There is no issue with the syntax and the only possible cause is you are saving it in some other components like Apex Triggers or something else.

Thanks,
Abhishek
nagnknagnk
Hi Abhishek,

I tried one more time again iam getting same error
Sindhu1234Sindhu1234
Hi Naveen,
Can you expalin where your trying to save the code?
Is it under Apex Class or Apex trigger?
nagnknagnk
Hi Sindhu,

under Apex  class
Abhishek BansalAbhishek Bansal
Hi ,

Please comment the code in your method and than try to save the class.
Please use below code :
public class Con_Opt_Invoke_Class{
 @future(callout=true)
  public static void Con_Opt_Invoke_Ins_Mtd(Id d)
  {
    /*Opportunity optrec=[select name, description, account.name from Opportunity where id=:d];
  
   sobjectPartner3.Soap        obj1  = new sobjectPartner3.Soap();
    sobjectPartner3.LoginResult lr    = obj1.login('adminnaveen@gmail.com','Rn98481649#');

    Con_OpportunitiesCLS.Pub_OpportunitiesCls  obj = new Con_OpportunitiesCLS.Pub_OpportunitiesCls();

    obj.sessionHeader           = new Con_OpportunitiesCLS.sessionHeader_element();
    obj.sessionHeader.sessionid = lr.sessionId;

    obj.Pub_InsertOptMtd(optrec.name, optrec.description, '0019000000RcEWX');*/
  }
}

Just give a try to the above code and try to save it.
If you still see an error than there may be something wrong which can't be figure out here.

If you need help than you can contact me on :
Gmail : abhishek.bansal@metacube.com
SkypeId : abhishek.bansal2790

Thanks,
Abhishek