cancel
Showing results for 
Search instead for 
Did you mean: 

HowTo create a direct link to an approval

Former Member
0 Kudos

Hi all,

did someone of you tried to create a direct link to an approval?

The link looks like this: "u2026/ProcessRequest?RequestID=12345&TaskID=111&EntryID=01234"

So my question:

Is it possible to use SQL statements in these scripts to read out the needed data from "MXP_PROVISION"?

I have tried out this:

Configuration in "EMailNotifiaction_Approval" Pass:

MSKEY %MSKEY%

MX_APPROVERS %MX_APPROVERS%

MX_ENTRY_REFERENCE %MX_ENTRY_REFERENCE%

Coding in the script of "Next data entry" (just the relevant part)

var entryReference = Par.get ("MX_ENTRY_REFERENCE");

var sql = "SELECT MSKEY FROM MXP_PROVISION WHERE AUDITREF = " + entryReference;

var sqlresult = "";

sqlresult = uSelect (sql);

I don´t get a Value into "sqlresult". I think one problem is that he doesn´t read the value of entryReference

Br,

Philip

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I think that should not be a problem.

The values are selected with the "pendingValue". The "pendingValue" is always different i think.

Former Member
0 Kudos

Did anyone ever try to make a link including the approve/decline button?

So a click would directly approve?

I suppose that a bit more complicated

Former Member
0 Kudos

Hello,

use the attribute MX_APPROVALS instead. There you can get the information needed.

Best regards

Dominik Trui

Former Member
0 Kudos

Hi Dominik,

tell me if i am wrong.

I have to add the attribute "MX_APPROVALS" with the value "%MX_APPROVALS%" into the destination tab of the emailnotification pass. In the script to this pass i write a line

var approvals = Par.get("MX_APPROVALS");

When i print out the approvals in the mail i get the value "null".

Br,

Philip

Former Member
0 Kudos

Hello Philip,

where do you send the mail? In a task before the approval?

It should be set as "Execute task on initialize" of the approval task

Best regards

Dominik

Former Member
0 Kudos

Hi Dominik,

i think i theres another solution.

In MXWV_PENDING_APPROVALS, all data is provided.

I have built up a uSelect looking like this:

var sql = "SELECT APPROVALTASKID, AUDITREF FROM MXWV_PENDING_APPROVALS WHERE MSKEY = " + pendingValue;
var sqlresult = "" ;
sqlresult = uSelect(sql);

The only problem now is, that i get the error "uSelect(SELECT APPROVALTASKID, AUDITREF FROM MXWV_PENDING_APPROVALS WHERE MSKEY = 28729) got exception java.sql.SQLException: ORA-00942: table or view does not exist "

Is it possible that i cannot use views in select statements in this case? Or can you see a syntax error?

Br

Philip

thomas_groth2
Explorer
0 Kudos

Hello,

u could check if your xxx_rt user has read privilege for that view.

And i think with uSelect you can only return one field. If you need two fields you have to convert them to one (e.g. select fielda || '@@' || fieldb from ...) and seperate them later result2=result.split("@@").

Br,

Thomas

Edited by: Thomas Groth on Mar 10, 2011 3:37 PM

Edited by: Thomas Groth on Mar 10, 2011 3:39 PM

Former Member
0 Kudos

Thank you Thomas,

the privilege was the problem.

Maybe someone of you had the same problem.

I have solved it like this now: (All with * marked lines can be found in the HowTo guide)

*var pendingValue = Par.get("MSKEY");

*var approverList = Par.get("MX_APPROVERS");

*var entryReference = Par.get("MX_ENTRY_REFERENCE");

*// uErrMsg(logLevel,"Approver List: " + approverList);

*var approvers = new java.util.Vector();

*approvers = uSplitString (approverList, "|");

*var i = 0;

*var result;

*var emailAddress = "";

*var idStore = uGetIDStore();

*var emailAttribute = "%$MAILATTRIBUTE%";

var sql = "SELECT APPROVALTASKID, AUDITREF, PARENTMSKEY FROM MXWV_PENDING_APPROVALS WHERE MSKEY = " + pendingValue;

var sqlresult = "" ;

sqlresult = uSelect(sql);

var part = new java.util.Vector();

part = uSplitString (sqlresult, "|");

actionid = part.get(0);

auditref = part.get(1);

usermskey = part.get(2);

// This line was made to get the unique name of the requesting person

var sqlname = "SELECT AVALUE FROM MXIV_SENTRIES WHERE (ATTR_ID = 2 AND MSKEY = " + usermskey + ")";

var name = "";

name = uSelect(sqlname);

var url = "http://10.44.110.68:50000/webdynpro/dispatcher/sap.com/tcidmwd~workflow/ProcessRequest?RequestID=" + auditref + "&TaskID=" + actionid + "&EntryID=" + pendingValue;

I think there are much more solution. (Iam new at IdM )

Br,

Philip

thomas_groth2
Explorer
0 Kudos

What happends if your user has two or more open approvals?

thomas_groth2
Explorer
0 Kudos

Hello,

i think the field %MX_ENTRY_REFERENCE% is not the AuditRef you are looking for in the Select. You could try to get the AuditRef in the script with the function ugetAuditID().

%MX_ENTRY_REFERENCE% is probably either the User_mskey or the Privilege_mskey.

Best regards,

Thomas