GithubHelp home page GithubHelp logo

embeddedapp-js-sdk's Introduction

LICENSE

Copyright (c) 2022, ZOHO CORPORATION PRIVATE LIMITED
All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

JS SDK lib

https://github.com/ZohoDevelopers/embeddedApp-js-sdk/releases

Latest Docs


https://help.zwidgets.com/help/latest/index.html

To register Listeners with EmbededApp

ZOHO.embeddedApp.on("DialerActive",function(){
		console.log("Dialer Activated");
})

ZOHO.embeddedApp.on("Dial",function(data){
		console.log("Number Dialed");
})

ZOHO.embeddedApp.on("PageLoad",function(data){
		console.log(data);
})
// Prints
-----------------------------
RelatedList
-----------------------------
{
  "Entity": "Leads",
  "EntityId": "3000000032096"
}
-----------------------------
Buttons
-----------------------------
{
  "EntityId": [
    "3000000040011",
    "3000000032101",
    "3000000032096",
    "3000000032091",
    "3000000032009"
  ],
  "Entity": "Leads",
  "ButtonPosition": "ListView"
}

Description

DialerActive	- Triggered everytime softphone window is toggled
Dial 			- Triggered when Call icon inside ZohoCRM is clicked
PageLoad 		- Triggered When ever an entity Page (Detail page) is loaded
HistoryPopState	- Triggered when browser back is invoked in WebTab Widget with custom widget params

Example

/*
 * Subscribe to the EmbeddedApp onPageLoad event before initializing 
 */
 
ZOHO.embeddedApp.on("PageLoad",function(data)
{
	console.log(data);
	//Custom Bussiness logic goes here
})

ZOHO.embeddedApp.on("HistoryPopState",function(data){
	console.log(data);

	// Custom business logic code goes here.
})

/*
 * initializing the widget.
 */
ZOHO.embeddedApp.init();

embeddedapp-js-sdk's People

Contributors

aadhil-kh-9161 avatar anandkumar98 avatar itsarunvenkatesh avatar kpgarrod avatar naresh28babu avatar udhayakumar-d avatar zoho-platform avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

embeddedapp-js-sdk's Issues

Can this SDK be used on Zoho Recruit ?

Hi,

I'm trying to develop an extension for Zoho Recruit, and I'm wondering if this SDK can be used to add custom widget in Zoho Recruit pages ?

Cheers,
Rémi.

Dial no longer working

Hi,

It would appear that the Dial listener is no longer working with our integration as of 0.9.3. It would appear that the events are being raised, but the listeners are missing after we have registered them.

Parentwindow reference not found.

Hello,
I want to request information from my third-party app and view it within my app. So I load my app in iframe in widget.html and load the js sdk of zoho in my app.I get the instance of zohodesk within my app but unable to get the response of the request Api and get the parentWindow reference error.

var reqObj =
{
url: 'https://desk.zoho.com/api/v1/contacts',
headers: { 'Content-Type': 'application/json', orgId: '787386987' },
type: 'GET',
data: { },
postBody: {},
connectionLinkName: "zohodeskconn",
responeType: "arraybuffer"

}
ZOHODESK.request(reqObj).then(res => {
console.log('API RESPONSE: ', res);
}, (error) => {
// Implement your logic here
console.log('API RESPONSE: Failed ' );
})

ZohoDeskClientSDK.min.js:1 Uncaught Error: Parentwindow reference not found.
at v (ZohoDeskClientSDK.min.js:1:3908)
at Object.f [as SendEvent] (ZohoDeskClientSDK.min.js:1:3666)
at i.fetch (ZohoDeskClientSDK.min.js:1:5401)
at Object.request (ZohoDeskClientSDK.min.js:1:6982)
at :12:10

Sleep is dangerous

while( (startTime + milliSeconds) > new Date().getTime()) {};

I dont know if this function is being used anywhere but this code can freeze up someone`s browser.
Please use something along the lines of:
await new Promise((res) => setTimeout(res,timeout_here))

ZOHO.embeddedApp.on("PageLoad", ...) it's only triggered the first time

Hello.

I'm developing a telephony widget and this method doesn't work as the doc says:

 ZOHO.embeddedApp.on("PageLoad",function(data)
  {
    console.log(data);
    //Custom Bussiness logic goes here
  })

ZOHO.embeddedApp.init();

I want to receive this event every time I navigate to an entity, but I only get this event when the telephony widget is loaded the first time. If I navigate to other entities once the widget's been initialized I don't receive the event.

It's easy to reproduce.

Regards

SDK stuck on `v2` API, need to use `v2.1` for new Metadata APIs

I do not see any way to have the SDK in the widget make use of the new v2.1 API. When inspecting the browser console while running a widget, and using the META APIs, I can see that the v2 APIs are being called.

Is there a way to make requests through this SDK using the newer API versions (v2.1, or even v3)?

Telephony App not installing correctly

I have made an extension using Zoho Developer but cannot get the Telephony icon to appear after I install the app. It works fine in the sandbox but the widget doesn't get retrieved for our production Zoho CRM account.

I followed the instructions here:
https://www.zoho.com/developer/help/extensions/embedded-apps/

https://www.zoho.com/developer/help/extensions/embedded-apps/building-a-client-side-app.html

https://www.zoho.com/developer/help/extensions/buildingwidgets.html

Even though the documentations have inconsistencies, I have tried all things that make sense but the telephony icon doesn't appear after installation.

Thanks,

schmorrison

Populate Quoted Items

Hello team,

We tried to use the populate function in "Quotes" updating the "Quoted_Items", but it's not working.

When we exec the populate, the product names (id) is not working. (Don't update)

The structure of "Quoted_Items" received is:

[
{
"Sequence_Number": "2",
"Product_Name": "{{product_name}}",
"Description": "{{product_description}}",
"Quantity": "1",
"Total": "0.00",
"Discount": "0",
"Total_After_Discount": "0.00",
"Net_Total": "0",
"Product_Id": "4204471000006779978"
},
{
"Sequence_Number": "1",
"Product_Name": "{{product_name}}",
"Description": "{{product_description}}",
"Quantity": "1",
"Total": "0.00",
"Discount": "0",
"Total_After_Discount": "0.00",
"Net_Total": "0",
"Product_Id": "4204471000006779977"
}
]

We tried to use the same structure and some others.

Any one can help me?

Parentwindow reference not found

ZOHO.CRM.UI.Record.open({Entity:"Leads",RecordID:"1000000036062"})
.then(function(data){
console.log(data)
})

when i try to call this function getting error can help?

ZSDK.js:314 Uncaught Error: Parentwindow reference not found.
at PostMessage (ZSDK.js:314)
at Object.TriggerEvent (ZSDK.js:222)
at Object.TriggerEvent [as Trigger] (ZSDK.js:464)
at newRequestPromise (ZohoCrmHelper.js:39)
at manipulateUI (ZohoCrmHelper.js:289)
at Object.open (ZohoCrmHelper.js:5154)
at primo.php:18175

React/Node bindings in NPM?

Hello,

I am not sure if anyone is actively looking at these right now. A question for those of us that are working with things like React, Angular, Node etc... Do you have any intentions of giving us things like an NPM package with this or is it outside the scope of your current development line?

My use case is using React to create widgets, but I'm sure there are other developers that would like to work on your stack that could use some helpers along the way.

@Anandkumar98

Zoho getAllRecords() promise not returning the info object

In Zoho-Js-Sdk, Function for getting all record of a module i.e getAllRecords() is only returning the data object in resolved promises. In some cases info object is also required which is containing per_page, page, count, etc.

ZOHO.CRM.API.getAllRecords({Entity:"Leads",sort_order:"asc",per_page:2,page:1}) .then(function(data){ console.log(data) })

In Xhr response we can see both the data,
zohoxhr

Not getting info object in promise
promises

Please provide both the data in resolved promise.

GetAllUsers do not return custom fields

Hello, I have an issue as title, I use method GetAllUsers but data return do not containt my custom fields. But when I use method GetUser it work with my custom fields. Can you please help me
Untitled

Feature Request: TypeScript typings

I build out Zoho CRM extensions using modern JavaScript frameworks (Angular, React, Vue), and prefer to do all my work in TS. Is there any hope that Typings for TS are on the roadmap?

If not, I may do some work on it and submit a PR.

Thanks and best regards,

Schmorrison

Add support for CRUD tags and business card fields

Hello,
Thank you the the lib.

Like I mentioned in the title, I need to perform CRUD of tags from my widget extension in Zoho CRM.

Also for business card, I can see that when access a record detail page, I'm able to see that Zoho call

https://crm.zoho.com/crm/v2.2/settings/modules/Leads?include=%24properties%2C%24on_demand_properties%2Clayouts%2Ccustom_view%2Cmass_action_cv%2Cshow_social%2Cshow_webform%2Cshow_visitor%2Cshow_googlesync%2Cshow_emailparser%2Cshow_phonebridge%2Cshow_salessignals%2Cshow_emailsettings%2Cshow_dashboard%2Cdefault_view%2Cper_page%2Cfilter_status%2Ckanban_view%2Ckanban_view_supported%2Cstage_view%2Ccustomized_view%2Cshow_zf_panel%2Ctask_completed_rule_configured%2Cnew_call_view%2Czb_custommodule_enabled%2Cgroup_by_field_available%2Ckanban_feature_status%2Ckanban_view_fields%2Cmodule_mlabel%2Cmodule_nlabel%2Czia_view%2Cterritory%2Crelated_lists%2Crelated_list_properties%2Cbusiness_card_fields%2Csearch_layout_fields%2Ccpq_search_layout_fields%2Clookup_field_properties

Which return modules[0] with search_layout_fields (current displaying business card) and business_card_fields.
This method return current module metadata and more fields than what I'm using with SDK to get fields for module.

Thank you.

ZOHO.embeddedApp.on("PageLoad" does not work on Safari

Hello there.

I have one Zoho CRM extension which makes use of this library. It works perfectly in many browsers, but not in Safari 10.1 and 11.2.

Apparently, the event PageLoad never triggers on Safari, for there are no errors reported. I also tried to debug this, but I never got to the callback function passed as listener for this event.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.