首页 > 代码库 > Siebel 数学运算

Siebel 数学运算

应用场景:额度冲减

siebel中实现先占用后清除功能,需要清除前一次写入的值。

if(quotaId != ""){    with(bcQuota){        SetViewMode(AllView);        ActivateField("Id");        ActivateField("Available Amount");        ActivateField("Occupation Amount");        ClearToQuery();        searchExpr = "[Id] = ‘" + quotaId + "‘";        SetSearchExpr(searchExpr);        ExecuteQuery(ForwardOnly);        if(FirstRecord())        {            availAmount = ToNumber(GetFieldValue("Available Amount"));            occupAmount = ToNumber(GetFieldValue("Occupation Amount"));            //availAmount = availAmount + Math.abs(sumCSP-sumNRC);            var minResult = Math.abs(sumCSP-sumNRC);            if((occupAmount-minResult)< 0.0000001){                //TheApplication().RaiseErrorText(occupAmount +"------" +minResult);                occupAmount = 0;            }else{                occupAmount = occupAmount-minResult;            }            //SetFieldValue("Available Amount",availAmount);            SetFieldValue("Occupation Amount",occupAmount);            WriteRecord();        }//end if    }//end with}

 

Siebel 数学运算