Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- at Object.generateQueryString (CanvasProxy.js:17)
- at Function.request (CanvasProxy.js:21)
- at Object.ajax (CanvasProxy.js:135)
- at O (CanvasProxy.js:91)
- at g (CanvasProxy.js:30)
- Sfdc.canvas.client.refreshSignedRequest(function(data){
- if(data.status === 200){
- var signedRequest = data.payload.response;
- var part = signedRequest.split('.')[1];
- var obj = JSON.parse(Sfdc.canvas.decode(part));
- Sfdc.canvas.client.subscribe(
- obj.client, {
- name: 'myapp1.testEvent' ,
- onData : function(inp){
- try{
- console.log(inp);
- Sfdc.canvas.client.ajax(
- obj.context.links.restUrl + 'composite/tree/Attachment/',
- {
- client : obj.client,
- method : 'POST',
- headers : { "Authorization" : "OAuth " + obj.client.oauthToken, "Content-Type" : "application/json" },
- data : { "records": [{"attributes" : {"type" : "Attachment", "referenceId" : "ref1"}, "name" : "test1234", "parentId" : "a040O00000Xd4rp" ,"Body" : "tset1"}]},
- success : function(data) { alert("Status: " + data.status); }
- }
- );
- }
- catch(err){
- alert(err);
- }
- }
- }
- );
- }
Add Comment
Please, Sign In to add comment