From ac6c45217d59f9dfa0f485c029ac621f39036494 Mon Sep 17 00:00:00 2001 From: Naresh28Babu Date: Wed, 14 Jun 2017 04:33:28 +0530 Subject: [PATCH] attachFile sample code corrected, popup api description changed --- lib/ZSDK.js | 2 +- lib/ZohoCrmHelper.js | 22 ++++++++++++---------- test/html/Main.html | 6 +++--- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/ZSDK.js b/lib/ZSDK.js index a0cfec7..25fd47f 100644 --- a/lib/ZSDK.js +++ b/lib/ZSDK.js @@ -73,7 +73,7 @@ var ZSDKMessageManager = (function(ZSDKMessageManager) { var promiseIDCtr = 100; var PromiseQueue = {}; // Queue holding all the GetRequest promises - var AllowedOrigins = new RegExp("^https?:\/\/[a-zA-Z0-9-_]*.(csez.zohocorpin.com|zoho.com|localzoho.com|zohoplatform.com|localzohoplatform.com|zohosandbox.com|localzohosandbox.com)(:[0-9]{0,4})?$"); + var AllowedOrigins = new RegExp("^https?:\/\/[a-zA-Z0-9-_]*.(sandbox.crm-oem.com|csez.zohocorpin.com|zoho.com|localzoho.com|zohoplatform.com|localzohoplatform.com|zohosandbox.com|localzohosandbox.com)(:[0-9]{0,4})?$"); var isAppRegistered = false; var AuthParentWindow, AuthParentOrigin; diff --git a/lib/ZohoCrmHelper.js b/lib/ZohoCrmHelper.js index c1fe566..05baeed 100644 --- a/lib/ZohoCrmHelper.js +++ b/lib/ZohoCrmHelper.js @@ -1568,12 +1568,14 @@ var ZOHO=(function(){ * @param {object} config - Configuration Object * @param {String} config.Entity - SysRefName of the module. * @param {String} config.RecordID - RecordID to associate the notes. - * @param {String} config.File - File data + * @param {object} config.File - File Object + * @param {String} config.File.Name - File Name + * @param {object} config.File.Content - File Content * @return {Promise} Resolved user Upload acknowledgement * @memberof ZOHO.CRM.API * @example * - * ZOHO.CRM.API.attachFile({Entity:"Leads",RecordID:"1000000031092",File:blob,FileName:"myFile.txt"}).then(function(data){ + * ZOHO.CRM.API.attachFile({Entity:"Leads",RecordID:"1000000031092",File:{Name:"myFile.txt",Content:blob}}).then(function(data){ * console.log(data); * }); * //prints @@ -1811,16 +1813,16 @@ var ZOHO=(function(){ } }, /** - * @namespace ZOHO.CRM.UI.PopUp + * @namespace ZOHO.CRM.UI.Popup */ - PopUp:{ + Popup:{ /** * @function close - * @description Close current Widget PopUp Screen + * @description Close Widget Popup * @returns {Promise} resolved with true | false - * @memberof ZOHO.CRM.UI.PopUp + * @memberof ZOHO.CRM.UI.Popup * @example - * ZOHO.CRM.UI.PopUp.close() + * ZOHO.CRM.UI.Popup.close() * .then(function(data){ * console.log(data) * }) @@ -1839,11 +1841,11 @@ var ZOHO=(function(){ }, /** * @function closeReload - * @description Close current Widget PopUp Screen and reload the View + * @description Close Widget Popup and reload the View * @returns {Promise} resolved with true | false - * @memberof ZOHO.CRM.UI.PopUp + * @memberof ZOHO.CRM.UI.Popup * @example - * ZOHO.CRM.UI.PopUp.closeReload() + * ZOHO.CRM.UI.Popup.closeReload() * .then(function(data){ * console.log(data) * }) diff --git a/test/html/Main.html b/test/html/Main.html index 24664c6..a76a4a0 100644 --- a/test/html/Main.html +++ b/test/html/Main.html @@ -3,12 +3,12 @@ - +