You need to sign in to do that
Don't have an account?
Filipe Baradelli
The code stops working
I use a code that initially works, but after some tests it stops working. I copy all the code when it works and after that it stops, I paste it, but doesn't works.
This is the part of the code (that belongs to class Catalog Controller from Catalog Order package):
This is the part of the code (that belongs to class Catalog Controller from Catalog Order package):
public PageReference toCatalog() { // begins here Product2 p2 = new Product2(); p2.Name = 'P2'; p2.isActive = true; insert p2; Opportunity opp2 = new Opportunity(); opp2.Name = 'OPP TESTE'; opp2.CloseDate = System.Today(); opp2.StageName = 'Prospecting'; insert opp2; //ends here if(!Product2.sObjectType.getDescribe().isAccessible()) { ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL,'Insufficient access')); return null; } PageReference next = new PageReference('/apex/catalog_products'); next.setRedirect(false); // Directing to Catalog return next; }
Enreeco
Which error do you see?