Creating a widget to open an URL on the record producer

ALBIN BABY
Tera Contributor

Hi,

I have record producer to show in mobile. In that there is a field to show an URL on my record producer. This field will have dynamic value based on some user inputs. Variable type URL is not working in mobile but working in sp. 

So another alternative, is to create a button beside this URL field. I don't have much knowledge in widget creation. Please help me to create a button type widget to open the URL  in a browser .

1 ACCEPTED SOLUTION

Make sure your url is constructed properly

function($scope,$window) {
    var c = this;
    c.uiAction = function() {
		var url = $scope.page.g_form.getValue("url");
		$window.location.href = url; 

    }
}

View solution in original post

13 REPLIES 13

Pranesh072
Mega Sage
Mega Sage

You can create a widget, then add it to a macro variable and include in your record producer.

to create simple button widget you can use this - https://serviceportal.io/create-custom-action-buttons-service-portal/

let me know if you need any other help

hi

Tnks for the link. 

In my record producer, the URL will be stored in a string field. On pressing the button beside it, the user should be navigated to that URL. 

how to script for this scenario.

        $scope.page.g_form.getValue("variable_name");

 

 

Like this.

function() {
var c = this;
c.uiAction = function() {
$scope.page.g_form.getValue("url");

}
}