Community
Showing results for 
Search instead for 
Do you mean 
Reply

How to set object value programitically

Accepted Solution Solved
Tuned Listener
Posts: 7
Country: India
Accepted Solution

How to set object value programitically

Hi,Everyone

 

I am new in ACT.

 

How to set value of Field whose FieldType is "Company" or Contact

 

I have two fileds "Lawyers" and "Lawyer 1".

 

"Lawyers" FieldType is "Company"

"Lawyers" FieldType is "Contact"

 

   

SetValue("Lawyers) =""
SetValue("Lawyer 1 Claim") =""

 

Please help me for this issue.Thanks in advance


Accepted Solutions
Highlighted
Solution
Accepted by rkain (Copper Super Contributor)
‎09-25-2015 03:20 AM
Copper Contributor
Posts: 123
Country: Canada

Re: How to set object value programitically

ContactFieldDescriptor lawyerField = actFwk.Contacts.GetContactFieldDescriptor("Lawyers", FieldNameType.Alias);
Contact contact = actApp.ApplicationState.CurrentContact;
lawyerField.SetValue(contact, "value");
contact.Update();

or

Contact contact = actApp.ApplicationState.CurrentContact;
contact.Fields["Lawyers", FieldNameType.Alias] = "value";

contact.Update();

Then you can do the same for Companies by replacing Contact with Company.

Hope that helps.

View solution in original post


All Replies
Highlighted
Solution
Accepted by rkain (Copper Super Contributor)
‎09-25-2015 03:20 AM
Copper Contributor
Posts: 123
Country: Canada

Re: How to set object value programitically

ContactFieldDescriptor lawyerField = actFwk.Contacts.GetContactFieldDescriptor("Lawyers", FieldNameType.Alias);
Contact contact = actApp.ApplicationState.CurrentContact;
lawyerField.SetValue(contact, "value");
contact.Update();

or

Contact contact = actApp.ApplicationState.CurrentContact;
contact.Fields["Lawyers", FieldNameType.Alias] = "value";

contact.Update();

Then you can do the same for Companies by replacing Contact with Company.

Hope that helps.