Happy Business Starts Here

Student

How to fetch Custom Field of a Subscription

Hi used the SOAP API (subscribes) for creating subscriptions, and sent customfield__c value to it. The result was success. But when I try to fetch this custom field via ZOQL Select, it says malformed query. While Id and other details can be fetched, the ZOQL does not recognise the custom field as a valid field for the subscription. Any ideas on how I can fetch this custom field for a subscription that I created.
5 REPLIES 5
Highlighted
Zuora Alumni

Re: How to fetch Custom Field of a Subscription

@nikunj

 

I just tested this in my tenant and the query the customer field works fine for me. I can query it via SOAP API query call or ZOQL create export.

 

Here is my sample ZOQL export. TypeofDeal__c is a custom field on subscription object in my tenant.

 

 

<ns1:create>
    <ns1:zObjects xsi:type="ns2:Export">
        <ns2:Format>csv</ns2:Format>
        <ns2:Name>test</ns2:Name>
        <ns2:Query>select TypeofDeal__c  from subscription</ns2:Query>   
    </ns1:zObjects>
</ns1:create>

 

What is the detail of your API call?

 

Regards,

Dennis

 



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Student

Re: How to fetch Custom Field of a Subscription

Hi, Thanks for responding. My API is the following: 

<soapenv:Body>
            <ns1:query xmlns:ns1="http://api.zuora.com/">
            <ns1:queryString>select id,UniqueReferenceId__c from subscription</ns1:queryString>
         </ns1:query>
 </soapenv:Body>

I've created the field 

UniqueReferenceId__c

under subscription from the UI panel. And I've also uploaded some of the data using the subscribes() call with a relevant UniqueReferenceId__c value 

Tags (1)
Zuora Alumni

Re: How to fetch Custom Field of a Subscription

@nikunj,

 

Here is my SOAP query call

 

<SOAP-ENV:Body>
<ns1:query>
    <ns1:queryString>Select TypeofDeal__c  From Subscription</ns1:queryString>
</ns1:query>
</SOAP-ENV:Body>

May I have your tenant Id? Which WSDL version are you working with?

 

Regards,

Dennis



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Student

Re: How to fetch Custom Field of a Subscription

Hi, sorry my bad. I needed to create custom field for each entity independently. Missed that. Thanks, this is solved.

Master

Re: How to fetch Custom Field of a Subscription

Note that if you create a custom field in Zuora and you are using SOAP API, you will need to download a new WSDL. 

This is not necessary if you use REST API.

 

Bo