Update record from another form to subform Zoho Creator

Update record from another form to subform Zoho Creator

Hi. 

- I have a form name maintain
- And a subform (in another form: car_maintain) name car_maintain.set_up_maintain

I want to update every new record in form maintain to subform car_maintain.set_up_maintain if maintain.car = car_maintain.car AND maintain.typecar_maintain.set_up_maintain.type and insert every new record if main_tain.type != car_maintain.set_up_maintain.type.

So can you show me the script, please.

NOTE: type is a lookup field, so after type will be type.something

Thank you.