Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readmetadata returning null records when used for getting Flows in Salesforce Org #36

Open
iritesh opened this issue Jul 4, 2014 · 8 comments
Labels

Comments

@iritesh
Copy link

iritesh commented Jul 4, 2014

i am using apex-mdapi .i invoked the function

MetadataService.ReadFlowResult c = (MetadataService.ReadFlowResult) service.readMetaData('Flow', new List{'Calculator','SAMPLE_Lead_Convert_Flow'});

where Calculator and SAMPLE_Lead_Convert_Flow is the name of flows in my dev org.in debug log response is

21:28:23.542 (542647408)|SYSTEM_METHOD_ENTRY|[8583]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
21:28:23.546 (546821097)|CALLOUT_REQUEST|[8583]|

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header><SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata"><sessionId>00D90000000vSiF!AQYAQNpub28oY56fhJDV1s5fErWLQ.hC_cjCHYloA1c_.qvLy6LAEHBSH5SCCe92uKqBRIf3n.O.nEm13H4TucMVyXMWOZfi</sessionId></SessionHeader></env:Header><env:Body><readMetadata xmlns="http://soap.sforce.com/2006/04/metadata"><type>Flow</type><fullNames>SAMPLE_Lead_Convert_Flow</fullNames><fullNames>Calculator</fullNames></readMetadata></env:Body></env:Envelope>

21:28:23.546 (546918624)|CALLOUT_REQUEST|[8583]|readMetadata_element:[apex_schema_type_info=(http://soap.sforce.com/2006/04/metadata, true, false), field_order_type_info=(type_x, fullNames), fullNames=(SAMPLE_Lead_Convert_Flow, Calculator), fullNames_type_info=(fullNames, http://soap.sforce.com/2006/04/metadata, null, 0, -1, false), type_x=Flow, type_x_type_info=(type, http://soap.sforce.com/2006/04/metadata, null, 1, 1, false)]::SFDC_STACK_DEPTH=1 SOAPAction="" User-Agent=SFDC-Callout/30.0 Accept=text/xml Content-Type=text/xml; charset=UTF-8
21:28:23.574 (574584199)|CALLOUT_RESPONSE|[8583]|

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><readMetadataResponse><result><records xsi:nil="true"/><records xsi:nil="true"/></result></readMetadataResponse></soapenv:Body></soapenv:Envelope>

as you can see in readMetadataResponse records are giving null.i was expecting two xml correspoding to two flow objects.can anyone plz help how to resolve this issue ??

@afawcett
Copy link
Contributor

afawcett commented Jul 8, 2014

Currently reading of Flows is not supported in the library, it is actually broken in the Salesforce API this library wraps. I'm waiting for that to be fixed and I will update the library. Here is the duplicate issue. #26.

@afawcett afawcett closed this as completed Jul 8, 2014
@BourhiMaryem
Copy link

Hi ,

Im Having the same issue with workflow rules , although i have used the method for workflow field updates and validation rules and it works just fine , any thoughts ?

@afawcett
Copy link
Contributor

afawcett commented Dec 4, 2016

Have you seen this example?

@afawcett afawcett added the query label Dec 4, 2016
@afawcett afawcett reopened this Dec 4, 2016
@triestelaporte
Copy link

triestelaporte commented Dec 21, 2017

@afawcett I'm seeing this exact behavior on RemoteSiteSettings. It looks like readMetadata for RSS just returns null no matter what. Have you seen this too?

(I've confirmed behavior in JSForce and Postman raw posts as well)

@afawcett
Copy link
Contributor

afawcett commented Jan 1, 2018

@triestelaporte if you use listMetadata or the equiv from within Developer Workbench what Metadata Fullname is assocaited to the Remote Site?

@Dobermaxx99
Copy link

@afawcett I'm seeing this exact behavior on RemoteSiteSettings. It looks like readMetadata for RSS just returns null no matter what. Have you seen this too?

(I've confirmed behavior in JSForce and Postman raw posts as well)

I was able to fix this by specifying the full name of the RemoteSiteSetting.

MetadataService.RemoteSiteSetting wfa = (MetadataService.RemoteSiteSetting) service.readMetadata('RemoteSiteSetting',
                new String[]{
                        '<REMOTESITESETTING FULLNAME>'
                }).getRecords()[0];

        System.debug(wfa.url);

@afawcett
Copy link
Contributor

Thanks for sharing @Dobermaxx99

@knght4yshua
Copy link

So, I'm assuming that still doesn't work? Here's what I'm passing:

MetadataService.Flow flowResult = (MetadataService.Flow) mdService.readMetadata('Flow', new List<String>{'<NAME OF FLOW>'}).getRecords()[0];

All values (actionCalls, decisions, etc.) still return as "null". When I make a call using the REST Explorer, however, it returns that data just fine. It is clear that the data is there. Why isn't it returning using the syntax above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants