• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

type: "check_box" Return value undefined

New Here ,
Jun 28, 2023 Jun 28, 2023

Copy link to clipboard

Copied

Hi,

 

I coded a Javacript window with different items that fill in elements of form that is used as a stamp. Textboxes and radio buttons are working fine, however I'm struggling with retrieving the Check box informatio: Console says undefined. Here is the relevant piece of code:

// Dialog Definition 
var oDlg = 
	{
	strchkPaid: "False",
	
	initialize: function(dialog) 
		{ 
	    dialog.load
			(
			{
			"chkPaid":this.strchkPaid,
			}
			); 
		},
        commit: function(dialog) 
		{ 
            var data = dialog.store();
			this.strchkPaid= data["chkPaid"];
		},
        description:
		{ 
			name: "Refacturation",
			elements: 
			[
				{ 
				type: "view",
				elements: [
					{
						item_id: "chkPaid",
						name: "Payé par carte de crédit",
						type: "check_box",
					},	
				] 
				},
			] 
		}
};

// Dialog Activation 
app.execDialog(oDlg)
if((event.source.forReal)&&(event.source.stampName == "#EtampeTI"))
{
if(oDlg.strchkPaid){this.getField("chkBoxPaid").value = "Yes";}else{this.getField("chkBoxPaid").value = "No";}
}

oDlg.strchkPaid seems to return undefined.

 

Any ideas?

 

Thanks in advance.

 

TOPICS
Windows

Views

90

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 28, 2023 Jun 28, 2023

Copy link to clipboard

Copied

Found it while posting. Thanks to Karl Heinz Kremer : Item Ids can only have four letters, the corresponding ID for this field is "sdNum" - and therefore five characters long.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 28, 2023 Jun 28, 2023

Copy link to clipboard

Copied

LATEST
Also, the value of the field is a boolean, not a string.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines