Siebel开发编程——记录写第一段代码

1.在Applet子类型Control上新建记录(Name,HTML Type,Method Invoke);
2.从控件列表中选择定义的按钮控件将其拖动到界面;
3.在Applet子视图Applet User Prop新建记录,Name格式为:[CanInvokeMethod: Submit](注意:冒号后面又一个英文空格),Value为TRUE;
4.在Applet视图选择添加按钮的Applet[KIVI Order Form Applet],右键选择Edit Server Scripts,选择使用eScipt,在WebApplet-WebApplet_PreInvokeMethod中编写代码

function WebApplet_PreInvokeMethod (MethodName)
{
    if(MethodName == "Submit")
    {
        var bcOrder = this.BusComp();
        with(bcOrder)
        {
            this.BusComp().ActivateField("Order Number");
            if(FirstSelected())
            {
                var orderId = GetFiledValue("Order Number");//获取当前记录的订单ID
                var psIn = TheApplication().NewPropertySet();
                var psOut = TheApplication().NewPropertySet();
                psIn.SetProperty("OrderId",orderId);
                var bsOrder = TheApplication().GetService("KIVI Order Service");
                bsOrder.InvokeMethod("Submit",psIn,psOut);//调用刷新界面的BS
                psIn.Reset();
                psOut.Reset();
                psIn.SetProperty("Refresh All","Y");
                // TheApplication().GetService("FINS Teller UI Navigation").InvokeMethod();
            }
        }
        return (CancelOperation);
    }
    return (ContinueOperation);
}

5.在Business Service视图新建记录-SNTO Order Service,设置属性External Use为Y
6.在Business Service子视图Business Service Method新建记录
7.在Business Service Method子视图Business Service Method Arg新建记录
8.在Business Service视图选择新建的SNTO Order Service 右键选择Edit Server Script,在Service-Service_PreInvokeMethod中编写代码

function Service_PreInvokeMethod (MethodName,Inputs,Outputs)
{
    if(MethodName == "Submit")
    {
        var orderId=Inputs.GetProperty("OrderId");//BS中定义的Submit方法所定义的输入参数
        SubmitStatus(orderId);
        return (CancelOperation);
    }
    return (ContinueOperation);
}

9.在general declarations申明一个新的方法[SubmitStatus(orderId)]

function SubmitStatus(orderId)
{
    var BO_KIVI_Order = TheApplication().GetBusObject("KIVI Order");
    var BC_KIVI_Order = BO_KIVI_Order.GetBusComp("KIVI Order");
    var sSubmit = TheApplication().InvokeMethod("LookupValue","KIVI_ORDER_STATUS","Submitted");//
    with(BC_KIVI_Order)
    {
        ActivateField("Order Status");
        SetViewMode(AllView);
        ClearToQuery();
        SetSearchExpr("[Order Number]='"+orderId+"'");
        ExcuteQuery(ForwardOnly);
        if(FirstRecord())
        {
            SetFieldValue("Order Status",sSubmit);
            WriteRecord();
        }
    }
    BO_KIVI_Order = null;
    BC_KIVI_Order = null;
}

10.编译运行

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值