function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
alonmalonm 

URLFOR parameters

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11">

I have two custom objects sutTer__c (which i call TER for clarity) and sutTraveller__c (Traveller). TER object has a lookup field into Traveller. When the user creates a new TER, I want him to see the last name of the traveller. I tried to do it by overriding the new button of TER with the following s-control:

<html>

<head>

<title></title>

<script>

//First construct the new URL

var newUrl = "{!URLFOR( $Action.sutTer__c.New, null,

[Traveller__c=sutTraveller__c.Name, TravellerLastName__c=sutTraveller__c.LastName__c, retURL=$Request.retURL] ,true)}";

//Then redirect the user to it

window.parent.location.replace(newUrl);

</script>

</head>


but this does not work: the Traveller and "Traveller last name" fields are blank when i open a new TER. I tried different approaches as well (like putting the field id (from the URL) instead of the field name, but this couldnt be saved, i got always a syntax error massage).


Can someone give me advise about the write syntax for URLFOR parameters when i use cumstom objects?

MRutterMRutter

I had the same problem with trying to fill in values in custom fields.  The leading zeros on the field IDs for custom fields causes a syntax error when you try to pass them within the [] brackets.  Here is what has worked for me:

 

<script type="text/javascript">

window.parent.location.href="{!URLFOR($Action.Activity.NewEvent,null,
[retURL=URLFOR( $Action.Contact.View, Contact.Id)]
)} &00N80000002rqFh=Here&RecordType=01280000000EpvV&type=Event&setupid=EventRecords";

</script>

 

Mark