How to query a record sys_id in client script portal widget.

Reddy
Kilo Sage

Hello All,

find_real_file.png

 

I'm attempting to use the same HTML href URL in the client script for the Confirm button. However, I am unable to obtain the record sys id.

HTML link for RITM0022516 is 

 <a ng-href="?id=approval&table=sysapproval_approver&sys_id={{::approval.sys_id}}" id="approval_task_{{::approval.sys_id}}"title="{{data.ViewApprovalPageMsg}}">{{::approval.task.number}}</a></span><br>

 

client script URL for Confrim button:

c.openPopUp = function() {
var url = "?id=approval&table=sysapproval_approver&sys_id="+$scope.data.approval.sys_id;
var popup = window.open (url, "popup", "width=900, height=600");
}

 

Thanks,

Reddy

13 REPLIES 13

@János 

 


<div>
<!-- <span><a href ng-click="c.openPopUp()" uib-tooltip="Comments" tooltip-placement="bottom">&nbsp;<i ng-style="c.setColor();" class="fa fa-comments fa-fw"></i>&nbsp;</a></span> -->

<button ng-click="c.openPopUp()" class="btn btn-primary">confrim</button>
</div>
</div>
<div class="panel-body">
<span ng-if="approval.task.cab_date" class="m-r-sm"><img src="Changerequestapproval.png" class="img im-responsive item-image"/></span>
<span ng-if="approval.variables.length" class="m-r-sm"><img src="Requestapproval.png" class="img im-responsive item-image"/></span>

<div class="col-lg-12">
<span class="header-state">
<a ng-href="?id=approval&table=sysapproval_approver&sys_id={{::approval.sys_id}}" id="approval_task_{{::approval.sys_id}}" title="{{data.ViewApprovalPageMsg}}">{{::approval.task.number}}</a></span><br>
<!-- <ng-if="approval.short_description"><label>${Requested Item:}</label><descript>{{::approval.task.cat_item}}</descript><br></ng-if> -->
<ng-if="approval.task.short_description"><label>${Description:}</label><descript>{{::approval.task.short_description}}</descript></ng-if>

@János 


<div>
<!-- <span><a href ng-click="c.openPopUp()" uib-tooltip="Comments" tooltip-placement="bottom">&nbsp;<i ng-style="c.setColor();" class="fa fa-comments fa-fw"></i>&nbsp;</a></span> -->

<button ng-click="c.openPopUp()" class="btn btn-primary">confrim</button>
</div>
</div>
<div class="panel-body">
<span ng-if="approval.task.cab_date" class="m-r-sm"><img src="Changerequestapproval.png" class="img im-responsive item-image"/></span>
<span ng-if="approval.variables.length" class="m-r-sm"><img src="Requestapproval.png" class="img im-responsive item-image"/></span>

<div class="col-lg-12">
<span class="header-state">
<a ng-href="?id=approval&table=sysapproval_approver&sys_id={{::approval.sys_id}}" id="approval_task_{{::approval.sys_id}}" title="{{data.ViewApprovalPageMsg}}">{{::approval.task.number}}</a></span><br>
<!-- <ng-if="approval.short_description"><label>${Requested Item:}</label><descript>{{::approval.task.cat_item}}</descript><br></ng-if> -->
<ng-if="approval.task.short_description"><label>${Description:}</label><descript>{{::approval.task.short_description}}</descript></ng-if>

<!-- Change Request -->

I would change it like below:

<button ng-click="c.openPopUp(approval.sys_id)" class="btn btn-primary">${Confirm}</button>

Then - of course - I would change the definition of the function in the Client controller:

c.openPopUp = function (approvalUniqueId) {

so that later in the script one could use variable approvalUniqueId whenever the sys_id of the approval record is needed.

*) not really related, but I would also write ${Confirm} in place of confrim -firstly because it is misspelled but most important to make it translatable (by surrounding it with ${}).

Finally, I would really consider using spModal to display modal dialogs. Have a look at @Kieran Anson's excellent article describing its usage.

Mahesh Sawant
Tera Contributor

Hi Reddy,

Were you able to find the Solution for this task . 
Because I too had the same problem . 

Thanks