0

When we recieve orders from web it creates a sales id and stores it. But if i recieve order from web at same time in two instances, it creates two sales orders for the same web order. So how can i stop it? I kept as Index for weborder number Allow Duplicates:No. But still it doesnt work. Any Suggestions?

Raas
  • 261
  • 8
  • 25
  • 3
    Send a unique identifier like a GUID from the web, save it in SalesTable and in insert check if it already exists - or make a unique index for the field, but you might log these attempted duplicates and it's easier to code it yourself in insert or validateWrite.. – mrsalonen Dec 23 '15 at 08:16
  • Consider making it an answer. – Jan B. Kjeldsen Jan 04 '16 at 08:54
  • Thanks for the answer. – Raas Mar 05 '16 at 20:33

2 Answers2

0

(Added as a answer bit late, 'cause I'm slow that way :))

Send a unique identifier like a GUID from the web, save it in SalesTable and in insert check if it already exists - or make a unique index for the field, but you might log these attempted duplicates and it's easier to code it yourself in insert or validateWrite.

mrsalonen
  • 343
  • 2
  • 15
-1

This is because the user presses submit button several times. You need to track the number of clicks on the button. For this you need to use js.

var submit = 0;
function checkIsRepeat(){
    var isValid = Page_ClientValidate();
    if(isValid) {
    if(++ submit > 1){
        alert('Yours message here');
        return false;
    }
}
return isValid;
}
Yury
  • 1
  • 2