Sample code for passing parameter to a widget. And code for fetching record in a look up field.

Sample code for passing parameter to a widget. And code for fetching record in a look up field.

Hi! Im trying to create a widget but I didnt know how I can pass paremeter?

There isnt much documentation avaialable?

If I have the widget in a page and this page has parameter. How can I pass it to the widget?

Also how can I get record from a look up field to the widget? What would be the right syntax?