Option to use the mobile phone to make call vs system phone in mobile view - Forum - Rollbase - Progress Community

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

 Forum

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

This question is answered

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.

Verified Answer
  • 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
  • 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

  • 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?

  • 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
     
  • 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>
  • yes I'm looking into making the phone field hyperlinked for release V5.0 (coming out over the summer - no exact date yet).

    Thierry.

  • 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
     
  • 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>";

  • 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
     
  • Hi Stephen,

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

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

  • 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.

  • Great, thanks Thierry!

  • Hello ,

    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

  • 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.