Пример #1
0
        public bool QueryOneToManyRelationship()
        {
            RetrieveRelationshipRequest request = new RetrieveRelationshipRequest();
            request.Name = "contact_customer_accounts";
            request.RetrieveAsIfPublished = true;

            RetrieveRelationshipResponse response = (RetrieveRelationshipResponse) OrganizationServiceProxy.Execute(request);
            OneToManyRelationshipMetadata relationship = (OneToManyRelationshipMetadata)response.RelationshipMetadata;
            Assert.AreEqual(relationship.IsCustomRelationship, false);
            Assert.AreEqual(relationship.SchemaName,"contact_customer_accounts");
            Assert.AreEqual(relationship.ReferencedAttribute, "accountid");
            return true;


        }
Пример #2
0
        public bool QueryManyToManyRelationship()
        {
            RetrieveRelationshipRequest request = new RetrieveRelationshipRequest();
            request.Name = "accountleads_association";
            request.RetrieveAsIfPublished = true;

            RetrieveRelationshipResponse response = (RetrieveRelationshipResponse)OrganizationServiceProxy.Execute(request);
            ManyToManyRelationshipMetadata relationship = (ManyToManyRelationshipMetadata)response.RelationshipMetadata;
            Assert.AreEqual(relationship.IsCustomRelationship, false);
            Assert.AreEqual(relationship.SchemaName, "accountleads_association");
            Assert.AreEqual(relationship.IntersectEntityName, "accountleads");
            
            return true;


        }