How can we use RDNG Extensions API to detemine the artifact type of the currently selected artifact?
We came across the latest RM Extensibility feature in CLM 5.0. We are trying to use the RM API to use customize a RRC widget to determine the artifact type of the currently selected artifact. The code makes use of the ARTIFACT_TYPE constant.: RM.Data.getAttributes(attrRef, function(attrResult) {
var attrs = attrResult.data[0];
document.getElementById("artifactType").innerHTML ="Artifact type obtained : "+attrs.values[RM.Data.Attributes.ARTIFACT_TYPE]; } On artifact selection the Artifact type appears as : Undefined. Is any change required in the code? |
Accepted answer
Hi,
Have a look at How to get the Artifact Type using the DOORS Javascript This may answer your question. Peter Achla Sharma selected this answer as the correct answer
|
2 other answers
I hope this is just a simple mistake since we can only see so little of the code - the parameter passed into the function is "attrResult" but it is not used when referencing the ARTIFACT_TYPE constant and a variable "attrs" is used instead. I suppose "attrs" should have been "attrResult".
Comments
Achla Sharma
commented Dec 09 '14, 1:53 a.m.
Hi Donald,
|
Hi,
Sorry for the slow response. I cannot see any reason why the code you posted would produce undefined. Can you see by printing to the browser console what the "attrs" object is ?
Thanks,
Steve Wood.
DOORS Next Generation team.
|