LookupWindow _params.data dataprovider

How to show a LookupWindow in “newCommit” mode and get the _params.data from the forms dataprovider that showed in the LookupWindow? The following code from the framework documentation fills: _params.data = [“test garbage”]; at opening the LookupWindow, but it is desired to get the value from the fields that are entered in the LookupWindow by the user.

function addCategory(event) {
// Using  to create a  record, and passing an array of fields and data  the  child " " new new for new that will be created
var _params = new Object();
_params.mode =  "newCommit"; // either "newCommit
_params.fields = ["categoryname"];
_params.data = ["test garbage"];
globals.svy_nav_show(event, null, "categories", null, null, _params);
}

This is how I’m using it:

	var _params = new Object();
	_params.mode = "newCommit";
	_params.fields = ["occupant_objectid"]
	_params.data = [object_id]
	scopes.svyLookupWindows.showLookupWindow(event,"occupant_id","Occupant",null,null,_params)

The field occupant_objectid (in the lookup window) is set with the value from object_id from my source file. And the result of the lookup is returned into the field occupant_id.

jdbruijn:
… is set with the value from object_id from my source file.

What is the object_id?

that is a data provider on my form. So I pass the value from object_id in my source form to the dataprovider “occupant_objectid” in my lookup window.

jdbruijn:
The field occupant_objectid (in the lookup window) is set with the value from object_id from my source file.

What is your “source file”? Is that the form that calls another form in a lookup window? I don’t need set a value in the lookup window from the calling form.

jdbruijn:
that is a data provider on my form. So I pass the value from object_id in my source form to the dataprovider “occupant_objectid” in my lookup window.

The dataprovider of your calling form or of the lookup window form?

my source form is the form from which i’m calling the lookup window.
If you don’t need to set values than you can pass:

   _params.fields = []
   _params.data = []