I am encountering a strange issue in my Web ex cc widget where an API call using the Zoho CRM SDK works in certain states but not in others.
processSelectEntity(selectedValue) {
console.log("Data received to open the record:", selectedValue);
const [recordId, interactionId] = selectedValue.split('|');
console.log("Record ID:", recordId);
console.log("Interaction ID:", interactionId);
let entityToOpen = this.noRecordFound ? this.noMatchEntity : this.crmDefaultEntityName;
entityToOpen = this.mapEntityName(entityToOpen);
console.log(`Attempting to open record. Entity: ${entityToOpen}, Record ID: ${recordId}`);
ZOHO.CRM.UI.Record.open({ Entity: entityToOpen, RecordID: recordId })
.then((res) => {
if (!res) {
console.warn(`Failed to open record. Entity: ${entityToOpen}, Record ID: ${recordId}`);
} else {
console.log(`Record opened successfully. Entity: ${entityToOpen}, Record ID: ${recordId}`);
}
})
.catch((error) => {
console.error(`Error while opening record. Entity: ${entityToOpen}, Record ID: ${recordId}`, error);
});
}
Behavior Observed:
- The function works perfectly when the agent is in Idle or Available states.
- When the agent is in Engaged state (call is active and connected), the API call is not triggered:
- No error is shown in the browser console.
- No network request is visible in the network tab.
Main Concerns
- Are there restrictions or conditions that might prevent API calls during certain states (e.g., "Engaged")?
- Could the engaged state be blocking requests at the browser or SDK level?
- How can I debug or overcome this issue?
Any help or guidance would be greatly appreciated. Thank you!