How to make logged in user name as selected in the drop down on click of assign to me button ?

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member II

How to make logged in user name as selected in the drop down on click of assign to me button ?

Jump to solution

Hello,

I have created one process. The  process form contains one drop down which lists the usernames.

I have to give one button "assign to me" for this drop down, on click of that button, it should make the logged in username as selected.

For this, I have created one custom stencil and used that in ADF and able to  get the assign to me button. On click of that button also I am able to alert the logged in username.

But how to access the APS drop down at ADF ?

And 

How to make the logged in user name as selected in the drop down on click of assign to me button ?

I am attaching here with my exported process and stencil code.

Can any one provide solution in solving this.

Thanks & Regards

Shilpa Kulkarni

1 Solution

Accepted Solutions
Active Member II

Re: How to make logged in user name as selected in the drop down on click of assign to me button ?

Jump to solution

I got the solution to my query. I used the following steps to achieve the functionality:

assignToMe(){
this.ClientService.getUserInfo()
.subscribe(
data => {
this.userinfo = data;
this.rows = this.field.form.getFormFields();

let observedbyDropdown = this.rows.find(x => x.id === 'observedby');

if(observedbyDropdown)
{
observedbyDropdown.value = this.userinfo.user_name;
}
});
}

View solution in original post

1 Reply
Active Member II

Re: How to make logged in user name as selected in the drop down on click of assign to me button ?

Jump to solution

I got the solution to my query. I used the following steps to achieve the functionality:

assignToMe(){
this.ClientService.getUserInfo()
.subscribe(
data => {
this.userinfo = data;
this.rows = this.field.form.getFormFields();

let observedbyDropdown = this.rows.find(x => x.id === 'observedby');

if(observedbyDropdown)
{
observedbyDropdown.value = this.userinfo.user_name;
}
});
}

View solution in original post