Dynamic Stamp - One Value Undefined
Hello.
I am new to javascript. I have VBA experience in the past.
I have the following code in my dynamic stamp. The problem is with this results of this line. It returns undefined.
this.getField("ShopN").value = DiaBox.ShopN;
Wanted to know if someone could spot my error or point me in the right direction.
var DiaBox =
{
result:"cancel",
DoDialog: function(){return app.execDialog(this);},
cbx1:false,
cbx2:false,
cbx3:false,
cbx4:false,
LText:"",
ShopN:"",
RText:"",
initialize: function(dialog)
{
var dlgInit =
{
"Opt1": this.cbx1,
"Opt2": this.cbx2,
"Opt3": this.cbx3,
"Opt4": this.cbx4,
"lNum": this.LText,
"sdNum": this.ShopN,
"lRvw": this.RText,
};
dialog.load(dlgInit);
},
commit: function(dialog)
{
var oRslt = dialog.store();
this.cbx1 = oRslt["Opt1"];
this.cbx2 = oRslt["Opt2"];
this.cbx3 = oRslt["Opt3"];
this.cbx4 = oRslt["Opt4"];
this.LText = oRslt["lNum"];
this.ShopN = oRslt["sdNum"];
this.RText = oRslt["lRvw"];
},
description:
{
name: "Submittal Stamp",
elements:
[
{
type: "view",
char_height: 10,
elements:
[
{
type: "static_text",
item_id: "stat",
name: "Please select the review category:",
//width: 152,
//height: 23,
//char_width: 15,
alignment: "align_fill",
//font: "dialog",
},
{
type: "radio",
item_id: "Opt1",
group_id: "rado",
name: "Approved-No Exceptions Taken",
},
{
type: "radio",
item_id: "Opt2",
group_id: "rado",
name: "Approved as commented - No Resubmission",
},
{
type: "radio",
item_id: "Opt3",
group_id: "rado",
name: "Approved as commented - Resubmit",
},
{
type: "radio",
item_id: "Opt4",
group_id: "rado",
name: "Rejected-Comply With Comments",
},
{
type: "static_text",
item_id: "statl",
name: "Job Number:",
//width: 25,
//height: 15,
//char_width: 15,
alignment: "align_left",
//font: "dialog",
},
{
type: "edit_text",
item_id: "lNum",
height: 20,
char_width: 10,
char_height: 10,
alignment: "align_left",
name: "Proj. Number",
},
{
type: "static_text",
item_id: "statsd",
name: "Shop Drawing Number:",
width: 25,
height: 15,
char_width: 15,
alignment: "align_left",
font: "dialog",
},
{
type: "edit_text",
item_id: "sdNum",
height: 20,
char_width: 10,
char_height: 10,
alignment: "align_left",
name: "Shop Dwg Number",
},
{
type: "static_text",
item_id: "statr",
name: "Reviewer:",
width: 50,
height: 15,
char_width: 15,
alignment: "align_left",
font: "dialog",
},
{
type: "edit_text",
item_id: "lRvw",
height: 20,
char_width: 10,
char_height: 10,
alignment: "align_left",
name: "Reviewer",
},
{
type: "ok_cancel",
},
]
},
]
},
};
if(event.source.forReal && (event.source.stampName == "#qeSrVnbmgzmy5-DHsVTkLD"))
{
if ("ok" == app.execDialog(DiaBox))
{
this.getField("cbx1").checkThisBox(0, DiaBox.cbx1);
this.getField("cbx2").checkThisBox(0, DiaBox.cbx2);
this.getField("cbx3").checkThisBox(0, DiaBox.cbx3);
this.getField("cbx4").checkThisBox(0, DiaBox.cbx4);
this.getField("LText").value = DiaBox.LText;
this.getField("ShopN").value = DiaBox.ShopN;
this.getField("RText").value = DiaBox.RText
this.getField("Date").value = util.printd("mm/dd/yyyy", new Date ());
}
}
