Tuesday, May 14, 2019

Sublist Added during BeforeLoad is Displayed as Loading...

Sublists can be created during the beforeLoad user event and added to the form. Under circumstances it might happen that the sublist displays "Loading..." instead of the sublist content. This article describes the scenario, when this is caused by adding a field of type radio to a sublist, which is not of type list.

nlobjSubList.addField() with the type parameter specified as radio is only supported for sublists of type list. More information about this method can be found in SuiteAnswers  article 10276 (nlobjSubList).

The following beforeLoad function is an example of the scenario described above. The sublist will be displayed as "Loading...".

		function userEventBeforeTaskLoad(type, form, request)		{		//Create a tab.		var testTab = form.addTab('custpage_test_tab', 'Test Tab');		//Add a sublist to the tab.		var testSublist = form.addSubList('custpage_test_sublist', 'inlineeditor', 'Test Sublist','custpage_test_tab');		//Add fields to the sublist.		testSublist.addField('custpage_radio', 'radio', 'Radio Field');		testSublist.addField('custpage_text', 'text', 'Text Field');		testSublist.addField('custpage_select', 'select', 'Select Field');		}		

If the type of the sublist is changed to list the sublist will be displayed correctly:

		var testSublist = form.addSubList('custpage_test_sublist', 'list', 'Test Sublist','custpage_test_tab');		

Alternatively, the sublist can be of a different type than list, but the field of type radio needs to be removed.

No comments:

Post a Comment