top of page

Moji5 Knowledgebase

Implement AJAX Method (AJAXCascadingDropdown & AJAXDisplayValue) in Inline Subform

From the previous article, we have learned how to use AJAX in our application. In this article, we going implement the AJAX method in our inline subform.


How to Implement AJAX Method (AJAXCascadingDropdown & AJAXDisplayValue) in Inline Subform


PART 1: Implement AJAXCascadingDropdown.


Create a master table. Name it as 'alan_master'.


Create a detail table. Name it as 'alan_detail'.


Create another form as per below image. You can refer article 'How to create in row table editing' (https://www.workmoji.com/post/in-row-table-editing) to create in row table editing.


In 'mytableinline', click Edit Detail Form.


Click Advanced settings in mydropdown.


Click New attribute.


Write the code below. You may refer to description at the right page for more example.

Click Save changes.


Go to your application home. Click Edit.


Click AJAX Libraries.

Click “Create a new AJAX Library”.

Insert the AJAX name and click the view code.

Write your code here, you can refer to notes for reference. Click Check Syntax, if no error then click Save and close.


Example the code:

dim strSQL as string="SELECT [detail] AS Caption,id AS Value from QF_alan_detail WHERE [master]='[$1]'" 
dim dsData as dataset =scribe.RunDynamicSQLReturn(strSQL)

return scribe.RunDatasetReturnJSON(dsData)

Now you have done the AJAX. Let try insert some information. Run your application. In your 'alan_master' form, fill all information as per below image.


Meanwhile, in your 'alan_detail' form, fill all information as per below image.


Let try the dropdown in your main form.



PART 2: Implement AJAXDisplayValue.


In 'mytablepopup', click Edit Detail Form.


Click Advanced settings in master dropdown.


Click New attribute.


Write the code below. You may refer to description at the right page for more example.


Click Save changes.


Go to your application home. Click Edit.


Click AJAX Libraries.

Click “Create a new AJAX Library”.

Insert the AJAX name and click the Define by code.


Write your code here. Click Check Syntax, if no error then click Save and close.


Example the code:

dim strSQL as string="SELECT masterdescription AS Caption from QF_alan_master WHERE [Master]='[$1]'" 
dim dsData as dataset =scribe.RunDynamicSQLReturn(strSQL)
Console.Write(strSQL)
Dim desc as string = ""
if dsData is nothing=false then
        if dsData.Tables(0).Rows.Count>0 then
            Dim _rowSC_GUID as datarow = dsData.Tables(0).Rows(0)
            desc = scribe.GetText(_rowSC_GUID("Caption"))
        end if
end if

Return desc

Click Create now.

Now you have done the AJAXDisplayValue. Run your application.


Click Add New.


Let try select the master field and it will display the respective detail info.






bottom of page