Community
Showing results for 
Search instead for 
Do you mean 
Reply

Getting Exception - Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException

Accepted Solution Solved
Copper Super Contributor
Posts: 18
Country: United_Kingdom
Accepted Solution

Getting Exception - Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException

I am trying to get contact details for custom fields.  I am using the following code:

contact.Fields["CUST_ForeName_121908292", false].ToString();

 

However this gives me  a Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException.  


Accepted Solutions
Solution
Accepted by topic author satyajit_singh
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 18
Country: United_Kingdom

Re: Getting Exception - Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException

Thanks Matthew that helped, I was not on theCompany screen view. 

Could you please also let me know how I could possibly data bind my custom contol. Do i need to implement it as a plugin?

 

Thanks

 

Satyajit

View solution in original post


All Replies
Employee
Posts: 1,163
Country: USA

Re: Getting Exception - Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException

Do the same results occur if you get the field descrptor first and then call GetValue?

 

The psuedo code would look like this:

 

Contact myContact = ActApp.ApplicationState.CurrentContact:

DBFieldDescriptor dbf = ActApp.ActFramework.Contacts.GetContactFieldDescriptor("CUST_ForeName_121908292", true);

dbf.GetValue(myContact);

Matthew Wood
Act! SDK Support
Community Moderator
Copper Super Contributor
Posts: 18
Country: United_Kingdom

Re: Getting Exception - Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException

[ Edited ]

Yes, I still get the same error. What I am trying here is to get a list of contacts based on the organisation/company name.

 

I have now tried to do this via OLeDB using the query string as:

 

""select FullName from Tbl_CONTACT where COMPANYNAME='xxx''";

 

however this gives me an error as invalid Table name. I have this now resolved by using a SQL connection. 

 

I had tried to do this earlier by using Ifilter and buiding a contact list. 

codeis as:

string currentCompany = ActApplication.Instance.ApplicationState.CurrentCompany.ToString();
Act.Framework.Contacts.ContactList cList = ActApplication.Instance.ApplicationState.CurrentContactList;

Act.Framework.Lookups.CriteriaColumn cColumn = ActApplication.Instance.ActFramework.Lookups.GetCriteriaColumn("Tbl_Contact", "COMPANYNAME", true);
Act.Framework.Lookups.OperatorEnum oPerator = Act.Framework.Lookups.OperatorEnum.EqualTo;
Act.Framework.Lookups.Criteria[] lCriteria = new Act.Framework.Lookups.Criteria[] {new Act.Framework.Lookups.Criteria( Act.Framework.Lookups.LogicalOperator.End, byte.Parse("0"), byte.Parse("0"), cColumn, oPerator, currentCompany)};
Act.Framework.Lookups.ContactLookup cLookup = ActApplication.Instance.ActFramework.Lookups.LookupContactsReplace(lCriteria,true,true);
cList = cLookup.GetContacts(null);

 

however I got  the error : Additional information: Column is null...

the problem here is that I am not getting the value of the current company. If I provide a static value here this works. Can anyone let me know how can I get the value of the current company

 

Copper Super Contributor
Posts: 18
Country: United_Kingdom

Re: Getting Exception - Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException

Also can anyone help and let me know how I can bind a csutom .net user control to a company datafield

Employee
Posts: 1,163
Country: USA

Re: Getting Exception - Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException

The error that you're getting in your oledb query is occuring because we're using the real table name instead of it's alias.

 

Change the query to "select FullName from CONTACT where COMPANYNAME = 'xxx'"

 

As for the code, is the exception is thrown here:

string currentCompany = ActApplication.Instance.ApplicationState.CurrentCompany.ToString(); 

?

 

If so are you on a company view? There is no CurrentCompany if you aren't in a company view.

Matthew Wood
Act! SDK Support
Community Moderator
Solution
Accepted by topic author satyajit_singh
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 18
Country: United_Kingdom

Re: Getting Exception - Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException

Thanks Matthew that helped, I was not on theCompany screen view. 

Could you please also let me know how I could possibly data bind my custom contol. Do i need to implement it as a plugin?

 

Thanks

 

Satyajit