cancel
Showing results for 
Search instead for 
Did you mean: 

Approval Button

Former Member
0 Kudos

Hello

I would like to create approval button in a Web Dnypro application which will be visible only to the manger

is there any step by step guide/blog or thread that I can use ?

I am new portal developer

thx

Shai

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

answered

Former Member
0 Kudos

Hi ,

At first depending upon the role, is the login user manger or employee.

Create one context value attribute(Vis) and for that attribute set the property as visibility from the browse option.

set the visible property of your button as the context attribute that you have created.

You need to put this coding in the ModifyView of the View implementation

If(manager)

{

wdContext.currentContextElement().setVis(wdVisibility.NONE)

}

Hope this will resolve ur problem

Thanks

Kanai

Former Member
0 Kudos

Hi,

Create an Attribute of type Visibility and Bind it to your button.

and now make it visible when the user is Manager

wdContext.currentContextElement().setVisibility(WDVisibility.VISIBLE);

Hope this helps,

Jithin

Former Member
0 Kudos

Hi,

What you could do is set the Enabled property of the Button as per the current portal user, perhaps...

You can get the current Portal Users details using some of the below code. You might have to , perhaps, execute a Adaptive RFC Call additionalle to retrieve a list of valid Manager names, for example.

You can then check the name returned from this call against the current portal user and enable/disable the button. Let me know if you need more info

try {

IWDClientUser clientUser = WDClientUser.getCurrentUser();

IUser user = clientUser.getSAPUser();

String displayname = user.getDisplayName();

wdContext.currentContextElement().setDisplayname(displayname);

String uniquename = user.getUniqueName();

wdContext.currentContextElement().setUniquename(uniquename);

String firstname= user.getFirstName();

wdContext.currentContextElement().setFirstname(firstname);

String uid= user.getUniqueID();

wdContext.currentContextElement().setUid(uid);

String jobtitle= user.getJobTitle();

wdContext.currentContextElement().setJobtitle(jobtitle);

String lastname=user.getLastName();

wdContext.currentContextElement().setLastname(lastname);

}

catch (WDUMException e)

{