Insert to other Table on Submit

ican
Tera Contributor

Use Case:

I have a custom table(u_vendor). In the Form it has Type and Name which is mandatory.

Type is a Choice Field: Vendor or Merchant

 

I want to save all records having type "Vendor" in the u_vendor table and all records having type "Merchant" in the custom table(u_merchant) onSubmit.

 

I did achieve saving all the type merchant in the merchant table but it will also be saved in the vendor table.

 

How to achieve this? 

8 REPLIES 8

SunilKumar_P
Giga Sage

Hi @ican How this form is submitted? is it a catalog form? or just a table form?

 

Regards,

Sunil

just a table form

Mark Manders
Mega Patron

How are your tables configured? If merchant is an extension from vendor, you may have created the issue yourself. Compare it with the cmdb_ci-tables. Any ci created in table cmdb_ci_computer, are also in cmdb_ci_hardware and can even be found under cmdb_ci. 
And Sunil is correct in his question: what kind of form are you using for it? Is it a record producer? Because if you are in the backend creating a merchant on the merchant table with type = vendor, it all depends on your script how it works.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

both tables did not extend from any table.