I created cdt after that i need to add foreign key, to link into the view table
Discussion posts and replies are publicly visible
I am not sure what exactly you want to achieve, but any foreign key constraints have to be created using custom SQL scripts.
Actually, I edited my foreign key in database using SQL, but in my Data Type i can't change.Even I edited by Xcd file and i try to created new version, but is giving error
As I do not know what you want to achieve, supporting becomes mostly guesswork.
I suggest to follow this guide to design your data: docs.appian.com/.../cdt_design_guidance.html
I've found that when you need to update your DB to add a column. (Don't add column in editor, it won't point to your DB column)
1: Add Column in Database
2: Open Data Type in editor
3: Download XSD from Editor
4: Edit XSD to add additional column (Try to copy an existing element group that matches new DB column Definition, and change labels)
5: Save changes
6: In Data Type editor, "Create new from XSD" and use your newly updated XSD
Other commentor has already provided a way. If that does not helps, please attach the screenshot of the table structure and the CDT file (Add XSD also if possible) FYI, adding foreign key relations on CDT level has no impact and is just for visual identifications.