0

Below given is the syntax for readMetadata call for fetching WorkflowRule specific to an object .

ReadResult = metadataConnection.readMetadata(string WorkflowRule, string[] fullNames);

I want to know that Is there any way to use a variable(which has the object name) in place of "string[] fullNames" ?

Below is the code snippet, while I am trying to execute it , it gives NULL for mdInfoWorkflow.fullname Note: Cobj is a FileProperties type list of all object

 ....
    for (MetadataService.FileProperties n : Cobj) 
                {
 readResultWorkflow = service.readMetadata('WorkflowRule', new String[] {n.fullname});
                          mdInfoWorkflow = readResultWorkflow.getRecords();
                          system.debug('mdInfoWorkflow :' +mdInfoWorkflow);
...

Please suggest.

1
  • Metadata for workflow is named 'Workflow'. Try it .
    – SF Learner
    Commented Feb 27, 2017 at 7:31

1 Answer 1

1

You can use any list of strings you want. These two syntaxes are identical:

List<String> aNames = new List<String>();
String[] bNames = new String[]();
aNames.add('Workflow_A');
bNames.add('Workflow_B');

You can also instantiate them with elements inline:

List<String> aNames = new List<String> { 'Workflow_A' };
String[] bNames = new String[] { 'Workflow_B' };

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .