Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

How to read exportToAAM activities data from javascript?

vitor_d
Level 2
Level 2

I am trying to access exportToAAM activitiy data inside a javascript block, but I am unable to do so. Here is my code:

var groupQuery = "SELECT iWorkflowId FROM XtkWorkflow";
var groupsXML = sqlSelect(
  "collection,iWorkflowId:int", 
   groupQuery
   );

for each(var group in groupsXML.collection){
  var wkf = NLWS.xtkWorkflow.get(group.iWorkflowId);
  logInfo(wkf.activities.exportToAAM.label);
  logInfo(wkf.activities.exportToAAM[0].label);
}

 

I have also tried to query mData and read it as an DOMDocument, but didn't work either. I feel like activities/exportToAAM is not being returned in the XML.

1 Accepted Solution
CedricRey
Correct answer by
Level 4
Level 4

Hi @vitor_d 

Just tried your code and I think where is the problem : you use the "get" method instead of the "load" method to have your workflows.

I didn't know it, but the 'get' method doesn't load the workflow the same way as the 'load' one (the only difference I was aware of is the 'load' method needs to use the 'save' method to save changes, as the 'get' doesn't).

Can you change the line

NLWS.xtkWorkflow.get(group.iWorkflowId);

to

NLWS.xtkWorkflow.load(group.iWorkflowId);

That way I got result.

 

Let me know if it's ok ?

 

Thank you,

Cédric

View solution in original post

3 Replies
CedricRey
Correct answer by
Level 4
Level 4

Hi @vitor_d 

Just tried your code and I think where is the problem : you use the "get" method instead of the "load" method to have your workflows.

I didn't know it, but the 'get' method doesn't load the workflow the same way as the 'load' one (the only difference I was aware of is the 'load' method needs to use the 'save' method to save changes, as the 'get' doesn't).

Can you change the line

NLWS.xtkWorkflow.get(group.iWorkflowId);

to

NLWS.xtkWorkflow.load(group.iWorkflowId);

That way I got result.

 

Let me know if it's ok ?

 

Thank you,

Cédric

View solution in original post

vitor_d
Level 2
Level 2
Amazing! Thank you so much for the help! It worked perfectly!
Sukrity_Wadhwa
Employee
Employee

Hi @vitor_d,

Was the given solution helpful to resolve your query or do you still need more help here? Do let us know.

Thanks!