Closed sathiyaraja1 closed 10 years ago
The most likely explanation is that your user does not have permission to create Account records. Look at the console in Chrome Developer Tools to see if there is more info there.
Thanks for the quick responce.
I did login as administrator and the user has create permission for Accounts. But still I am not able to perform any DML operation(insert/update/delete).
Also, if possible can you please guide me through how to host the proxy.php on localhost. Currently, I am using node server to run these pages given in repo
What do you see in the JavaScript Console? Any errors?
No errors are shown in console. If possible can you please share your Skype details, will explain you the issue I am facing and probably you may get an idea on it and suggest me something on it.
Thanks a lot for following up. Hope I get your Skype contact.
On Wed, May 14, 2014 at 9:20 PM, Pat Patterson notifications@github.comwrote:
What do you see in the JavaScript Console? Any errors?
— Reply to this email directly or view it on GitHubhttps://github.com/developerforce/Force.com-JavaScript-REST-Toolkit/issues/53#issuecomment-43098698 .
with regards, Sathiya Skype: Sathiya_cloudindia Email: sathiyasnr@gmail.com
Can you post the code you are using? Is it different from the sample?
It is same as the sample, but for the Proxy, I have used Noder server(localhost:3000/proxy) instead the localhost:8080/Proxy.jsp/mode=native. Rest is all same.
On Wed, May 21, 2014 at 9:22 AM, Pat Patterson notifications@github.comwrote:
Can you post the code you are using? Is it different from the sample?
— Reply to this email directly or view it on GitHubhttps://github.com/developerforce/Force.com-JavaScript-REST-Toolkit/issues/53#issuecomment-43709883 .
with regards, Sathiya Skype: Sathiya_cloudindia Email: sathiyasnr@gmail.com
**Node Server
On Wed, May 21, 2014 at 11:03 AM, Sathiyaraja Kannan sathiyasnr@gmail.comwrote:
It is same as the sample, but for the Proxy, I have used Noder server(localhost:3000/proxy) instead the localhost:8080/Proxy.jsp/mode=native. Rest is all same.
On Wed, May 21, 2014 at 9:22 AM, Pat Patterson notifications@github.comwrote:
Can you post the code you are using? Is it different from the sample?
— Reply to this email directly or view it on GitHubhttps://github.com/developerforce/Force.com-JavaScript-REST-Toolkit/issues/53#issuecomment-43709883 .
with regards, Sathiya Skype: Sathiya_cloudindia Email: sathiyasnr@gmail.com
with regards, Sathiya Skype: Sathiya_cloudindia Email: sathiyasnr@gmail.com
Which node proxy? There isn't a node proxy in this project.
Yes, I was not able to associate the node.php with my localhost along with my html pages. So, I have used Node server and set the Proxyurl as "localhost:3000/proxy". With this I was able to run all the get requests like query Accounts and the I am able to see list of Accounts in the page. But when I try to create/update/delete the requests were not successful.
If possible, can you share your skype id? I can share my screen and show you, what I did...
On Thu, May 22, 2014 at 10:36 AM, Pat Patterson notifications@github.comwrote:
Which node proxy? There isn't a node proxy in this project.
— Reply to this email directly or view it on GitHubhttps://github.com/developerforce/Force.com-JavaScript-REST-Toolkit/issues/53#issuecomment-43848995 .
with regards, Sathiya Skype: Sathiya_cloudindia Email: sathiyasnr@gmail.com
Unfortunately, it's not possible for me to get on Skype. Sorry.
Where did you get the Node proxy? I'll see if I can re-create your issue.
Thank you.
I am sharing the zip file with the files and the link I followed to install Node server.
http://coenraets.org/blog/2014/02/building-a-force-com-api-explorer-in-30-lines-of-code/- link I followed
FYI, the HTML files and JS files are in the client folder.
The reason behind going for this approach is, I could not add proxy.php to run in my local server. Just as an alternative I went to use this Node server approach. This works well for GET requests but not for POST requests.
Please guide me through this.
Thank you very much for coordinating.
On Thu, May 22, 2014 at 8:59 PM, Pat Patterson notifications@github.comwrote:
Unfortunately, it's not possible for me to get on Skype. Sorry.
Where did you get the Node proxy? I'll see if I can re-create your issue.
— Reply to this email directly or view it on GitHubhttps://github.com/developerforce/Force.com-JavaScript-REST-Toolkit/issues/53#issuecomment-43903679 .
with regards, Sathiya Skype: Sathiya_cloudindia Email: sathiyasnr@gmail.com
Hi Pat,
If you do not mind, can you please share the implementation steps for this rest example. I think I am confused in setting up the local server to run given HTMLs and hosting the proxy.php.
The same example works well in my native salesforce but failing to achieve it via HTMLs. Hope the implementation instructions and setting up the server locally may help me to get through this.
Can you please guide me through this...?
Thanks in advance
Hi Pat,
I have linked all the pages and resources to my apache tomcat server by adding a new folder in webapps folder. After running the page, Oauth was successful and seen the below shared error popup.
I see what's happening - Christophe's proxy doesn't pass through the HTTP method and body, so it just works with GET. I extended it to cover POST, PATCH and DELETE as well:
var express = require('express'),
http = require('http'),
request = require('request'),
bodyParser = require('body-parser');
var app = express();
app.use(bodyParser());
app.use(express.static(__dirname + '/client'));
app.all('/proxy', function(req, res) {
var url = req.header('SalesforceProxy-Endpoint');
console.log("proxying: " + url);
request({
method: req.method,
url: url,
headers: {'Authorization': req.header('X-Authorization')},
json: req.body
}).pipe(res);
});
console.log('Listening on port 3000...');
http.createServer(app).listen(3000);
Try that and let me know how it goes.
For the record, you need Apache Web Server with PHP support to run proxy.php - it won't work in Tomcat - that's a Java Server.
Hi Pat,
Thank you so much for the information. I did try that Server script and got the error while initializing server, which is shown in attached screenshot.
You'll need to do
npm install body-parser
to install the body-parser module.
Thank you so much Pat. It worked.
I really appreciate and thank you again for being continuous supportive.
On Mon, Jun 2, 2014 at 9:55 PM, Pat Patterson notifications@github.com wrote:
You'll need to do
npm install body-parser
to install the body-parser module.
— Reply to this email directly or view it on GitHub https://github.com/developerforce/Force.com-JavaScript-REST-Toolkit/issues/53#issuecomment-44859054 .
with regards, Sathiya Skype: Sathiya_cloudindia Email: sathiyasnr@gmail.com
Great to hear you got it working. I'll close this issue now, then.
Hi Admin,
Thanks for the repo, it helped me greatly.
I am facing an issue with POST requests such as Create, Update and Delete. They are not working by GET requests are working perfectly. Can you please shed some light on this?