I have a visualforce page with custom buttons. Twas asked to add to the Custom Setting a field called ATLAS_ENDPOINT. I need to use this value to popup a new window with the link inside.
VISUALFORCE
<apex:page standardController="Case" sidebar="false" extensions="LEORDERSAPIExtension">
<apex:form >
<script>
function finalRedirect()
{
window.location = "https://c.cs11.visual.force.com/apex/OrderSubmitted?&id={!Case.Id}";
}
</script>
<apex:pageBlock title="Please Confirm Order Details">
<apex:pageBlockSection title="Order Details" columns="2">
<apex:OutputText Label="Account ID" value="{!Case.Account.Id}"/>
<apex:OutputText Label="Account Number" value="{!Case.Account_Number_c__c}"/>
<apex:OutputText Label="Alternate phone" value="{!Case.Alternate_Phone__c}" />
<apex:OutputText Label="primary street" value="{!Case.Account.BillingStreet}"/>
<apex:OutputText Label="primary city" value="{!Case.Account.billingcity}"/>
<apex:OutputText Label="primary state" value="{!Case.Account.BillingState}"/>
<apex:OutputText Label="primary zip" value="{!Case.Account.BillingPostalCode}"/>
<apex:OutputText Label="created by" value="{!Case.Createdby.Name}"/>
<apex:OutputText Label="created by user Id" value="{!Case.Createdby}"/>
<apex:OutputText Label="digital contract length (months)" value="{!Case.Opportunity__r.Digital_Contract_Length_Text__c}"/>
<apex:OutputText Label="primary country" value="{!Case.Account.BillingCountry}"/>
<apex:OutputText Label="email" value="{!Case.Contact.Email}"/>
<apex:OutputText Label="fax" value="{!Case.Account.Fax}"/>
<apex:OutputText Label="Contact First Name" value="{!Case.Contact.FirstName}"/>
<apex:OutputText Label="Contact Last Name" value="{!Case.Contact.LastName}"/>
<apex:OutputText Label="Oppty Owner Manager Email" value="{!Case.Opportunity__r.Owner.Manager.Email}"/>
<apex:OutputText Label="Case Market" value="{!Case.Case_Market__c}"/>
<apex:OutputText Label="Account Name" value="{!Case.Account.Name}"/>
<apex:OutputText Label="Opportunity Owner First Name" value="{!Case.Opportunity__r.Owner.FirstName}"/>
<apex:OutputText Label="Opportunity Owner Last Name" value="{!Case.Opportunity__r.Owner.LastName}"/>
<apex:OutputText Label="Contact Phone" value="{!Case.Contact.Phone}"/>
<apex:OutputText Label="Account Phone" value="{!Case.Account.Phone}"/>
<apex:OutputText Label="Total digital monthly fees" value="{!Case.Opportunity__r.Total_Digital_monthly_Fees__c}"/>
<apex:OutputText Label="total setup fees" value="{!Case.Opportunity__r.Total_Setup_Fees__c}"/>
<apex:OutputText Label="website" value="{!Case.Account.Website}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!sendOrder}" value="Send Order" oncomplete="finalRedirect();" />
<apex:commandButton action="{!Cancel}" value="Cancel"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
APEX CLASS
public class LEORDERSAPIExtension {
private Id caseRecordId; public LEORDERSAPIExtension(ApexPages.StandardController controller) { caseRecordId = controller.getRecord().Id;
} public void sendOrder() {
BPMIntegrationService.postCaseRecordToBPM(caseRecordId);
}
}
CUSTOM SETTING
Label BPM Integration Object Name BPM_Integration
API Name BPM_Integration__c Setting Type Hierarchy
Visibility Public Description
Namespace Prefix Created Date 8/8/2014 10:06 AM
Last Modified Date 8/8/2014 10:08 AM Record Size 1,870