zoukankan      html  css  js  c++  java
  • Siebel script for Pre Events

    Pre events should only be used for data validation, not manipulation.

    such as PreSetFieldValue, PreDeleteRecord and PreWriteRecord

    function BusComp_PreWriteRecord () 
    {. . . . . .
    var cost = GetFieldValue("Cost Price");
    var price = GetFieldValue("Price");
    var costNum = ToNumber(cost);
    var priceNum = ToNumber(price);
    if(priceNum < costNum)  
    {
        throw "Price should more than cost price!";  
    }
    WriteRecord();
    . . . . }

    Consequence

    The reason for this is that the pre event occurs before the Siebel application runs field level validations and other processes in the C++ class underlying the object that might fail.  If these processes fail the pre event is exited, but any changes to other objects are not rolled back.

    Recommendation

    The companion event such as SetFieldValue, WriteRecord and DeleteRecord occurs after the internal and field level validations have succeeded.  In the case of SetFieldValue, remember that the user can still undo the record so the WriteRecord event is the best place to put script that should only execute once a record is committed.

  • 相关阅读:
    学习资料
    InstallShield常用工具
    InstallShield中调用API
    系统目录
    abort和exit
    Uninstall Registry Key
    GDI+资料
    VBScript是什么?有什么优缺点?
    DrawImage调查
    KEIL MDK环境下uCOSII在LPC17xx上的移植实例 Chung
  • 原文地址:https://www.cnblogs.com/Flamo/p/3977724.html
Copyright © 2011-2022 走看看