You need to sign in to do that
Don't have an account?
Pooja Shah
Retrieving record types of contract in a s control
I need to navigate to a different page other than the one shown by default for a particular record type of a contract.
I am writing a s control for the same. How do i retrieve and compare a contract record type and do the navigation using a S control
Thanks in advance
Pooja
I am writing a s control for the same. How do i retrieve and compare a contract record type and do the navigation using a S control
Thanks in advance
Pooja
But it is not from a particular visual force page that i have developed.
It is when the view link is clicked with in the contract this has to happen
so i have coded it like this
But this goes into an infintie loop. Any idea of how to solve this issue.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/12.0/connection.js"></script>
<script>
function redirectToContractSummary()
{
//Retrieving values about the current contract.
var clickingUser = sforce.connection.getUserInfo();
var currentContractId = "{!Contract.Id}";
var contractResults = sforce.connection.query ("select Id, RecordTypeId from Contract where Id = '" +currentContractId+ "'");
var contractRecords = contractResults.getArray("records");
var createdBy = "{!Contract.CreatedBy}";
var UserId = "{!User.Name}";
if (contractRecords[0].RecordTypeId == '012T0000000CmwkIAC')
{
this.parent.top.location.replace("/apex/contract_summary?contractId="+currentContractId);
}
else if (contractRecords[0].RecordTypeId == '012700000000vXAAAY')
{
this.parent.top.location.replace("/"+currentContractId);
}
}
redirectToContractSummary();
</script>
</head>
<body>
</body>
</html>
Message Edited by dchasman on 06-18-2008 10:01 AM
This page, with just a detail component in it, looks exactly like your current detail page, driven off of page layout and everything.
So you set this one to be your override page for contract view and then reroute() will get run whenever the view is brought up, redirecting to your new page if necessary.
when i select on the radio button of s controls it shows me a list of existing s controls but when I say visual source page, it doesnt give me any list.
I guess i will have to create another dummy apex page such that it mimicks the look and feel of the contract page
Let me know your suggestions on the same
However it gives me an error (unknown constructor -RerouteDemo.RerouteDemo(Apexpages.standardController controller ) if i put the extensions = "RerouteDemo"
I have copied the code that you have posted without any changes.
Pooja
public RerouteDemo(ApexPages.StandardController stdController) {
//do Nothing
}