You are viewing limited content. For full access, please sign in.

Question

Question

Parallel Tasks - First person opens and approves ... all other forms get the first person's name

asked on September 28, 2017

I have a process that appeared to be working well when I was the only name in all the discipline fields. An Engineering Manager has the ability in Part 4 of the form to pick and choose:

1. the discipline team that needs to conduct a review and
2. an individual name from that team (they can also leave blank and it'll go to the team).

As you can see in the example below, I have chosen all the teams but also chose a specific individual on the Nuclear team:

All of that is working beautifully! From here, I have six different forms for each discipline. This is what "Drafting" will see:

This is the code written place my name in the field to show that I accepted the task:

$(document).ready(function(){
//Check for Blank Displayname and Username and Fill with Current User
  if($('.drafting input').val() == ''){
    $('.drafting input').val($('.displayname input').val());
    $('.draftingUsername input').val($('.username input').val());
  }

//capture timestamp
  $('.Approve').click(timestamp);
 
  function timestamp() {
    
    var d = new Date();
    
    var minutes = d.getMinutes();
    var hours = d.getHours();
        
    var fullYear = d.getFullYear();
    var day = d.getDate();  //returns day as 1-31
    var month = d.getMonth() + 1;  //getMonth returns month as 0-11
    var fullDate = month + "/" + day + "/" + fullYear;
    
    if (minutes < 10) {var minutes = "0" + minutes;}
        
    if (d.getHours() < 12) {var a = "AM";}
	else if (d.getHours() == 12) {var a = "PM";}
	else {var a = "PM"; hours = hours - 12;}

    if ($(this).hasClass('Approve')) {
       $('.draftingDateSigned input').attr("readonly", false);
       $('.draftingDateSigned input').val(fullDate + " " + hours + ":" + minutes + " " + a)
       $('.draftingDateSigned input').attr("readonly", true);
    }
  };

});  //close document.ready

So I did the same for all other disciplines. This review process runs in parallel:

Now that you have the background, here's the problem:

User 1 opens Drafting task ... reviews and approves. User 1's display name is in the Drafting section.

User 2 opens Structural task ... reviews and finds that User 1's display name is in the Structural section when it's supposed to be User 2's display name.

User 3 opens QAE task ... reviews and also finds that User 1's display name is in the QAE section when it's supposed to be User 3's display name.

How can that happen when I've coded each individual form for each discipline?

1 0

Answer

SELECTED ANSWER
replied on September 28, 2017

Hey,

I think the issue here is you are using the same variable across all forms to store the current users name.

I'm pretty sure this is what's causing the issue as variables are set within the scope of the instance, so if you set it in one form it will be set on all forms.

Because it has been set its therefor not using the default value of %(CurrentUser) and using its set value instead. To fix this just create a new variable on each of the forms for accessing the Current user data.

I hope this fixes the issue.

 

0 0
replied on September 29, 2017

That was it. I assumed that each person who opened each form would be the "current user". That's what I get for assuming! Now I know (the hard way) that once a field is filled in or changes, that data filters through any/all other active tasks.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.