
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 06:24 PM
Hi All,
Having some simple issues with my workflow and wondered this is working by design, something I've done wrong, or is a bug in the system.
I have a simple workflow to generate 2 approval records, request manager approval (via script) and then one-up manager approval (also via script). The two approver activities are essentially identical, they only point to a different field. See workflow and activity screenshots below:
The requirement should also for a person to open a HR Case for someone else, hence the 'requester' can be different, but this still doesn't create the correct approval tasks.
Can anyone help me figure out why the approvals aren't generated if the 'opened_by' matches the person the approval is being requested from?
Much appreciated.
Solved! Go to Solution.
- Labels:
-
Service Portal
-
Workflow

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2018 05:57 PM
In the end what I did here was to add validation to the Record Produce to disallow the user to put themselves as the approvers. I added a Catalogue Client Script, OnSubmit, to throw up an error and stop the save from occurring.
The original problem around the approval tasks no appearing was the BR shown in a previous update, this is still needed for the Change process where people sit in multiple groups but cannot approve their own changes.
Thanks for all your help with this.
Cheers
Carl.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 06:49 PM
Thanks Diana - I have had this in the past also. In this case though it's definitely got data as I'm outputting all the fields to the HR Case description and I can see they are completed correctly.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 06:57 PM
I think it might have something to do with this Business rule:
Not being a 'coder' how can I change this to actually only restrict to the 'requester' and not the 'current user' who logs the case - as I definitely don't want requesters to be able to approve their own HR Cases.
Thanks team!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 07:05 PM
Yes This is the BR which is restricting.
because here your checking if the approver is your current user that is requestor in this case it is aborting the action.
In activate this BR and your workflow should work fine,
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 07:10 PM
Yes that would work, but deactivating this completely will allow the requester to approve their own - which we don't want. We only want to avoid the 'opened_by' from approving their own - any ideas how we would update the code to do this?
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2018 07:20 PM
The best way would be to write a IF script before approval and check the opened-By==approver name and then you can do what ever the flow you needed
- answer = ifScript();
- function ifScript() {
- if (current.getValue('opened_by') == current.variables.<variable name here>{
- return 'yes'; // no approval
- }
- else{
- return 'no';
- }
- }
Harish