You need to sign in to do that
Don't have an account?
Pooja Shah
Redirecting to the contract page in S control
<!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>
This gets into an infinite loop because of
this.parent.top.location.replace("/"+currentContractId) if i change the url here to something /apex/_____ then it works.
I want to redirect it to the default contract view page.
Any ideas how that can be achieved.
Last option is that i recreate a visual force page identical to the contract view page and direct it there.
pooja
<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>
This gets into an infinite loop because of
this.parent.top.location.replace("/"+currentContractId) if i change the url here to something /apex/_____ then it works.
I want to redirect it to the default contract view page.
Any ideas how that can be achieved.
Last option is that i recreate a visual force page identical to the contract view page and direct it there.
pooja
{!URLFOR(target, id, [inputs], [no override])}
See the online help for more information about URLFOR, $Action and other formula functions/globals.
Note: You should not be relying on salesforce.com URL patterns, parameter names or DOM IDs as they are subject to change at any time.