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
papayapapaya 

cross object referencing with S-controls

Hi,

I'm currently using HTML in an S-control to obtain field data from OBJECT A and I'm placing it as a non-editable field in OBJECT B. In order to do this, it is my understanding that you first need to create a Master-detail field relationship between the two objects before you can cross reference information. Please correct me if I'm wrong as this is the reason why I'm confused.

If I wanted to cross reference an additional field from OBJECT C and place the field in OBJECT B, would I need to create another type of relationship? I know you can only create one Master-detail relationship between two objects and if this is the case, am I stuck? Any help is greatly appreciated!
UsamaUsama
Hi,
         You have to create a lookup relationship field of Object A in the Object B.In otherwords relationship field created in the Object A will be treated as foriegn key in Object B.Similarly create a lookup relationship field of Object B in the Object C ,Object B relationship field will be treated as foriegn key in the objectC.By doing this, you get following One to Many relationships.
1) Object A to Object B (one to many)
2) Object B to Object C (one to many)
 
yes you right we can create only one master-detail relationship in object.Master-Detail relationship is the stronger form of the lookup relationship.
 
 
 
dnewportdnewport
I am attempting to do something similar....but have no idea where to begin.  Are there any "code snippets" available to use for this functionality?
papayapapaya
here's a sample that I used to obtain the field ACCOUNTNUMBER from the ACCOUNT table. This is placed inside an S-control.

<html>
<head>

<style type="text/css">
.label {
font-family: 'Arial', 'Helvetica', sans-serif;
font-size: 11;
font-weight: bold;
color:#333;
white-space: nowrap;
}
</style>
</head>
<body>
<table cellpadding="0" cellspacing="0">
<tr>
<td width="75" class="label">&nbsp;</td>
<td class="label">Merchant ID</td>
<td width="20" class="label">&nbsp;</td>
<td class="label"><INPUT TYPE="text" VALUE="{!Account.AccountNumber}"></td>
<td width="120" class="label">&nbsp;</td>
</tr>
</table>
</body>
</html>
papayapapaya
Thank you! I was able to reference the correct data creating a lookup relationship from OBJECT C in OBJECT B but I wish there was a way to select which fields you access when you create a lookup relationship instead of having to use, what seems to be, the primary key field. Do you know of any way around that?