xml OA:演示解决方案 - OpenAir项目风险指标

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了xml OA:演示解决方案 - OpenAir项目风险指标相关的知识,希望对你有一定的参考价值。

<platform_solution><objects><form_script><parameters></parameters><name>setProjectRiskInformation.js</name><association>project_edit_form</association><event>after_save</event><libraries></libraries><comments></comments><code><![CDATA[/**
 * Copyright NetSuite, Inc. 2014 All rights reserved.
 * The following code is a demo prototype. Due to time constraints of a demo,
 * the code may contain bugs, may not accurately reflect user requirements
 * and may not be the best approach. Actual implementation should not reuse
 * this code without due verification.
 *
 * Set the risk profile of a project using a custom field.
 *
 * Version    Date            Author           Remarks
 * 1.00       24 Jul 2014     Ryan Morrissey
 *
 */

function setProjectRiskInformation(type) {
    try {
        var FLD_RISK = 'prj_overall_risk__c',
            FLD_RISK_ID = 'prj_overall_risk_value__c',
            FLD_RISK_COLOR = 'prj_overall_risk_color__c';

        var recProj = NSOA.form.getNewRecord();

        if (!recProj || !recProj[FLD_RISK]) {
            return;
        }

        var risk_colors = {
            /*
             * For information on colors and palattes, visit
             * the confluence page for Team OpenAir
             * https://confluence.corp.netsuite.com/display/TeamOA/UI+Graphic+Rules
             */
            '5': '#bf340f',  // dark red
            '4': '#f89406',  // orange
            '3': '#ffee5a',  // yellow
            '2': '#0099cc',  // dark blue
            '1': '#afc437'   // green
        };

        var risk_array = recProj[FLD_RISK].split('-'),
            risk_id = risk_array[0],
            risk_str = risk_array[1];

        var color_tag = '<div style="height:15px;width:15px;display:block;margin:0 auto;' +
            'border-radius:15px;-moz-border-radius:15px;-webkit-border-radius:15px;' +
            'background-color:' + risk_colors[risk_id] + ';border:1px solid ' + risk_colors[risk_id] +
            ';"></div>';

        var objProj = new NSOA.record.oaProject();
        objProj.id = recProj.id;
        objProj[FLD_RISK_ID] = risk_id;
        objProj[FLD_RISK_COLOR] = color_tag;

        NSOA.wsapi.disableFilterSet(true);
        var results = NSOA.wsapi.modify([{name: 'update_custom', value: '1'}], [objProj]);

    } catch(e) {
        NSOA.meta.log('error', 'Try/catch error: ' + e);
    }
}]]></code><entrance_function>setProjectRiskInformation</entrance_function></form_script></objects><version>1.0</version><title>NetSuite: Project Risk Indicator</title><description></description></platform_solution>

以上是关于xml OA:演示解决方案 - OpenAir项目风险指标的主要内容,如果未能解决你的问题,请参考以下文章

python OA:将OpenAir WSDL解析为JSON

使用“openair”包绘制风玫瑰图时增加字体大小?

OA系统无法打开PDF文件,设置加载项发现Office Document Cache Handler无法启用,怎么设置?

用友OA 办公软件 显示“XML解析器无法加载,请安装微软的XML解析包

R:使用来自openair包的windRose的多个windrose图

xml OA:CIOCoE示例API调用