need to write to database with dynamic cdt type

Team,

Scenario, We have a UI where Admin team selected the table from dropdown where they want to make changes . Now i have to send that CDT as an input to write to datastore from interface.

Can this is something we can do , entity remains same but input changes based on user selection .

What to select in type usually we select CDT for which we want change , but in my case it will come from UI. Any thoughts how to do it ? or any other solution basically based on table selection we need to update a value in one column,

  Discussion posts and replies are publicly visible

Parents
  • Hi Gaurav,

    Following are the 2 options i would try 

    a) a!writeToDataStoreEntity()  might help you. based on the user selection you can dynamically update the parameters,but only thing is you wont be able to validate the values using monitoring 

    b)Other option is to create lookup table which contains values for all the tables. Based on the user's table selection (assign the foreign-key id which refers-to the lookup-table), you can create entry in the reference table with some entries. Only challenge is anytime when you create new table ,you need to create entry in the lookup table.

    example 

    Lookup table

    id , tablename

    1       employeeinfo

    2      leaverequest

    3.     masterdata

    Reference-table (based on the user selection , populate the values here)

    refid lookupid(foreign-key), cdtvalue               status

    1        1                              employeeinfo      completed

    2        1                             employeeinfo     inprogress

    3        3                             masterdata           new

    Hope this helps.

    Thanks,Barat

Reply
  • Hi Gaurav,

    Following are the 2 options i would try 

    a) a!writeToDataStoreEntity()  might help you. based on the user selection you can dynamically update the parameters,but only thing is you wont be able to validate the values using monitoring 

    b)Other option is to create lookup table which contains values for all the tables. Based on the user's table selection (assign the foreign-key id which refers-to the lookup-table), you can create entry in the reference table with some entries. Only challenge is anytime when you create new table ,you need to create entry in the lookup table.

    example 

    Lookup table

    id , tablename

    1       employeeinfo

    2      leaverequest

    3.     masterdata

    Reference-table (based on the user selection , populate the values here)

    refid lookupid(foreign-key), cdtvalue               status

    1        1                              employeeinfo      completed

    2        1                             employeeinfo     inprogress

    3        3                             masterdata           new

    Hope this helps.

    Thanks,Barat

Children
No Data