Option to use the mobile phone to make call vs system phone

Posted by anu31221@gmail.com on 07-Mar-2017 23:44

Hi

What code can i use in button  or phone number which after click uses the phone to make call.

We also have button which use the twilio phone to make calls.

Posted by Ruben Dröge on 09-Mar-2017 01:28

This has been communicated with Rollbase PM, because it would be nice to have this out-of-the-box based on the field type.

If you don't want a bunch of extra fields in your object (and you have multiple fields on your page that contain phone numbers), you can achieve the same using a simple client-side script:

<script>
//eventListener
rb.newui.util.addEventListener(rb.newui.util.customEvents.rbs_pageRender, function(){ 
//Loop through all fields that have Phone in integration name and get the actual value
    	$("[id*=Phone][class*=value]").each(function() {
      		var phoneNumber = $("div[id*=Phone][class*=value]").text();
//Apply the link to the phone number
      		$("div[id*=Phone][class*=value]").html('<a class="k-link" href="tel: ' + phoneNumber + '">' + phoneNumber + '</a>');
    	})
</script>

All Replies

Posted by Shiva Duriseati on 08-Mar-2017 01:23

Hi Anu,

You could use following code at server side(Object script trigger.) to make a phone call using Twilio Number:

Pass To, From and any Url which has to be called after picking phone. For a test i've used sample URL which is provided by twilio.

var url="https://ID:TOKEN@api.twilio.com/2010-04-01/Accounts/ACdf427218d05067f2a5333beaba63607d/Calls";//Construction of  URL

var params={"To":"+XXXXXX","From":"+XXXXXX","Url":"demo.twilio.com/.../Passin recipient and sender mobile number

var finalResponse = rbv_api.sendHttpPost(url, params, null);

rbv_api.println(finalResponse);

I will see if i can make the call using ajax post. But its NOT A GOOD IDEA to make a client side call where AuthToken and ID could be visible to everyone .

The same can be tested using POSTMAN or any rest clients. Please see attached screenshot.

Regards,

Shiva

Posted by anu31221@gmail.com on 08-Mar-2017 21:09

How can i enable when some one click on phone number or a button from mobile phone it should do y want to use phone to call or whatsup?

Posted by stephen.vanrooyen on 09-Mar-2017 00:28

Hi,
 
I had a similar requirement, this is how I achieved it.
 
Like the mailto link there is a tel link as well.
I created a formula field, with a return type of String containing the code below
return "<a href='tel:{!phone}'>{!phone}</a>";
 
When you click the link you should take you to your system phone on mobile  (or give you the option to choose the default app)
 
Regards,
http://www.aigs.co.za/templates/email_signatures/2016/stephen_van_rooyen.png
 

Posted by Ruben Dröge on 09-Mar-2017 01:28

This has been communicated with Rollbase PM, because it would be nice to have this out-of-the-box based on the field type.

If you don't want a bunch of extra fields in your object (and you have multiple fields on your page that contain phone numbers), you can achieve the same using a simple client-side script:

<script>
//eventListener
rb.newui.util.addEventListener(rb.newui.util.customEvents.rbs_pageRender, function(){ 
//Loop through all fields that have Phone in integration name and get the actual value
    	$("[id*=Phone][class*=value]").each(function() {
      		var phoneNumber = $("div[id*=Phone][class*=value]").text();
//Apply the link to the phone number
      		$("div[id*=Phone][class*=value]").html('<a class="k-link" href="tel: ' + phoneNumber + '">' + phoneNumber + '</a>');
    	})
</script>

Posted by Thierry Ciot on 09-Mar-2017 18:56

yes I'm looking into making the phone field hyperlinked for release V5.0 (coming out over the summer - no exact date yet).

Thierry.

Posted by stephen.vanrooyen on 16-Mar-2017 02:00

Hi Ruben,
 
Your solution/work-around seem to only address the Details Page.
Is there a similar solution/work-around for Phone number fields in a View?
 
@ Thierry – It will be really helpful if it is automatically catered for.
 
Regards,
http://www.aigs.co.za/templates/email_signatures/2016/stephen_van_rooyen.png
 

Posted by Aede Hoekstra on 16-Mar-2017 05:08

I'm using a formula field to generate link which you use can use to click on the phone number:

return "<a href='tel:{!Telephone}'>{!Telephone}</a>";

Posted by stephen.vanrooyen on 16-Mar-2017 05:32

Hi Aede,
 
If you read the previous comments, this is currently what I’m doing.
 
I was enquiring if there is a way to achieve this without having to create an additional field for every phone number field.
 
Regards,
http://www.aigs.co.za/templates/email_signatures/2016/stephen_van_rooyen.png
 

Posted by Aede Hoekstra on 16-Mar-2017 10:55

Hi Stephen,

Sorry missed your comment! Thierry's proposed solution will be the best for achieving this in a simple way.

Posted by Thierry Ciot on 16-Mar-2017 12:26

@Stephen yes it will be automatically catered for in V5.0

Posted by Thierry Ciot on 23-May-2017 09:09

We just want to confirm this is implemented for V5.0.

If you are interested you can try it out on eap.rollbase.com

Thierry.

Posted by Ruben Dröge on 24-May-2017 02:12

Great, thanks Thierry!

Posted by IramK on 24-May-2017 03:52

Hello [mention:c6ad25f95bb84e839bc6845bc8789e44:e9ed411860ed4f2ba0265705b8793d05] ,

That's a great addition, however, it would also be really good to have this feature for the email address fields whereby a "mailto:" gets prepended to it automatically like how you are catering for the phone number field now along with an envelope icon :).

Cheers.

Iram

Posted by Thierry Ciot on 24-May-2017 21:31

Iram,

With mail field, when you click on it we go to our send mail jsp (send.jsp) where you can select an email template, ect...

So we cannot change that behavior without breaking existing function.

Thierry.

This thread is closed