AnsweredAssumed Answered

Get filename of workflow with javascript - Alfresco

Question asked by pat9rv3sousa on Feb 1, 2016
Latest reply on Feb 2, 2016 by niketapatel
I'm trying to obtain a filename of the items of a workflow.

I try to make this:

<javascript>
var title;
     Alfresco.util.Ajax.jsonGet(
         {
            url: Alfresco.constants.PROXY_URI_RELATIVE + "api/metadata?nodeRef=" + nodeRefContext + "&shortQNames=true" ,
            successCallback:
            {
               fn: function(response)
               {
                  if (response.json)
                  {
                     title=response.json.properties["cm:title"];
                     alert(title);
                  }
               },
               scope: this
           },
       failureCallback:
           {
               fn: function(response)
               {
                  Alfresco.util.PopupManager.displayPrompt(
                  {
                     failureMessage: this.msg("message.failure")
                  });
               },
               scope: this
            }
         });
</javascript>

But gives me <cite>undefined</cite> in the alerts…

I try too with:

<javascript>
var nodeR = search.findNode(fileNodeRef);
alert(nodeR);
</javascript>

But

search is not defined

Any idea how to obtain a filename of the workflow? In the URL I only have the noderef.

Outcomes