• benedwards44
  • NEWBIE
  • 50 Points
  • Member since 2014


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
For example, if i add a custom field "myposition", how can i get it in apex class?
UserInfo.getMyposition()  or  UserInfo.myposition  are both invalid.
I was wondering if anyway has ever been able to make updates to Profiles via the Tooling REST API?

I have recently built an application which creates CustomFields via the API, and I would then like to update profiles with permissions to those new fields. Fields are deploying fine using a POST to the CustomField resource, however I'm unable to update any profiles using a PATCH request as per the Tooling API documentation.

I have tried numerous examples of a profile update, but I am returned INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY - insufficient access rights on cross-reference id: 00eb0000000hlse.

Where the ID is the ID of my profile I'm trying to update.

I am posting my request to the URL:https://eu2.salesforce.com/services/data/v33.0/tooling/sobjects/Profile/00eb0000000hlseAAA

Where eu2 is my instance and 00eb0000000hlseAAA is my Profile ID. That all works as expected, including for other resources (CustomFIeld, ApexClass etc).

My data payload - I have tried numerous examples:

Example 1 - Update field permission
{
	'Metadata': {
		'fieldPermissions': [
			{
				'field': 'Account.Email__c',
				'editable': True,
				'readable': True
			}
		]
	}
}
Example 2 - Simple Update to Description
{
	'Metadata': {
		'description': 'Test description'
	}
}
I've tried different Metadata examples - including querying for the profile and then simply re-submitting it - but still receive the error.

I've tried different profiles, different fields and many different permissions.

Any help would be appreciated. I understand the Profile object has only been available since Winter '15 so I'm starting to consider it's just not supported as per the documentation.

I'm looking at you Andy Fawcett...
For example, if i add a custom field "myposition", how can i get it in apex class?
UserInfo.getMyposition()  or  UserInfo.myposition  are both invalid.
I'm new to Salesforce and trying to implement an SSO where Salesforce is the IDP and an external Web Application is a Service Provider.

I'm trying to follow the Digging Deeper into OAuth 2.0 on Force.com (https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_at_Salesforce.com) the "Obtaining an Access Token in a Web Application (Web Server Flow)" scenario.

I defined a domain and a connected app that is setup to use OAuth, I got the secret the client id, etc.

When the Connected App is launched, it is properly open a new broweser tab and called the Start URL.

I expected to see a URL that containes code parameters (similar to https://mydomain.com:8443/myExternalApp?code=xxxxxxxxx)

but, there is no such code or anyother SSO related informaiton that I can use to authenicate the user.


What do I  miss? Is it wrong to axpect to get the code? is there any setting that I may have overlooked?

Any tip will be greatly appreciatyed.

Thanks,
Yuval

The Connected App View