• Peter van Heck
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
My custom object "Locations" has a Master-Detail Relationship
with "Accounts", so when I override the "New Location" button
with the S-Control:
Code:
Test1: {!Account.Name}

 and I click "New Location" in "Accounts", it shows:
Test1: Heckwork
 
So far so good.
 
My custom object "Systems" also has a Master-Detail relation
with "Accounts" AND a Lookup Relationship with "Locations".
When I override the "New System" button  with this S-Control:
Code:
Test2: {!Location__c.Name__c}

and I click "New System" in "Locations", it shows:
Test2:
 
Does anyone know why it does not show the value from the
"Locations" "Name" field?
 
Peter


Message Edited by Peter van Heck on 09-26-2008 10:26 AM
Trying to override the "New System" button (on a custom object called Location) I get an error: Invalid Data
with this Custom S-Control:
 
<html>
<head>
<script src="/soap/ajax/8.0/connection.js"></script>
<script>
function pInit() {
 var url = parent.location.href; //URL accessing sControl
 url += "&CF00N80000002ZueH= {!Location__c.Account__c}";
 url += "&nooverride=1"; //
 parent.location.href = url; //pass full URL to page (refresh)
}
</script>
</head>
<body onload="pInit()">
</body>
</html>
 
 
when I change:
 url += "&CF00N80000002ZueH= {!Location__c.Account__c}";
into:
 url += "&CF00N80000002ZueH= Jansen";
it works.
 
Can anyone tell me what might be wrong?
 
Peter
I have 2 custom objects, Locations and Systems, which both have a
Master-Detail relation with Account: Systems also has a Locations
lookup field.
 
After I created a New Location (record) I would like to create New
Systems (records) from Locations.
 
How do I set the default value for the (Master-Detail) field Account.Name,
which has already been entered in Locations?
 
I have tried it with a formula field called Account_ID and a trigger
but I do not get it work:
 
Code:
trigger CopyAccountID on System__c (before update, before insert) {
For (System__c accid:Trigger.new)
// 
      { 
       accid.Account__c = accid.Account_ID__c;
       }
//    }

}

 


Message Edited by Peter van Heck on 09-22-2008 05:29 AM
Trying to override the "New System" button (on a custom object called Location) I get an error: Invalid Data
with this Custom S-Control:
 
<html>
<head>
<script src="/soap/ajax/8.0/connection.js"></script>
<script>
function pInit() {
 var url = parent.location.href; //URL accessing sControl
 url += "&CF00N80000002ZueH= {!Location__c.Account__c}";
 url += "&nooverride=1"; //
 parent.location.href = url; //pass full URL to page (refresh)
}
</script>
</head>
<body onload="pInit()">
</body>
</html>
 
 
when I change:
 url += "&CF00N80000002ZueH= {!Location__c.Account__c}";
into:
 url += "&CF00N80000002ZueH= Jansen";
it works.
 
Can anyone tell me what might be wrong?
 
Peter