webForm() does not appear in the debugger

exposed function testmessage()
	var myForm:4d.WebForm
	myForm=webForm
	myForm.setMessage("Records imported.")

myForm does not seem to get the webform object, so my code fails.

1 Like

Hello Mikey,

When you use the webForm command, it returns a 4D.WebForm object. However, this object is not a direct reference to the webform instance. Instead, it is a proxy object for interaction.

This means that if you examine myForm in the debugger, you won’t see typical object properties, yet it retains the functionality of the actual webForm object.

Concerning the issue you’re facing, with regards to displaying a toast notification on your web page, it’s possible that you may have overlooked enabling the provide feedback checkbox while binding the testmessage function to a specific event. Double-checking this setting might resolve your problem.

Best regards,

1 Like

I think what happened was that the toast 5 second timeout was hit while I was in the debugger, before I could switch back to the preview window.

@basmael By binding, do you mean invoke testmessage() in the context of a web form event function event?

That is, in the web form’s Contextual Panel, choose Add a Function Event.

You are correct, you bind class functions to events through the Contextual panel.