Help with Passing Arguments

Hello,
I am trying to pass the following arguments to a method on a different form but am having trouble.

forms.planning_line_items.sellInventory(ajustment_calc,productsid,(inventory_to_inventory_ajustments.inventory_ajustmentsid));
var stockOUT = arguments[0]
var inventID = arguments[1]
var ajustID = arguments[2]
controller.newRecord()
inventory_commited = stockOUT
inventoryid = inventID
inventory_ajustmentsid = ajustID
controller.saveData()

I seem to be able to populate var stockout, and var inventID no problems, but the ajustID does not work. Is it possible to pass arguments through a relationship??

Thanks in Advance

The answer is yes, you can. But the way you do it you are passing the argument without checking that it really exists. Does it exist is the question?

Dit you check it with databaseManager.hasRecords(…) ?

Dit you check it with databaseManager.hasRecords(...) ?

Hi I am unsure how to do this ? could you help Please?

You can check the sample data attached to the databaseManager and, obviously, the documentation.

Hi,
I just found the sample code, and updated my code to

//Returns true if the (related)foundset exists and has records
if (databaseManager.hasRecords(inventory_to_inventory_ajustments))
{
	forms.planning_line_items.sellInventory(ajustment_calc,productsid,inventory_to_inventory_ajustments.inventory_ajustmentsid);
}

checked it with the debugger, and the method stopped, So can I assume from that there is record to be found, or is my code incorrect??,
Many Thanks