Why am I not allowed to modify the ID or custom ID after importing requirements from Microsoft Word?

I am making use of the PreImportFcn and PostImportFcn functions. In the PostImportFcn, I'm trying something like the following, but receive an error:
>> reqs(numItems).Id = sprintf("REQ-%s", idNum);
Error: Unable to set the 'Id' property of class 'Reference' because it is read-only.

 Risposta accettata

Changing the IDs of items imported "as reference" is not allowed, because our product relies on these IDs for "Show in document" functionality. When importing "as references", it is assumed that the latest and most complete content is in the external document, and it is important to easily navigate from the imported "proxy" to the source content in the external document. When you click the [Show in document] button, we search the document for the ID of the selected imported reference and highlight it in the document if found. Modifying the ID would break this capability. 
If you want manual control over the IDs after Import, you should consider importing with the AsReference=false option. 
However, the result of such import cannot be "updated" from a newer version of the external document. Importing with AsReference=false is meant for migration, not for continuous traceability with an external document.

Più risposte (0)

Prodotti

Release

R2024a

Tag

Non è stata ancora inserito alcun tag.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by