+ Start a Discussion
Milan HrdlickaMilan Hrdlicka 

Master-detail and look up

Hello,

1.) I have an "Account" standard object which is in master-detail relationship with custom object "Shop" where I added custom field "Account" which is of "Master-Detail" field linked to the Account Object.
I am not sure how to "connect" these objects - should I put an ID of particular Account record in custom field "Account" of Master Detail type which is part of custom object "Shop"? How would 'I get the ID of particular "Account" record?


2.) I have also created a custom object "Opening_Hours" which is linked to custom object "Store"  as I have added custom field to the "Store" object which is called "Open_Hours_Id" and is linked via lookup to custom object "Opening_Hours". The "primary key" for particular opening hours is of type text so "Opening_Hours" has an "ID record" of type text.
The question is how to insert "Opening_Hours" object's "ID record" to the custom field "Open_Hours_Id" of custom object "Store"_

Appreciate your help,
Milan
Amit VaidyaAmit Vaidya
1) You can get the id of the Account like using SOQL as follows:
Select Id, Account.Id from Shop

2) I am not getting what is ID record you are referring to and where you wanted to insert Opening Hours object through UI or code?