Raas
Raas

Reputation: 261

How to Stop allowing Duplicates in Dynamics ax 4.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?

Upvotes: 0

Views: 199

Answers (2)

mrsalonen
mrsalonen

Reputation: 371

(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.

Upvotes: 0

Yury
Yury

Reputation: 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;
}

Upvotes: -1

Related Questions