Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you get a user's name and description from their ID in the SDL Tridion Anguilla framework
    primarykey
    data
    text
    <p>I have written a GUI extension for SDL Tridion 2011 SP1. The GUI consists of an extra ribbon button and event handler which is triggered when a component is saved.</p> <p>My event handler is registered as follows:</p> <pre class="lang-js prettyprint-override"><code>PowerTools.Commands.ItemCommenting.prototype._execute = function (selection) { var item = $display.getItem(); $evt.addEventHandler(item, "save", this.getDelegate(this._onItemSaved)); $cme.getCommand("SaveClose")._execute(selection); }; </code></pre> <p>and the event handler looks like this:</p> <pre class="lang-js prettyprint-override"><code>PowerTools.Commands.ItemCommenting.prototype._onItemSaved = function (eventitem) { var comment = prompt("Please enter a comment", ""); $messages.registerNotification("Saving user comments..."); var commentitemid = eventitem.source.getId(); var commenterid = eventitem.source.getCreatorId(); var commenter = $tcm.getItem(commenterid); var commentername = commenter.getDescription(); var commentdate = eventitem.source.getLastModifiedDate(); var commentversion = eventitem.source.getVersion(); //Call the service to update PowerTools.Model.Services.AppDataServices.Append("ext:ItemCommenting", commentitemid, "&lt;comment&gt;&lt;user&gt;" + commenterid + "&lt;/user&gt;&lt;message&gt;" + comment + "&lt;/message&gt;&lt;datetime&gt;" + commentdate + "&lt;/datetime&gt;&lt;version&gt;" + commentversion + "&lt;/version&gt;&lt;/comment&gt;", null, null, null, false); }; </code></pre> <p>This is working fine, except that the variable <code>commentername</code> is always undefined. Is there a better approach for getting the name and description of a user?</p> <p>Additionally, does anyone know if the value returned by <code>eventitem.source.getCreatorId()</code> is actually the Reviser or actually the person who created the item?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload