Community
Showing results for 
Search instead for 
Do you mean 
Reply

Association Manager

gkl
Copper Contributor
Posts: 29
Country: Ecuador

Association Manager

[ Edited ]

I am trying to create an association between two cutom subentities. I have read the code samples that come with act, but I still have some questions.

1)What is  the reference you have to add so as to use the Association Manager of the SDK?

2)Can i change the sample code above that comes with act and use the subentity manager so that i can associate two custom subentities as parent-childs entities?

 

 

//Log into the framework and retrieve the correct AssociationManager

ActFramework ACTFM = new ActFramework();

ACTFM.LogOn("C:\\Documents and Settings\\Administrator\\My Documents\\ACT\\Act for Win 8\\Databases\\Act8Demo.pad", "Chris Huffman", "");

AssociationManager associationManager = ACTFM.Associations.GetAssociationManager(company, opportunity);

//Create the assocaition

Association association = associationManager.CreateAssociation(contactOne, contactTwo);

//First means of setting association information

association.Fields[StandardField.Details] = "Association Details";

//Second meand of setting association information

AssociationFieldDescriptor field = associationManager.GetFieldDescriptor(StandardField.Entity1Role);

field.SetValue(association, "First entities role in this assocaition");

//Persist the association to the database.

assocaiton.Update();