• ramesh kopparapu 15
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies
Hi,
I want to create a chart in visualforce page and want to render as pdf.
I used apex:chart and along renderas pdf doesn't work for me.
I tried google charts(By converting the data into image) also, that is also not working both the cases i am getting empty pdf document.
Hi,
I want to create a chart in visualforce page and want to render as pdf.
I used apex:chart and along renderas pdf doesn't work for me.
I tried google charts(By converting the data into image) also, that is also not working both the cases i am getting empty pdf document.
Alright...so the basics are this: I have scoured the blogs, stackexchange posts, and any other resource I could find looking for a simple way to access use the REST API to access object metadata.  I just cannot find anything.  Heck, I can't even get an access token to return.

Can anyone provide me with a minimal example of some code I can execute anonymously to receive an object's metadata?  This is the code I currently have, but if it is more complex than necessary please snip whatever is unnecessary out of your response(s).
 
String clientId = <my_client_id>;
String clientSecret = <my_client_secret>';
String username = <my_login>;
String password = <my_password>;
String prodUri = 'https://login.salesforce.com';
String testUri = 'https://test.salesforce.com';
HttpRequest req = new HttpRequest();
req.setMethod('POST');
req.setEndpoint(testUri+'/services/oauth2/token/');
req.setBody('grant_type=password' +
            '&client_id=' + clientId +
            '&client_secret=' + clientSecret +
            '&username=' + EncodingUtil.urlEncode(username, 'UTF-8') +
            '&password=' + EncodingUtil.urlEncode(password, 'UTF-8'));
Http binding = new Http();
HttpResponse res = binding.send(req);

system.debug('--------------------> '+res);
system.debug('--------------------> '+req);

The responses I am getting for any modifications I have attempted thus far have varied between 401 (unauthorized), 404 (not found), and 405 (method not available).  Please help.

Thanks!
senario:
  We have two users and like A and B
 they have same profile and role,and in owd we have public read only,
 Once A user can create a records and B user cannt create records how can we do that?

When I click a visual force tab under Custom tab section, the url of the current page will be

like https://na6.salesforce.com/01r8000000094jB where 01r8000000094jB is the ID of the tab. How can I get it from Apex Code?

 

Thnx in advance