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
Fraser DuncanFraser Duncan 

Help with a Salesforce query?

Hi,

Forgive me if I do not give enough information, I am passing on an issue from our developer.

Our organisation have a web portal that we use to link with Salesforce. 

We are working on an invoice submission tool (which is in place already) and I wanted to add an extra field to be included. I created this field and the developer tried to 'add it' to the portal. However, when performing a query, when the results are returned the field that I added does not appear in the result set.

Could anyone help?

Thank you
kk
Hi Fraser,

Did you checked the Field Level Security(FLS) permissions?
Fraser DuncanFraser Duncan
Hi,

Yes it is visible to all except Gold Partner user and is editable by all.
Vinit_KumarVinit_Kumar
Can you post your query,aslo try running the query in Dev console or workbench to ccheck if it is returning any results or not ??

Hope thihs helps !!
Fraser DuncanFraser Duncan
Hi Vinit,

Could you just give some steps on how I could do that?

I am not that advanced in Salesforce unfortunately.
Vinit_KumarVinit_Kumar
1.)Go to this link :-
https://workbench.developerforce.com/login.php

2.) Select your instance Production/Sandbox and then Click on 'Login with Salesforce' button.

3.) Click on Queries -> SOQL query and then Run your query in the box.Check for the results as what you get.

Hope this helps !!
Fraser DuncanFraser Duncan
Sorry for the late reply,

The developer has tried the following to return the field from Salesforce,

He's using the  Enterprise web service with the following call:-

try
        { 
            $results = $sf->query("SELECT Pt_Invoice_Submitted__c FROM Patient__c WHERE Id ='$pId'");
            print_r($results);
        }
        catch (exception $e)
        {
            print_r($e);
           
        }

Which works correctly but gives the following results object :-QueryResult Object ( [queryLocator] => [done] => 1 [records] => Array ( [0] => SObject Object ( [type] => [fields] => ) ) [size] => 1 )



The query is correct and is:-

SELECT Pt_Invoice_Submitted__c FROM Patient__c WHERE Id ='<ID_REMOVED>'
And it's been tested in Workbench as well and works correctly giving the following results:-
Query Results
Returned records 1 - 1 of 1 total record in 0.038 seconds:
  Pt_Invoice_Submitted__c
1 false
Vinit_KumarVinit_Kumar
If the query is working in Workbench,I would expect it to behave the same via webservice.I am assuming you are using PHP to call salesforce.

and I don't have much experince in that.
Fraser DuncanFraser Duncan
Yes it's PHP that's being used to called the Salesforce, but that isn't the problem, if the query is modified to include Id and Pt_Invoice_Submitted__c  (SELECT Id, Pt_Invoice_Submitted__c FROM Patient__c WHERE Id ='<ID_REMOVED>') the query works but only returns the Id in the SalesForce Result Object

So the problem seems to be with the Pt_Invoice_Submitted__c field itself
Vinit_KumarVinit_Kumar
Then,I am assuming that the field is not visible to the Integration user.Can you check if that field is visible or not on FLS??

Another thing which comes to my mind,have you consumed the latest WSDL file in your PHP application or not.It might be that you are using an older version of WSDL file and you have added this field recently in your salesforce org and it is not available in your WSDL file.