Console error with widget in View mode, not present in Edit Mode with ZOHO.CRM.API.updateRecord(config)

Console error with widget in View mode, not present in Edit Mode with ZOHO.CRM.API.updateRecord(config)

hello

i have that function to update an account records (from a widgets created with sigma)

function handleCopyButtonCRMClick() {
console.log('handleCopyButtonCRMClick');
/*
* Fetch Information of Record passed in PageLoad
* and insert the response into the dom
*/
console.log('data.Entity : ' + sharedVariableEntityId);
ZOHO.CRM.API.getRecord({Entity:"Accounts",RecordID:sharedVariableEntityId})
.then(function(response)
{
console.log('response : ' + JSON.stringify(response));

var config={
Entity:"Accounts",
APIData:{
"id": sharedVariableEntityId,
"testzoho4__CF": "Zylker test 888899999"
},
Trigger:[]
}
ZOHO.CRM.API.updateRecord(config)
.then(function(data){
console.log(data)
})

//show the record information for debugging
if (sharedVariableDebug) {
document.getElementById("recordInfo").innerHTML = JSON.stringify(response, null, 2);
}
});
}

it works great when i use it in "EDIT" mode, when i trigger my widget from a button in "VIEW" mode, got js errors :

       PUT https://plugin-testzoho4.zohosandbox.com/crm/v2/Accounts 400 (Bad Request)
and that one
Uncaught (in promise) {data: Array(1), $responseHeaders: {…}}
Promise.then
(anonyme) @ helper.js:298
Promise.then
handleCopyButtonCRMClick @ helper.js:285


helper.js:298 it's  :
ZOHO.CRM.API.updateRecord(config)
.then(function(data){
console.log(data)

and  helper.js:285
ZOHO.CRM.API.getRecord({Entity:"Accounts",RecordID:sharedVariableEntityId})
.then(function(response)
{

})

it's about .then

Any infos about theses errors ?
Thanks

same for 

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ



                                ご検討中の方