Skip to main content
July 9, 2022
Question

How to set a foreign key after creating a Custom Data Type?

  • July 9, 2022
  • 5 replies
  • 0 views

I created cdt after that i need to add foreign key, to link into the view table

    5 replies

    stefanhelzle0001
    Brainy
    July 9, 2022

    I am not sure what exactly you want to achieve, but any foreign key constraints have to be created using custom SQL scripts.

    July 9, 2022

    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

    stefanhelzle0001
    Brainy
    July 9, 2022

    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

    edwarda1815
    July 11, 2022

    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

    harshitb6843
    July 11, 2022

    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.