You need to sign in to do that
Don't have an account?
FinishLocation Issues - Apex
So, I have scoured these forums and several other forums, and while I have found many threads that sort of answer bits and pieces of my plight, I haven't found anything that works the way I need it to yet.
I am brand new to Apex, so I am fully expecting the answer to be staring me in the face without my notice. Any help would be immensely appreciated.
Basically, I have a custom object called Support Tickets (SFDC_Support_Tickets) and I have created a flow for it (Support_Ticket_Creator) that allows users to make one of three record types. In the flow builder, I have set a variable to capture the record's ID for use later in the flow (SupportTicketID) and I have embedded the flow into a Visualforce page (Create_New_Support_Ticket). All I need is for the 'finish' button to take the user to the record that they've just created.
I have tried every variation of solution that I have found. The main issue that I am running into is that I keep getting an error on the Apex Class telling me that SupportTicketID doesn't exist.
Here is the code that I have:
VisualForce
<apex:page Controller="Support_Ticket_Creator" tabstyle="SFDC_Support_Tickets__c" > <br/> <flow:interview name="Support_Ticket_Creator" interview="{!SupportTicketCreator}" finishLocation="{!SupportTicketID}"/> <apex:param name="vOpportunityId" value="{!opptyId}"/> </apex:page>
Apex
public with sharing class Support_Ticket_Creator {
public String SupportTicketCreator { get; set; }
public String getOpptyId() { return getoppId; } public ID returnID = getoppId;
} |
Above is my latest attempt, and the error that I am getting is:
Error: Compile Error: Variable does not exist: getoppId at line 5 column 41 |
So, can anyone help? I am so very stuck and our February release is looming. I appreciate any assistance that anyone can provide!
Hi,
You have missed the declaration of variable oppId.
Try this...
public with sharing class Support_Ticket_Creator {
public String SupportTicketCreator { get; set; }
public String oppId;
public String getOpptyId() { return oppId; }
public ID returnID = oppId;
public PageReference getSupportTicketID () {
if(SupportTicketCreator != null) returnID = Support_Ticket_Creator.SupportTicketID;
PageReference send = new PageReference('/' + returnID);
send.setRedirect(true);
return send;
}
}
Thank you so much for your help! That got rid of that error message, but now I am getting the following:
Error: Compile Error: Variable does not exist: Support_Ticket_Creator.SupportTicketID at line 11 column 57
This is supposed to call the variable SupportTicketID from the Flow itself, and is the format I've seen in many other solutions, but I am apparently missing something. I attempted to declare it as a variable like we did with oppId, but it didn't like that either.
I went back to the flow to make sure that SupportTicketID was created and used to identify the Record ID on the record create step. I just need to be able to pull that from the flow and stick it in a URL for FinishLocation.
Thank you so much for your help so far... do you have any other thoughts?
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public String SupportTicketCreator { get; set; }
public String oppId;
public String getOpptyId() { return oppId; }
public ID returnID = oppId;
public PageReference getSupportTicketID () {
if(SupportTicketCreator != null) returnID = 'Support_Ticket_Creator.SupportTicketID';
PageReference send = new PageReference('/' + returnID);
send.setRedirect(true);
return send;
}
}