How to query a record sys_id in client script portal widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 08:14 AM
Hello All,
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
- Labels:
-
flow designer
-
Service Portal
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 01:14 PM
<div>
<!-- <span><a href ng-click="c.openPopUp()" uib-tooltip="Comments" tooltip-placement="bottom"> <i ng-style="c.setColor();" class="fa fa-comments fa-fw"></i> </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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 01:15 PM
<div>
<!-- <span><a href ng-click="c.openPopUp()" uib-tooltip="Comments" tooltip-placement="bottom"> <i ng-style="c.setColor();" class="fa fa-comments fa-fw"></i> </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 -->
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022 02:23 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2022 10:26 PM
Hi Reddy,
Were you able to find the Solution for this task .
Because I too had the same problem .
Thanks