我想创建摘要框,例如销售订单摘要框。在那个框中,我必须显示这些字段。和下面的单个字段值的子列表。与销售订单记录相同。我们如何创建此设计?请帮忙!
字段1
场2
'<table align="left" bgcolor="#e0e6ef" style="width:20%;">'
'<tr>'
'<td>'
'<p style="text-align: left;">'+'field1'+'</p>'
'</td>'
'<td>'
'<p style="text-align: right;">'+value2+'</p>'
'</td>'
'</tr>'
'<tr>'
'<td>'
'<p style="text-align: left;">'+'field2'+'</p>'
'</td>'
'<td>'
'<p style="text-align: right;">'+value2+'</p>'
'</td>'
'</tr>'
您可以这样做以在 suitelet 中添加字段列表和子列表:-
var form = serverWidget.createForm({
title: 'SUMMARY'
});
var field1 = form.addField({
id : 'custpage_text',
type : serverWidget.FieldType.INLINEHTML,
label : ' '
});
//rename fields and values according to you.
var value1=1,value2=2, value3= 3, value4=4,value5=5, value6=6;
var myListField = '<!DOCTYPE html>';
myListField += '<html>'
myListField += '<head>'
myListField += '</head>'
myListField += '<body>'
myListField += '<p style="text-align: left;"><h4>field1 '+value1+'</h4></p></br>'
myListField += '<p style="text-align: left;"><h4>field2 '+value2+'</h4></p></br>'
myListField += '<p style="text-align: left;"><h4>field3 '+value3+'</h4></p></br>'
myListField += '<p style="text-align: left;"><h4>field4 '+value4+'</h4></p></br>'
myListField += '<p style="text-align: left;"><h4>field5 '+value5+'</h4></p></br>'
myListField += '<p style="text-align: left;"><h4>field6 '+value6+'</h4></p></br>'
myListField += '</body>'
myListField += '</body>'
myListField += '</html>'
field1.defaultValue=myListField;
// Creating sublist
var sublist = form.addSublist({
id: 'custpage_sublist',
type: serverWidget.SublistType.STATICLIST,
label: 'Manufacturing Work Order',
tab: 'subtab2id'
});
//sublist.addMarkAllButtons();
sublist.addField({
id: 'custpage_sublist1',
type: serverWidget.FieldType.CHECKBOX,
label: 'PRINT'
});
sublist.addField({
id: 'custpage_sublist8',
type: serverWidget.FieldType.INTEGER,
label: 'INTERNAL ID'
});
sublist.addField({
id: 'custpage_sublist2',
type: serverWidget.FieldType.TEXT,
label: 'WORK ORDER',
source: 'workorder'
});
sublist.addField({
id: 'custpage_sublist3',
type: serverWidget.FieldType.TEXT,
label: 'Assembly Item'
//source:'manufacturingrouting'
});
sublist.addField({
id: 'custpage_sublist4',
type: serverWidget.FieldType.DATE,
label: 'START DATE'
});
scriptContext.response.writePage(form);
根据您的需要设计页面大小
谢谢,