One or more code values in the lookup table either do not match the mask defined for the code or contain more than 255 characters

In this post, we will solve “One or more code values in the lookup table either do not match the mask defined for the code” that you may face when configuring a lookup table in Project Server 2016.

You might also like to read Custom lookup table filter in Project Server 2016


One or more code values in the lookup table either do not match the mask defined for the code

In Project Server 2016, I have tried to create a two-level lookup table for a custom field by doing the following:

Create a lookup table field in Project Server

  • PWA settings > Enterprise Custom field > Lookup Tables.
Create enterprise Custom field in Project Server
Create a lookup table in Project Server
  • I have added two level value as shown below.
Multiple level lookup table field in Project Server
  • Once I finished and clicked save, I got the below error:

The Lookup table could not be saved due to the following reasons:
One or more code values in the lookup table either do not match the mask defined for the code or contain more than 255 characters

One or more code values in the lookup table either do not match the mask defined for the code or contain more than 255 characters

Cause

The Lookup table could not be saved due to the Code Mask is by default defined for only one level, To be able add additional levels in the lookup table in Project Server, you should at least define its Code Mask sequence field based on the mask of your level.

Define Code Mask for Lookup Table In Project Server

Define Code Mask for Lookup Table In Project Server

In the “Lookup field” creation page, you should add a new code mask sequence level based on your level data type and the sequence number.

In my case, I have a string-level data type with tow level sequence. therefore, the code mask for two level should look like the following:

Code Mask for Lookup Table

After adjusting The Lookup table Code Mask setting, try now to save it, that should be now saved properly.

Note: you must define a code mask for each level in your heraricy lookup table values.


Conclusion

To avoid this error “One or more code values in the lookup table either do not match the mask defined for the code” , and to be able to add multiple hierarchy values in lookup table in Project Server, you must first define the code mask for each level in your hierarchy.

Applies To
  • Project Server 2016.
  • Project Server 2013.
  • Project Server 2010.
See Also

2 thoughts on “One or more code values in the lookup table either do not match the mask defined for the code or contain more than 255 characters”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top