Custom properties and datacard variables

(I am still investigating and in need to reproduce the issue again, I am posting to keep track of findings and to ask for advice)

tldr

PDM variable value, linked to a sw file custom property (not yet created inside the sw file), is shown as blank in the datacard after the checkin operation from windows explorer.

The linked custom property was not created inside the sw file. When a checkout is performed the value is shown again in the datacard.

Same operations done with SW PDM addin do not show the datacard field as blank after checkin, as expected.

-–

We have a rarely used transition for catalog parts that go out of production and I noticed that a certain datacard value (set from a drop down control) was shown as blank after checkin.

Checkout the file again and the field in the datacard is visible again. Repeat the checkin and the field changes to blank again.

That was from explorer PDM interface.

Opening the file with SW, and using the pdm addin in the task panel, I opened the datacard and from the drop down control I set the same value that disappeared upon checkin with explorer, saved the file and checkin in the vault, but this time the value stayed visible in the datacard.

Upon review I noticed that the vatiable in the datacard was linked to a custom property that was not yet created inside the SW file, the transition action that was supposedly set the value, did it in the datacard, but it did not create the custom property inside the file.

That property is needed only when the file is retired from the catalog to show it as deprecated.

That variable was probably added later in our legacy workflows, and it did not make it in our SW template, so most files in the vault do not have that custom property at all.

The datacard should mirror the sw file properties, but for a non existent custom property, when the file is handled from windows explorer only the datacard (PDM database side) is updated, while the custom property inside the sw file is blank and then displayed like that in the datacard after the checkin.

Opening the file in SW seems to fill the gap in the custom properties, when the datacard is opened and the variable field value is filled, it creates the missing custom property inside the sw file.

Until now, I thought the document API would somehow write inside the sw file metadata keeping the datacard and the linked custom properties in synch, but I was probably misunderstanding the limitations of the system or is it just a bug?