function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Austin VillanuevaAustin Villanueva 

Salesforce opencti Lightning: setSoftphonePanelVisibility stops working.. need help ASAP

Hi guys, can you help me figure it out because before it was working and I didn't change any code but now it stops working.
So before when I calling sforce.opencti.setSoftphonePanelVisibility({visible: true}); it works fine. 
but right it throws some error 
User-added image
as you can see there's nothing wrong with the result of the callback. It says success but it still doesn't work.
Does anyone of who come across this problem? Let me know if knows about.

Thank you.

Sincerely,
Austin
 
SOFIDEVSOFIDEV
Hi Austin and all other guys,
I can report the same problem.
In my case this problem happened as I introduced the function sforce.opencti.isSoftphonePanelVisible({callback:<callbackFct>});
sforce.opencti.setSoftphonePanelVisibility({visible: true}); is then called in its callback. The softphone remains minimized.
Before introducing sforce.opencti.isSoftphonePanelVisible({callback:<callbackFct>}), Calling sforce.opencti.setSoftphonePanelVisibility({visible: true}) worked fine, but I introduced isSoftphonePanelVisible() to solve the following issue:
If the softphone is visible,and you call sforce.opencti.setSoftphonePanelVisibility({visible: true}), the softphone will be first minimized then displayed, which shows as unbeautiful flickering of the softphone.

I'll be thankful for any advice.

Kind regards.
SOFIDEVSOFIDEV
Hi again,
I just want to enter the error message from the browser console after calling sforce.opencti.setSoftphonePanelVisibility({visible: true}); in this post:
uncaught exception: Error: Invalid or missing utility Id `false`
In case that someone starts searching for the error message.

I hope we get a solution shortly.

Best regards.
SOFIDEVSOFIDEV
Hi,
The error "Invalid or missing utility Id `false`" seems to occur, because the OpenCTI call sforce.opencti.setSoftphonePanelVisibility({visible: true}); leads to call the Lightning console API method getEnclosingUtilityId() which returns false. The result in our Browser console is the above error message.

May this be possible ?
What do you think about ?

Best regards.
Austin VillanuevaAustin Villanueva
Hi SOFIDEV, 

yeah I know that it returns false but I think it doesn't matter to us cause we are only concern about how the method works which is sforce.opencti.setSoftphonePanelVisibility({visible: true});​ and we are not concern how they implement it. Right? so did you open a ticket about this issue? any news about this? I hope they'll fix it soon.

Thank you.

Austin
SOFIDEVSOFIDEV

Hi Austin,
I couldn't open any ticket about this issue.
But I could solve my previously described issue with the following workaround:

First of all I invoke sforce.opencti.setSoftphonePanelVisibility({visible:true}); in the initialization phase of the softphone. I then check the content of the GUI to be displayed. If there are content/calls to be displayed, the softphone has to remain visible (so, nothing is to do). Otherwise, it will be hidden using sforce.opencti.setSoftphonePanelVisibility({visible:false});.
All subsequent calls of sforce.opencti.isSoftphonePanelVisible(); followed by sforce.opencti.setSoftphonePanelVisibility({visible:true}); are functional to 100%. The error "invalid or missing UtilityId `false`" was never reproduced, and the softphone was visible.
It seems that OpenCTI expects that sforce.opencti.setSoftphonePanelVisibility({visible:true}); is invoked first before sforce.opencti.isSoftphonePanelVisible();

Best regards.