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.
- I have added two level value as shown below.
- 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
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
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:
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.
Will done … Thank you
you are welcome 🙂