Can't find the "ng-click" function of the "save" button in the OTB "form" widget

F_bio Santos
Kilo Sage

Hi everyone, Im trying to add a functionality on the "save" button of the OTB "Form" Widget, in this case is that when we click the button, it should save the form and redirect the user to the home page, the problem is that I cant find the "save" button action on the Client Controller, can anyone help with this ?

1 ACCEPTED SOLUTION

Alka_Chaudhary
Mega Sage
Mega Sage

Hello @F_bio Santos ,

You can find the ng-click 'triggerUIAction' function for save in the HTML at line 118 :

  <button ng-if="getPrimaryAction()" type="submit" ng-click="triggerUIAction(getPrimaryAction())" ng-disabled="submitting" class="btn btn-primary action-btn pull-right" gsft_id="{{::getPrimaryAction().sys_id ? getPrimaryAction().sys_id : ''}}">${Save} <span ng-if="saveButtonSuffix">(${{{saveButtonSuffix}}})</span></button>

 You can search 'triggerUIAction' in client controller you can find the function:-

Alka4_0-1697454987376.png

 

If this response clears up your doubt, kindly flag it as both helpful and correct.

Thanks,

Alka

View solution in original post

4 REPLIES 4

Alka_Chaudhary
Mega Sage
Mega Sage

Hello @F_bio Santos ,

You can find the ng-click 'triggerUIAction' function for save in the HTML at line 118 :

  <button ng-if="getPrimaryAction()" type="submit" ng-click="triggerUIAction(getPrimaryAction())" ng-disabled="submitting" class="btn btn-primary action-btn pull-right" gsft_id="{{::getPrimaryAction().sys_id ? getPrimaryAction().sys_id : ''}}">${Save} <span ng-if="saveButtonSuffix">(${{{saveButtonSuffix}}})</span></button>

 You can search 'triggerUIAction' in client controller you can find the function:-

Alka4_0-1697454987376.png

 

If this response clears up your doubt, kindly flag it as both helpful and correct.

Thanks,

Alka

Hi @Alka_Chaudhary  so should I put this code on the line 110 ?

window.location.href = "link_to_the_homepage";

Hello @F_bio Santos ,

 

You can put the above code on line 117.

 

Thanks,

Alka

Hey @F_bio Santos ,

Use this code ?id=id of the page to redirect to another page.

window.location.href = "?id=link_to_the_homepage";

Thanks,

Alka