Community
Showing results for 
Search instead for 
Do you mean 
Reply

CUSTOM FIELDS: Getting error "LookupColumnByAlias: alias not valid field name"

Accepted Solution Solved
Copper Super Contributor
Posts: 28
Country: Canada
Accepted Solution

CUSTOM FIELDS: Getting error "LookupColumnByAlias: alias not valid field name"

Okay I made a custom field called "Archived" it is a drop down field with a a numberical list containing 1 or 0 (1 being archived, 0 otherwise). 

 

I've accessed Custom Fields successfully before by using code such as this:

 

string field = con.Fields["Example Field", FieldNameType.Alias];

 

 

However when doing so with this field, it returns the error:

 

Act.Framework.MutableEntities.MutableEntityMetaDataArgumentException: LookupColumnByAlias: alias not valid field name
Parameter name: alias

 

Anything I'm doing wrong here?

 

Code for reference:

Debug.WriteLine("Archived Value: " + con.Fields["Archived", FieldNameType.Alias]);

 

Thanks in advance!

 


Accepted Solutions
Solution
Accepted by topic author 2gen
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 28
Country: Canada

Re: CUSTOM FIELDS: Getting error "LookupColumnByAlias: alias not valid field name"

I've solved the issue. It looks as though, when creating a custom field, if you change the field name of it after you've initially created it, the code still requires the old field name.

 

Upon creating the custom field is if you named it - "field1"

 

If you use:

con.Fields["field1", FieldNameType.Alias]

 You will get the set value.

 

However if you then change this initial field value after the fact to, for example - "field2" and then change the code to conform to the new name, like so:

con.Fields["field2", FieldNameType.Alias]

 Said error will appear.

 

However, if you revert your code to using the initial field name (while keeping the custom field name in ACT as "field2") like so:

con.Fields["field1", FieldNameType.Alias]

 It will work.

 

It looks as though ACT API has an issue, where it does not update the reference to the field name, upon changing your initial field name value.

View solution in original post


All Replies
Solution
Accepted by topic author 2gen
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 28
Country: Canada

Re: CUSTOM FIELDS: Getting error "LookupColumnByAlias: alias not valid field name"

I've solved the issue. It looks as though, when creating a custom field, if you change the field name of it after you've initially created it, the code still requires the old field name.

 

Upon creating the custom field is if you named it - "field1"

 

If you use:

con.Fields["field1", FieldNameType.Alias]

 You will get the set value.

 

However if you then change this initial field value after the fact to, for example - "field2" and then change the code to conform to the new name, like so:

con.Fields["field2", FieldNameType.Alias]

 Said error will appear.

 

However, if you revert your code to using the initial field name (while keeping the custom field name in ACT as "field2") like so:

con.Fields["field1", FieldNameType.Alias]

 It will work.

 

It looks as though ACT API has an issue, where it does not update the reference to the field name, upon changing your initial field name value.