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

Question

Question

po number regenerating when saved

asked on August 22, 2017

I have a form with javascript that auto generates a PO number based on date, time and initiator's initials which works, however, when the initiator saves the form and then goes back in to edit the form another PO number is generated on top of the original one. Is there a way to prevent the PO field from generating a PO number every time it is saved and reopened?

Screen Shot 2017-08-22 at 11.14.54 AM.png
Screen Shot 2017-08-22 at 11.15.26 AM.png
0 0

Answer

SELECTED ANSWER
replied on August 22, 2017

Jennifer is correct. The problem you're encountering is that your process is triggered anytime the form loads, not just the first time.

To address this, try the following

$(document).ready(function(){
    if($('.qte div input').val() == ''){
          //YOUR CODE HERE
    }
});
1 0

Replies

replied on August 22, 2017

I am not familiar enough with scripting to write out an example but would it stay the same if you add in a if/else statement where if field is not null then create the value else don't create value?

1 0
SELECTED ANSWER
replied on August 22, 2017

Jennifer is correct. The problem you're encountering is that your process is triggered anytime the form loads, not just the first time.

To address this, try the following

$(document).ready(function(){
    if($('.qte div input').val() == ''){
          //YOUR CODE HERE
    }
});
1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.