How to get document type CDT's attribute in different enviroments

Certified Lead Developer

Hi community!

I have a CDT with a document attribute type, imagine a product catalog CDT, with the name of the product and the image.

As I know, in database this document attribute type is stored by the documentID, so documentID is the reference in the catalloge table database.

The problem is when I deploy this CDT and the catalog content table in other environment, cause this documentID changes, so in the database table the documentIDs that are stored are wrong.

How can I do to reference this document in other environment? No I´m changing manually the document id in the new environment database, but I suppose there´s a less hard method.


Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • Hi,

    Updating document ids manually is obviously a painful method. Instead of that, what you can do is create a constant of document type (array) that points towards the images of the items in a sequential manner. Appending document to that constant can be done manually after adding every item but I will recommend you to use the service "Update Constant" in process model for every time you add a new item. When you need to display the image or the set of images of those items, you can index the constant based on the identifier of that row of item. 

    This is a way easy method and will not require any manual updation after deployment.

    -Harshit

Reply
  • Hi,

    Updating document ids manually is obviously a painful method. Instead of that, what you can do is create a constant of document type (array) that points towards the images of the items in a sequential manner. Appending document to that constant can be done manually after adding every item but I will recommend you to use the service "Update Constant" in process model for every time you add a new item. When you need to display the image or the set of images of those items, you can index the constant based on the identifier of that row of item. 

    This is a way easy method and will not require any manual updation after deployment.

    -Harshit

Children