We have a controller code that was working normally last year for us. I took over this probject with no information from the last person to work on these. I am trying to solve an issue where the owner of an application (custom object) is being created as just a basic guest user instead of the user they create by filling out the form. There is a piece of code here that seems to be causing the issue I believe but I cannot find how to fix
public class NewPARedirectExt {
public String conId {get;set;}
public String url {get;set;}
public NewPARedirectExt(ApexPages.StandardController controller){
Id usrId = UserInfo.getUserId();
User u = [SELECT Id, Contact.Name FROM User WHERE Id = :usrId];
if (u.ContactId != null){
conId = u.Contact.Name;
}
}
public PageReference goToCreate(){
Schema.DescribeSObjectResult r = Presentation_Application__c.sObjectType.getDescribe();
String keyPrefix = r.getKeyPrefix();
Event__c ev = [SELECT Id, Name FROM Event__c WHERE Name LIKE '%2019 COABE%' limit 1];
PageReference pr = new PageReference('/presenters/'+keyPrefix+'/e?nooverride=1&CF00No000000CGo3v='+conId+'&CF00No000000CGo3c='+ev.Name);
pr.setRedirect(true);
url = pr.getUrl();
if(conId != null){
return pr;
} else {
return new PageReference('/'+keyPrefix+'/e?nooverride=1&CF00No000000CGo3c='+ev.Name);
}
}
}