简体   繁体   中英

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM