ver=719483763">'+lookupData[0].name+'';
}
innerHtml='100%;table-layout:
fixed;"id="'+fieldName+'_lookupTable"class="ms-crm-Lookup"cellSpacing="0"cellPadding="0"lookupid="'+fieldName+'">
1px;padding-left:
1px;"vAlign="top">100%;text-align:
left;float:
left;overflow-x:
hidden;">'+renderValue+'合同产品编号2px0px1px;height:
100%;border-right-color:
currentColor;border-right-width:
0px;border-right-style:
none;display:
none;"id="'+fieldName+'_ledit"class="ms-crm-Hidden-NoBehavior"disabled=""tabIndex="1030"maxLength="1000"type="text"ime-mode="auto">21px;"class="Lookup_RenderButton_td">default;"id="'+fieldName+'"class="'+(disabled?
'ms-crm-ImageStrip-btn_dis_lookup':
'ms-crm-ImageStrip-btn_off_lookup')+'ms-crm-Lookup"title=""alt=""src="/_imgs/imagestrips/transparent_spacer.gif"attrPriv="7"attrName="'+fieldName+'"req="2"defaultViewId="{ABF9E11D-08A5-4F4D-966B-7335A924E9C7}"savedquerytype=""isDisplayOnly="false"resolveemailaddress="0"showproperty="1"disableViewPicker="0"disableQuickFind="0"disableMru="0"allowFilterOff="0"autoresolve="1"defaulttype="1089"lookupstyle="single"lookupbrowse="0"lookuptypeIcons="/_imgs/ico_16_1089.gif?
ver=719483763"lookuptypenames="'+otn+':
'+otc+':
'+otnDisplay+'"crmattributeid="{a9498a10-846c-4676-bb9f-e061688d5954}"lookuptypes="'+otc+'"lookupdisabled="false"ForceSubmit="false">
';
x.innerHTML=innerHtml;
}
functionNew_Hetddcp_Click(){
///
///合同订单改变时加载相应的合同订单产品
///
varfieldName="new_templookup2";
//if(crmForm.all.new_salesorderid.DataValue==null)
if(fv("new_salesorderid")==null){
alert('请先选择合同定单');
}
else{
if(location.href.toLowerCase().indexOf(ORG_UNIQUE_NAME+".")>0){
varurl='http:
//'+document.location.host+'/ISV/SingleLookup.aspx?
entity=salesorder&guid='+fv("new_salesorderid")[0].id+'&userid='+Xrm.Page.context.getUserId();
varrv=openStdDlg(url,"",880,700,false);
setSingleLookupValue(fieldName,"new_salesorderdetailid","new_salesorderdetailname",rv,New_Hetddcp_Click);
}
else{
varurl='/ISV/SingleLookup.aspx?
entity=salesorder&guid='+fv("new_salesorderid")[0].id+'&userid='+Xrm.Page.context.getUserId();
varrv=openStdDlg(url,"",880,700,false);
setSingleLookupValue(fieldName,"new_salesorderdetailid","new_salesorderdetailname",rv,New_Hetddcp_Click);
}
}
}
functionNew_QuoteDetail_Click(){
///
///报价单改变时加载相应的报价单产品
///
debugger;
varfieldName="new_templookup1";
//if(crmForm.all.new_quoteid.DataValue==null)
if(fv("new_quoteid")==null){
alert('请先选择报价单');
}
else{
if(location.href.toLowerCase().indexOf(ORG_UNIQUE_NAME+".")>0){
varsUrl='http:
//'+document.location.host+'/ISV/SingleLookup.aspx?
entity=quote&guid='+fv("new_quoteid")[0].id+'&userid='+Xrm.Page.context.getUserId();
varrv=openStdDlg(sUrl,"",880,700,false);
setSingleLookupValue(fieldName,"new_quotedetailid","new_quotedetailname",rv,New_QuoteDetail_Click);
}
else{
varsUrl='/ISV/SingleLookup.aspx?
entity=quote&guid='+fv("new_quoteid")[0].id+'&userid='+Xrm.Page.context.getUserId();
varrv=openStdDlg(sUrl,"",880,700,false);
setSingleLookupValue(fieldName,"new_quotedetailid","new_quotedetailname",rv,New_QuoteDetail_Click);
}
}
}
functionIFRAME_detail_onload(){
}
functionReadSalesOrderDetailLookupData(){
///
///非新建页面加载时将合同订单产品加载上
///
if(IsNull(fv("new_salesorderdetailid")))
returnnull;
varlookupData=newArray();
varlookupItem=newObject();
lookupItem.id=fv("new_salesorderdetailid");
lookupItem.typename='salesorderdetail';
lookupItem.name=fv("new_salesorderdetailname");
lookupData[0]=lookupItem;
returnlookupData;
}
functionReadQuoteDetailLookupData(){
///
///非新建页面加载时将报价单产品加载上
///
if(IsNull(fv("new_quotedetailid")))
returnnull;
varlookupData=newArray();
varlookupItem=newObject();
lookupItem.id=fv("new_quotedetailid");
lookupItem.typename='quotedetail';
lookupItem.name=fv("new_quotedetailname");
lookupData[0]=lookupItem;
returnlookupData;
}
functionForm_onload(){
///
///根据报价单或合同订单,加载对应的产品信息
///
//debugger;
//设置报价单产品和id,合同订单产品和id不可见
fc("new_quotedetailid").setVisible(false);
fc("new_quotedetailname").setVisible(false);
//fc("new_salesorderdetailid").setVisible(false);
//fc("new_salesorderdetailname").setVisible(false);
if(fv("new_quoteid")!
=null){
//crmForm.all.new_salesorderid.Disabled=true;
//crmForm.all.new_templookup2.Disabled=true;
fc("new_salesorderid").setDisabled(true);
fc("new_templookup2").setDisabled(true);
}
if(fv("new_salesorderid")!
=null){
//crmForm.all.new_quoteid.Disabled=true;
//crmForm.all.new_templookup1.Disabled=true;
fc("new_quoteid").setDisabled=true;
fc("new_templookup1").setDisabled=true;
}
//只读或作废状态下不可编辑
if(Xrm.Page.ui.getFormType()==3||Xrm.Page.ui.getFormType()==4){
simulateSalesOrderDetail("new_templookup2",ReadSalesOrderDetailLookupData(),true);
simulateQuoteDetail("new_templookup1",ReadQuoteDetailLookupData(),true);
}else{
simulateSalesOrderDetail("new_templookup2",ReadSalesOrderDetailLookupData(),false);
simulateQuoteDetail("new_templookup1",ReadQuoteDetailLookupData(),false);
}
document.getElementById("new_templookup1").onclick=New_QuoteDetail_Click;//
document.getElementById("new_templookup2").onclick=New_Hetddcp_Click;
//新建状态下隐藏随机附件明细
if(Xrm.Page.ui.getFormType()=='1'||Xrm.Page.ui.getFormType()=='6'){
//crmForm.all.IFRAME_detail.style.display='none';
fc("test").setVisible(false);
}
}
functionForm_onsave(){
///