0
我是新來的這個腳本代碼在雜技演員。我想創建一個動態的郵票,其中用戶輸入各種數據,例如公司名稱/帳號/批准/日期(生成今天的日期)/支付帳單(這將說「批准,N/A,)可填充字段的動態郵票
從在網上搜索,我發現了一些代碼在這裏和那裏,我想出了這個: 但到目前爲止我沒有運氣什麼我做錯了
var dialog = {
companyValue: "",
accountValue: "",
approvedValue: "",
payValue: "",
commit:function (dialog) { // called when OK pressed
var results = dialog.store();
this.companyValue = results["txt1"];
this.accountValue = results["txt2"];
this.approvedValue = results["txt3"];
this.payValue = results["txt4"];
},
description:
{
name: "Exhibit Information", // Dialog box title
elements:
[
{
type: "view",
elements:
[
{
name: "Company name: ",
type: "static_text",
},
{
item_id: "txt1",
type: "edit_text",
multiline: true,
width: 300,
height: 30
},
{
name: "Account Number: ",
type: "static_text",
},
{
item_id: "txt2",
type: "edit_text",
multiline: true,
width: 300,
height: 30
},
{
name: "Approved By: ",
type: "static_text",
},
{
item_id: "txt3",
type: "edit_text",
multiline: true,
width: 300,
height: 30
},
{
name: "Pay Bill: ",
type: "static_text",
},
{
item_id: "txt4",
type: "edit_text",
multiline: true,
width: 300,
height: 30
},
{
type: "ok_cancel",
ok_name: "Ok",
cancel_name: "Cancel"
},
]
},
]
}
};
if(event.source.forReal && (event.source.stampName == "#caseandnumblue"))
{
if ("ok" == app.execDialog(dialog))
{
var cMsg = dialog.companyValue;
event.value = "Company\n" + cMsg;
event.source.source.info.company = cMsg;
cMsg = "Account\n" + dialog.accountValue;
this.getField("AccountNumField").value = cMsg;
cMsg = "Approved\n" + dialog.approvedValue;
this.getField("ApproveByField").value = cMsg;
cMsg = "Pay\n" + dialog.payValue;
this.getField("PayBillField").value = cMsg;
}
}
謝謝,真的幫了我。我的下一個問題是如何將公司名稱更改爲下拉列表以供選擇,而不是將其輸入。現在,我厭倦了執行諸如'code' var oCompanyNameField = {「 - 」:None,「Bus&船「:巴士和船,」魔法巴士「:魔法巴士,」音樂水族「:音樂Aquatique,」城市公司「:城市公司,」2123632安大略有限公司「:2123632安大略有限公司,」2419017安大略有限公司「:2419017 Ontario Ltd }; dialog.load({txt1:oCompanyNameField});'code'我只是沒有這個運氣。 – user2933380