function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amit MAmit M 

Created Flow using Metadata API but unable to see

Hi I have created a flow using following code

 

MetadataService.MetadataPort service = createService();
MetadataService.Flow flow = new MetadataService.Flow();
flow.fullName = 'My_Flow-1';
flow.label = 'My Flow';
flow.description= 'This is a test floe';
flow.metaType='Flow';
//flow.type_x='';
MetadataService.FlowStep step = new MetadataService.FlowStep();
//step.metaType = 'FlowStep';
step.label='mylabel';
step.locationX=100;
step.locationY = 10;
step.description = 'Step description';
step.name='test step';

//MetadataService.AsyncResult[] results2 = service.create(new MetadataService.FlowStep[] { step });

flow.steps = new MetadataService.FlowStep[]{step};

//MetadataService.AsyncResult[] results = service.create(new List<MetadataService.Metadata> { flow });
MetadataService.AsyncResult[] results = service.create(new MetadataService.Flow[] { flow });

 

I get an id like 04sd0000002iQXvAAM in AsyncResult. But I am unable to see the flow in Salesforce.

 

2ndly, Can you also tell me how do i get the id with which I can access the flow using url like https://na14.salesforce.com/04sd0000002iQXvAAM

 

Thanks

Amit