Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Java Development
- :
- Can not create a custom field in a junction object
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Can not create a custom field in a junction object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-08-2012 09:50 AM
Hello, I am trying to create a custom junction object, and one of the relationship fields is supposed to point to Contact.
I can not find any documentation that would explain well which properties exactly and how need to be set for master-detail relationship fields. As a result the service silently ignores my creation request. Here is the first field that I am trying to add but it would not add:
fullNAme=MyCustomObject__c.Contact_c
label=Contact
type=FieldType.MASTER_DETAIL
rteferenceTo=Contact
relationshipLabel=Participant
relationshipName=Contact.Id
relationshipOrder=0
Any help would be really appreciated.
-Alexey
Solved! Go to Solution.
Re: Can not create a custom field in a junction object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-09-2012 12:17 AM
Actually even adding a LOOKUP field on a regular custom object does not seem to work, simply ignored by the service without any errors. Non-relationship fields can be added just fine but something is wrong with adding relationship fields.
Please advise.
Re: Can not create a custom field in a junction object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-09-2012 01:29 PM
Ok, I think I finally figured this out. Here is the correct settings:
fullNAme=MyCustomObject__c.Contact_c
label=Contact
type=FieldType.MASTER_DETAIL
rteferenceTo=Contact
relationshipLabel=Participant
relationshipName=MyCustomLookupName <---
relationshipOrder=0
"Contacts" was not allowed for the Contact object
Re: Can not create a custom field in a junction object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-16-2012 06:49 AM
It looks like you've figured this out already.
I have found that, when working with the metadata API, it is a good practice to investigate the XML files used in the IDE to see how the attributes are used.
In this case I would have looked at an existing Master-Detail relationship in a .object file. It will look something like this. You can use these values as a guide to the attributes in the metadata API.
<fields>
<fullName>Pay_Period__c</fullName>
<deprecated>false</deprecated>
<externalId>false</externalId>
<inlineHelpText>The Pay Period for this timesheet.</inlineHelpText>
<label>Pay Period</label>
<referenceTo>Pay_Period__c</referenceTo>
<relationshipName>Timesheets</relationshipName>
<relationshipOrder>0</relationshipOrder>
<trackHistory>false</trackHistory>
<type>MasterDetail</type>
<writeRequiresMasterRead>false</writeRequiresMaste rRead>
</fields>
Re: Can not create a custom field in a junction object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-18-2012 02:57 AM
yes, thank you. it's my first time using this api and I was not properly checking the status/errors, basically missing an important error message. finally figure it out. still alot to learn but I seem to be moving along just fine now.

