|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Journeyman |
Ok, I've got 2 contacts (by contactID) and want to establish a relationship. It seems as if creating a new relationship object and setting the source and destination contacts, as well as the relationship type, should do it - but no go. No error, but no relationship, either.. Any ideas?
-- assume we already have 2 contact objects -- and this is getting the relationship type relqual := BDQualifier qualifierWhereValueOfKey:'name' isLike:'is spouse of'. relTypeContext := objectContext objectsForEntityNamed:'RelationshipType' matchingQualifier:relqual. theRelType := relTypeContext objectAtIndex:0. theRelTypeID := theRelType relationshipTypeID. newRelationship := (createContactContext createObjectForEntityNamed:'Relationship' addToObjectContext: YES). newRelationship setValue:firstContactSetID forKeyPath:'sourceContact.contactID'. newRelationship setValue:secondContactSetID forKeyPath:'destinationContact.contactID'. newRelationship setValue:theRelTypeID forKeyPath:'relationshipType.relationshipTypeID'. objectContext saveChanges. -- The relationship does get created, I can log it's relation ID. Just not getting the actual contacts to relate. Thanks! -E |
||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

