简体   繁体   English

如何在 Dynamics ax 4.0 中停止允许重复

[英]How to Stop allowing Duplicates in Dynamics ax 4.0

When we recieve orders from web it creates a sales id and stores it.当我们从网络收到订单时,它会创建一个销售 ID 并存储它。 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.我保留了索引为 weborder 号码允许重复:否。 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.从 Web 发送一个唯一标识符(如 GUID),将其保存在 SalesTable 中并在插入时检查它是否已存在 - 或为该字段创建唯一索引,但您可能会记录这些尝试的重复项,并且在插入或验证写入。

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.为此,您需要使用 js。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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