open-cti-demo-adapter
open-cti-demo-adapter copied to clipboard
End call for unknown contact doesn't work
When I simulate call for unknown contact, I accept it without issues. When I try to end the call I got an error This page has an error. You might just need to refresh it. Action failed: c:connectedPanel$controller$endCall [Cannot read property 'length' of undefined] Failing descriptor: {c:connectedPanel$controller$endCall}
See the error below:
Did you find a resolution to this? I'm getting the same error...
It seems like it is fixed in lates version.
Thanks @mascot4m. Did you install this using ANT or the Managed Package? I'm using the Managed Package and doesn't seem to work.
Managed package. Can you try to post here debug log from that error?
Unfortunately the error Isn't showing up in the debug log nor could I find details on the Chrome Console... Error on the UI is: This page has an error. You might just need to refresh it. Action failed: c:connectedPanel$controller$endCall [Cannot read property 'length' of undefined] Failing descriptor: {c:connectedPanel$controller$endCall}
Debug Log: 43.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WAVE,INFO;WORKFLOW,INFO 07:56:37.0 (97768)|USER_INFO|[EXTERNAL]|0051I000000a2lT|[email protected]|Pacific Standard Time|GMT-07:00 07:56:37.0 (137593)|EXECUTION_STARTED 07:56:37.0 (143003)|CODE_UNIT_STARTED|[EXTERNAL]|01p1I00000GN0pe|SoftphoneContactSearchController.getContacts(String) 07:56:37.0 (351282)|HEAP_ALLOCATE|[72]|Bytes:3 07:56:37.0 (397639)|HEAP_ALLOCATE|[77]|Bytes:152 07:56:37.0 (412112)|HEAP_ALLOCATE|[342]|Bytes:408 07:56:37.0 (425760)|HEAP_ALLOCATE|[355]|Bytes:408 07:56:37.0 (437348)|HEAP_ALLOCATE|[467]|Bytes:48 07:56:37.0 (463363)|HEAP_ALLOCATE|[139]|Bytes:6 07:56:37.0 (482624)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:2 07:56:37.0 (494574)|METHOD_ENTRY|[9]|01p1I00000GN0pe|SoftphoneContactSearchController.SoftphoneContactSearchController() 07:56:37.0 (500366)|STATEMENT_EXECUTE|[9] 07:56:37.0 (505107)|STATEMENT_EXECUTE|[9] 07:56:37.0 (508789)|METHOD_EXIT|[9]|SoftphoneContactSearchController 07:56:37.0 (514869)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:14 07:56:37.0 (526370)|SYSTEM_MODE_ENTER|false 07:56:37.0 (535315)|VARIABLE_SCOPE_BEGIN|[10]|name|String|false|false 07:56:37.0 (561900)|VARIABLE_ASSIGNMENT|[10]|name|"(415) 555-1212" 07:56:37.0 (570660)|STATEMENT_EXECUTE|[10] 07:56:37.0 (572630)|STATEMENT_EXECUTE|[11] 07:56:37.0 (681596)|HEAP_ALLOCATE|[11]|Bytes:4 07:56:37.0 (755548)|VARIABLE_SCOPE_BEGIN|[11]|contactList|List<Contact>|true|false 07:56:37.0 (769789)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:4 07:56:37.0 (783213)|VARIABLE_ASSIGNMENT|[11]|contactList|[]|0x1d003be 07:56:37.0 (791000)|HEAP_ALLOCATE|[12]|Bytes:185 07:56:37.0 (804802)|HEAP_ALLOCATE|[12]|Bytes:4 07:56:37.0 (814394)|HEAP_ALLOCATE|[12]|Bytes:7 07:56:37.0 (825358)|HEAP_ALLOCATE|[12]|Bytes:7 07:56:37.0 (828793)|HEAP_ALLOCATE|[12]|Bytes:1 07:56:37.0 (845576)|HEAP_ALLOCATE|[12]|Bytes:16 07:56:37.0 (852502)|HEAP_ALLOCATE|[12]|Bytes:7 07:56:37.0 (857026)|HEAP_ALLOCATE|[12]|Bytes:16 07:56:37.0 (861916)|HEAP_ALLOCATE|[12]|Bytes:7 07:56:37.0 (866137)|HEAP_ALLOCATE|[12]|Bytes:16 07:56:37.0 (871846)|HEAP_ALLOCATE|[12]|Bytes:7 07:56:37.0 (876201)|HEAP_ALLOCATE|[12]|Bytes:16 07:56:37.0 (915049)|HEAP_ALLOCATE|[50]|Bytes:5 07:56:37.0 (938180)|HEAP_ALLOCATE|[56]|Bytes:5 07:56:37.0 (945937)|HEAP_ALLOCATE|[64]|Bytes:7 07:56:37.0 (2946852)|SOQL_EXECUTE_BEGIN|[12]|Aggregations:0|SELECT Id, Phone, Name, Title, Account.Name FROM Contact 07:56:37.0 (14784838)|SOQL_EXECUTE_END|[12]|Rows:0 07:56:37.0 (14986125)|HEAP_ALLOCATE|[12]|Bytes:54 07:56:37.0 (14998784)|HEAP_ALLOCATE|[12]|Bytes:8 07:56:37.0 (15011335)|SYSTEM_METHOD_ENTRY|[7]|QueryLocatorIterator.QueryLocatorIterator() 07:56:37.0 (15017372)|STATEMENT_EXECUTE|[7] 07:56:37.0 (15027773)|SYSTEM_METHOD_EXIT|[7]|QueryLocatorIterator 07:56:37.0 (15035603)|HEAP_ALLOCATE|[12]|Bytes:28 07:56:37.0 (15051676)|HEAP_ALLOCATE|[12]|Bytes:8 07:56:37.0 (15055260)|HEAP_ALLOCATE|[12]|Bytes:8 07:56:37.0 (15063126)|VARIABLE_SCOPE_BEGIN|[15]|this|Database.QueryLocatorIterator|true|false 07:56:37.0 (15103086)|VARIABLE_ASSIGNMENT|[15]|this|{}|0x49327e69 07:56:37.0 (15110547)|VARIABLE_SCOPE_BEGIN|[15]|values|List<SObject>|true|false 07:56:37.0 (15119726)|VARIABLE_ASSIGNMENT|[15]|values|null| 07:56:37.0 (15124459)|VARIABLE_SCOPE_BEGIN|[15]|ql|Database.QueryLocator|true|false 07:56:37.0 (15148308)|VARIABLE_ASSIGNMENT|[15]|ql|{"query":"SELECT Id, Phone, Na (165 more) ..."}|0x61bbd86 07:56:37.0 (15154907)|VARIABLE_SCOPE_BEGIN|[15]|totalNumRecords|Integer|false|false 07:56:37.0 (15162752)|VARIABLE_ASSIGNMENT|[15]|totalNumRecords|0 07:56:37.0 (15167405)|VARIABLE_SCOPE_BEGIN|[15]|queryMoreSize|Integer|false|false 07:56:37.0 (15173935)|VARIABLE_ASSIGNMENT|[15]|queryMoreSize|50000 07:56:37.0 (15273149)|HEAP_ALLOCATE|[12]|Bytes:28 07:56:37.0 (15296327)|METHOD_ENTRY|[12]||Database.QueryLocatorIterator.hasNext() 07:56:37.0 (15316267)|METHOD_EXIT|[12]||Database.QueryLocatorIterator.hasNext() 07:56:37.0 (15346527)|VARIABLE_ASSIGNMENT|[12]|contact|null| 07:56:37.0 (15353591)|STATEMENT_EXECUTE|[12] 07:56:37.0 (15369810)|STATEMENT_EXECUTE|[15] 07:56:37.0 (15398647)|HEAP_ALLOCATE|[15]|Bytes:24 07:56:37.0 (15407246)|SYSTEM_METHOD_ENTRY|[1]|JSON.JSON() 07:56:37.0 (15410695)|STATEMENT_EXECUTE|[1] 07:56:37.0 (15414964)|SYSTEM_METHOD_EXIT|[1]|JSON 07:56:37.0 (15425291)|METHOD_ENTRY|[15]||System.JSON.serialize(Object) 07:56:37.0 (15653439)|METHOD_EXIT|[15]||System.JSON.serialize(Object) 07:56:37.0 (15663263)|SYSTEM_MODE_EXIT|false 07:56:37.15 (15689826)|CUMULATIVE_LIMIT_USAGE 07:56:37.15 (15689826)|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 1 out of 100 Number of query rows: 0 out of 50000 Number of SOSL queries: 0 out of 20 Number of DML statements: 0 out of 150 Number of DML rows: 0 out of 10000 Maximum CPU time: 0 out of 10000 Maximum heap size: 0 out of 6000000 Number of callouts: 0 out of 100 Number of Email Invocations: 0 out of 10 Number of future calls: 0 out of 50 Number of queueable jobs added to the queue: 0 out of 50 Number of Mobile Apex push calls: 0 out of 10
07:56:37.15 (15689826)|CUMULATIVE_LIMIT_USAGE_END
07:56:37.0 (15725489)|CODE_UNIT_FINISHED|SoftphoneContactSearchController.getContacts(String) 07:56:37.0 (16896185)|EXECUTION_FINISHED
I think the error is in the connectedPanelHelper.js file on line 13: If the component getter fails to retrieve the attribute associated with the ID the descriptor fails (idk what that means) but basically it's just unable to measure the length of a string that doesn't exist. I just checked for falsy since it's supposed to be invoking the callback.
!cmp.get('v.recordId') vs cmp.get('v.recordId').length == 0
not too sure if this is what should be done but it stopped the failure
I'm getting an error that says :
Cannot read property 'opencti' of undefined
Even though I am using the required scripts in the my page that hosts the lightning out App.
Can anyone here help me figure what I might be doing wrong?
I'm using the below resources in my page:
<script type="text/javascript" src="/support/api/38.0/lightning/opencti.js"></script>
<script src="/support/api/40.0/interaction.js" type="text/javascript"></script>
In connectedPanelHelper.js, you need to add another judgment as'undefined'.
Old Code
if (cmp.get('v.recordId').length == 0 || cmp.get('v.showDialPad')){
callback();
}
New Code
if (cmp.get('v.recordId') == undefined || cmp.get('v.recordId').length == 0 || cmp.get('v.showDialPad')){
callback();
}