SalesForce HealthCloud FieldPermissions not available from API query - salesforce

Am I crazy or are all the HealthCloud field permissions just unavailable to be queried via the rest API Soql calls?
If I issue this query in the developer console:
SELECT Id, SobjectType, Field, PermissionsEdit, PermissionsRead FROM FieldPermissions where SObjectType = 'PlanBenefitItem'
It returns exactly what I expect it to return - data about the fields and permissions. Issuing it via the API returns no records at all. I've checked all the object permission stuff because there's some weird rules about showing and not showing row data, but all of that seems fine and I wouldn't expect any return in the dev console if it weren't the case.
Is there something I'm missing here?

Related

How can i retrieve the Product Name from a Opportunity in Salesforce SOQL?

I have created an Opportunity in Salesforce with Opportunity Line Items.
I run the following query and the
SELECT Amount, Account.Name, Account.AccountNumber, Name,
(
SELECT Quantity, UnitPrice, ProductCode, Product2.Name FROM
OpportunityLineItems
)
FROM Opportunity
The OpportunityLineItems column returned in the result are as follows.
[{"Quantity":"1","UnitPrice":"10","ProductCode":"code1","Product2":"[object Object]"}]
If i drill down to the opportunity in Salesforce UI I see Under Products(Test Price Book) the Line.
If i drill down into the line the Name is name1.
So why is it returning [object Object] and not the name as requested by the query ?
It probably returns the results fine, it's just your connecting library that messes up and shows JavaScript object placeholder instead of actual nested object. I've seen it also show up in Salesforce's own Developer Console.
What do you use? A raw REST API call (using workbench -> utilities -> rest explorer, Postman or something else) should produce this
(I added a WHERE clause)
/services/data/v52.0/query?q=SELECT+Amount,+Account.Name,+Account.AccountNumber,+Name,++(+++SELECT+Quantity,+UnitPrice,+ProductCode,++Product2.Name+FROM++++OpportunityLineItems+)+FROM+Opportunity+WHERE+Id+IN+(SELECT+OpportunityId+FROM+OpportunityLineItem)+LIMIT+5
If you really connect from javascript - see if you can JSON.stringify(results) or something like that before logging it, should give you better structure? Or step through the code with debugger...
But no, the data should be there all right, just doesn't render well on your end.

Query users with a filter and expand results in unsupported query

I am trying to fetch a list of users from the Microsoft Graph API.
A lot of users don't have an email address, those users are systems users that I don't need.
So my query looks like /users?$filter=mail ne null
For another overview I need to show the manager of each user so I tried to add &$expand=manager. But doing so will result in an Unsupported Query.
When I remove the filter parameter it does work.
How can I only fetch relevant users and their managers in a single query?
Optionally I'd like to only receive the ID from managers, as an optimization. I only need the ID because I already fetched all users and their data. /users?$expand=manager($select=id) is what I was trying but I get the error Invalid $select properties.
If you want to use $select inside $expand to select the individual manager's properties, the $levels parameter is required, such as expand=manager($levels=max;$select=id). For more details, please refer to here
For example
https://graph.microsoft.com/v1.0/users?$expand=manager($levels=max;$select=id)
Update
If we want to use Not equals (ne) operators on the $filter query parameter, we must set the ConsistencyLevel header set to eventual and, with the exception of $search, use the $count query parameter (either as a URL segment or $count=true query string). For more details, please refer to here
For example
https://graph.microsoft.com/v1.0/users?$filter=mail ne null&&$expand=manager($levels=1;$select=id)&$count=true

Azure AD SCIM: SystemForCrossDomainIdentityManagementMultipleEntriesInResponse

We're using Azure AD as the Identity Provider for User Provisioning into our system.
We have started getting this error of late.
EntrySynchronizationError
Result Failure
Description Failed to match an entry in the source and target systems User 'XXX#XXX.com'
ErrorCode SystemForCrossDomainIdentityManagementMultipleEntriesInResponse
There has been no change in our scim server code. The error message is obviously stating it's fetching more than 1 entry when it should return 1 but in reality, there is no user with the said username & Azure AD should be sending a request to create a new one.
This is happening under the action "Other", I'm guessing it's a GET.
Any idea on what's going wrong here?
A GET operation with a filter (ie: GET /Users?filter=userName eq "Test_User_dfeef4c5-5681-4387-b016-bdf221e82081") is expecting either 0 or 1 result to be returned, but is receiving more than one result. Either your configuration in provisioning is matching on an attribute that is not uniqueness constrained (ie: department eq "Sales") or there's a problem with your logic for returning filtered results.

How to get salesforce Activity id

I have a salesforce query that extracting users time report
SELECT ID,Logged_Date__c ,CreatedBy.Email, CreatedBy.id, CreatedBy.Name, Time_Spent_Hours__c, Activity__c, CaseId__r.CaseNumber, CaseId__r.Account.id, CaseId__r.Account.Name , Utilized__c
FROM Time_and_Placement_Tracking__c
The Activity__c returns with the activity text.
I was trying to use Activity__c.Id, Activity__r etc. but all returns with error.
Is there a way to get the Activity id?
Verify these
You need to get to the object definition and see the field info. You can use workbench or any other API tool if you are familiar with and get the object and field def's.
Check the data type for Activity__c field. It should be a lookup/master relation. If it is not, find the field which ties to Activity object.
Open the field to get the API name and use that in the query with a '__r' extension.

Salesforce Bulk api InvalidBatch : Field name not found

I am using the bulk upload code described at http://www.salesforce.com/us/developer/docs/api_asynch/.
The only difference is that i am uploading a custom object type. I can access Employee_c. But now i get a different error
stateMessage='InvalidBatch : Field name not found : First Name'
First Name is the first column in the csv.
While debugging i can see that the temp csv is being created correctly. However i get this error when checkResults executes. The code is exactly the same as in the sample java code for bulk api using REST.
I am using the free developer version of salesforce.
I created a new permission set where i have given following permissions on custom object employee:
Read/create/edit/delete/view all/modify all.
All fields are given edit permissions.
The permission set is associated with salesforce user license.
The programmatic login is with a user associated with System administrator profile , which has sales force user license.
But still the error persists!
Any pointers would be appreciated
Thanks
Sameer
Try "FirstName" without the space.
You can view the API name of any field in Setup > App Setup > Objects > (Select Your Object) > (Select Your Field). Make sure all the fields you are querying have the correct API names.

Resources