You need to sign in to do that
Don't have an account?

Whats wrong with this code?
I can excute this fine in excute anonymous, but when I put it in the class, I get "Unexpected token: '='" at LINE 5
public class testProduct { public Product2 shipping {get;set;} shipping = [SELECT id, name, productcode from PRODUCT2 where productcode='shipping' limit 1];


Contructor is required. nvm.