• Fatima 1
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies

Hi All
I am new to visualforce development and would like your help.
I have to create a visualforce page with extension for a custom object in a managed package.The custom object is called Attendance and all users have access to its records and when users drill down to the related Student link for a record they don't own,an error is displayed:“Data Not Available: The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page.”
So I want to create a page with extension that checks if the user has access to record due to security.If yes then redirect to correct record page,otherwise show error'User doesnt own record so cannot access it'.
Thanks for any help

Hi Developers!

I am trying to interact with the salesforce rest api using CURLS in Groovy.

Right now, i have a curl retrieving access token, which looks like:

    def accessTokenCurl = 'curl -X post '+ salesforceUrl + '? grant_type=password&client_id=' + clientId + 
    '&client_secret='+clientSecret+'&username=' + userName + '&password=' + 
    password + ' -H "Content-Type=application/x-www-form-urlencoded"'

which seems to work fine, resulting in:

00D1x0000008cHb!ARkAQEIE20ES9DRFoOXHiiIzFwOeGtnGBg15TYeEFz4t9TUYkSHY.guZ0bBbgRgGKXpbWZzlWrX3cDFT_LXmgBw4iGjRJA3W (I have changed a few, just in case)

This access token should let me retrieve data from the rest api, like, retrieving contact account id from email:

    def testcurl = "curl https://INSTANCE.salesforce.com/services/data/v44.0/query/?q=SELECT+contact.AccountId+from+contact+where+contact.Email =mysalesforceemail@now.com" + ' -H Authorization: OAuth 00D1x0000008cHb!ARkAQEIE20ES9DRFoOXHiiIzFwOeGtnGBg15TYeEFz4t9TUYkSHY.guZ0bBbgRgGKXpbWZzlWrX3cDFT_LXmgBw4iGjRJA3W'

it simply returns with:

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]
However, this ends in an error like:

    [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

I have tried double quotation, single quotation, combinations.. just cant seem to get it to work :(

 
Good morning!

When I run the following command

curl https://cs52.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=3MVG9jfQT7vUue.HI5A55FSLlIfXBOfWf4l6bdQyHB4_Z3H8bV_itfZVmljnrsiexgKzZYSoh1lqhS4" -d "client_secret=5061899374035891170" -d "username=ken.gibson@***" -d "password=***"

I get back 

{"access_token":"00D5B000000D1Dp!AQ8AQLXPPYOY3VDQ2GBp_fw_W.kEmxxFs8wiLhhT26Q9olZ1mPb22LSha1vgSJsgV9FYtiZqAVtgorQ1KIJY","instance_url":"https://cs52.salesforce.com","id":"https://test.salesforce.com/id/00D5B000000D1DpUAK/00550000004EYRsAAO","token_type":"Bearer","issued_at":"1466180041361","signature":"pM6C2lFmEoxyz/8u+QjbEY6K23mIFE6zyBMX+8U="}

Which looks like a successful response. If I follow that immediately by 

url https://cs52.salesforce.com/services/data/v20.0/sobjects/Account/ -H 'Authorization: Bearer 00D5B000000D1Dp\!AQ8AQLY3VDQ2GBp_fw_W.kEmxxFs8wiLhhT26Q9olZ1mPA9B3geb22LShaZPaHoF1vgSJsgV9FYtiZqAVtgorQ1KIJY' -H "Content-Type: application-json" -d "@test.json"

I get

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}

(Please note that all tokens have been horked to post here) 

Any idea why I'm not able to request REST resources with what appears to be a valid session key? Is there a way to force it to refresh? Please note I just changed my security token this morning.

Thanks!

Hi All
I am new to visualforce development and would like your help.
I have to create a visualforce page with extension for a custom object in a managed package.The custom object is called Attendance and all users have access to its records and when users drill down to the related Student link for a record they don't own,an error is displayed:“Data Not Available: The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page.”
So I want to create a page with extension that checks if the user has access to record due to security.If yes then redirect to correct record page,otherwise show error'User doesnt own record so cannot access it'.
Thanks for any help

How to Remove --None-- from Picklist values which is on VisualForce Page?

Removing --None-- from the Picklist Values.
Hello everyone,

I need quick help from you guys regarding Service Console application.

I have created a console app as well as a custom app. Both of these apps are assigned to one of my custom profile, called Customer Support profile where I have set console app as a default app.

What I am facing is that when any of the user logs into the system, then they see Service Console app as deault app, Home page layout as default layout, but "Back to Service Console" tab as the only single tab.

When I click on this tab, it redirects me to the actual Home tab of Console app.

I want actual Home tab as a default tab, as it should be.

If I select another application (another custom application assigned to this profile), and come back to this Console app, then it is showing me actual home tab. I am expecting the same behavior for all users when they logged into the system.

Both of the snapshots are attached. (Issue / requirement)

Please help!!


User-added image

User-added image