Change CDF data type

From IMSMA Wiki
Jump to navigation Jump to search

Common data type changes are:

  • text to number
  • text to single- or multiselect
  • single-select to organisation

Of course the first action is to prepare/update the existing values in table cdfvalue so they are possible of changing data type of. E.g. if the change is from text to number than the decimal symbol need to be dot for all existing values.

  1. Update the column for the new value type in table cdfvalue e.g. column numbervalue.
  2. Update the column value_type to the new type and delete the value from the old column.
  3. Update the column fieldtype and display_mechanism in table field, see image below for valid combinations.
  4. Update the column cdf_datatype in table customdefinedfield.
  5. Depending on what change is done; insert or delete values from table allowed_value_set.
  6. Start the client.
  7. Open the DIM and check that all looks OK.
  8. Update all DEF templates.
  9. Switch templates.
  10. Delete the old templates from the database.
  11. Update Summary templates.
  12. Update iReports, SQL views, import scripts, etc.
The final check is to create a Staging area. The error message "There are duplicate normalized CDF Column Names, staging processing cannot continue" may also indicate that there are other problems with CDFs than the names.
  1. Double-check that there are no issues with names according to the rules.
  2. Check if any records have the wrong value in the column value_type in table cdfvalue compared to the current cdf_datatype in table customdefinedfield.


Query for verifying fieldtype and display_mechanism

SELECT field. fieldtype, field.display_mechanism, customdefinedfield.cdf_datatype, Count(field.field_guid)
FROM customdefinedfield Inner Join field ON field.cdf_guid = customdefinedfield.cdf_id
GROUP BY field.fieldtype, field.display_mechanism, customdefinedfield.cdf_datatype
ORDER BY field.fieldtype ASC, field.display_mechanism ASC, customdefinedfield.cdf_datatype ASC

Template:NavBox Hub