You need to sign in to do that
Don't have an account?
Gaurav Agnihotri
3 Extra Characters after Quote Id when button opens a VF page
Gurus,
I never came across such an issue. I am opening a visual force page by a button and passing Quote Id. This page has three 4 buttons that open a URL within salesforce. The issue is that the Quote Id has an extra 3 characters at the end of Quote Id and it does not open the right URL.
Here is the class:
Here is Page:
As you can see there are 3 extra characters "CAK" after Quote Id
Regards,
Gaurav
I never came across such an issue. I am opening a visual force page by a button and passing Quote Id. This page has three 4 buttons that open a URL within salesforce. The issue is that the Quote Id has an extra 3 characters at the end of Quote Id and it does not open the right URL.
Here is the class:
public class QuoteToExcelClass { public String Page {get; set;} public String OpenPageURL {get; set;} public Id sQuoteId {get; set;} public void QuoteToExcelClass(ApexPages.StandardController controller ) { } public void QuoteToExcelClass() { Page = '' ; OpenPageURL = '' ; } public void redirect() { sQuoteId= ApexPages.currentpage().getparameters().get('id'); if(Page == 'Dealer') { OpenPageURL = 'https://pelcosales.schneider-electric.com/Salesforce/ExportQuote/Index/'+sQuoteId+'/Dealer'; } if(Page == 'Standard') { OpenPageURL = 'https://pelcosales.schneider-electric.com/Salesforce/ExportQuote/Index/'+sQuoteId+'/Standard'; } if(Page == 'Discounted') { OpenPageURL = 'https://pelcosales.schneider-electric.com/Salesforce/ExportQuote/Index/'+sQuoteId+'/Dealer'; } if(Page == 'MSRP') { OpenPageURL = 'https://pelcosales.schneider-electric.com/Salesforce/ExportQuote/Index/'+sQuoteId+'/Dealer'; } } }
Here is Page:
<apex:page id="pg" standardController="Quote" extensions="QuoteToExcelClass"> <apex:form > <apex:actionFunction action="{!redirect}" name="OpenPage" reRender="pb,theIframe"> <apex:param assignTo="{!Page}" value="" name="param1"/> </apex:actionFunction> <apex:pageBlock id="pb"> <apex:pageBlockButtons > <apex:commandButton value="Discounted" onclick="OpenPage('Discounted'); return false;"/> <apex:commandButton value="MSRP" onclick="OpenPage('MSRP'); return false;"/> <apex:commandButton value="Standard" onclick="OpenPage('Standard'); return false;"/> <apex:commandButton value="Dealer" onclick="OpenPage('Dealer'); return false;"/> </apex:pageBlockButtons> <apex:outputText style="font-style:italic" value=" this is just a test value will not be in Production: {!OpenPageURL}"> </apex:outputText> <apex:iframe id="theIframe" src="{!OpenPageURL}" scrolling="true"/> </apex:pageBlock> </apex:form> </apex:page>
As you can see there are 3 extra characters "CAK" after Quote Id
Regards,
Gaurav
If you require that the Id be 15 characters long, you can always trim it
[1] https://help.salesforce.com/apex/HTViewSolution?id=000004383&language=en_US (https://help.salesforce.com/apex/HTViewSolution?id=000004383&language=en_US)
All Answers
If you require that the Id be 15 characters long, you can always trim it
[1] https://help.salesforce.com/apex/HTViewSolution?id=000004383&language=en_US (https://help.salesforce.com/apex/HTViewSolution?id=000004383&language=en_US)