Is it possible that the Object Script use data from HTML components? Similar to: x["amount"] = Request.Params.Get("amount");
On client side you can use any HTML components, including form controls. For instance:
document.theForm.myFiewld.value
From the documentation, Object script is used in the server-side, mostly with Object Script trigger.
So, the question is, how can I pass the data from my HTML component (which is in client side) to my Object Script command which is in server side?
Through object fields. If you don't want fields to be actually displayed, try to use Hidden Fields. Than you could use something like this:
x["amount"] = parseFloat("{!hidden_amount}");
I thought so...
If I am in Update page of Object A and would need to create Object B from there, I would have to create all of Object B's fields in Object A and then create Object B record through Object Script API. It seems redundant - fields of Object B are also in Object A.
Anyhow, seems that it's the only way. thanks anyways.
I didn't say that. Just populate a JavaScript array and supply it to createRecord() API.
However you need fields in order to extract info from HTML form and process it on server side. Without fields (of object A in your example) the server will have no idea about your data from custom HTML form.