Hello Team,
i have two table namely product table and category table, and my controller is not able to pass the categoryId into the product table.



Hello Team,
i have two table namely product table and category table, and my controller is not able to pass the categoryId into the product table.



Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Oct 1, 2024, 6:16 AM EDT
Hi,
Check what value you are getting inside the data variable.
var data - JSON.stringify({ productModel: productModel });If you are getting a null value after productModel.tblCategory after the stringify, then try to initialize the object before assigning the category value into the tblCategory object. like the following way.
productModel.tblCategory = new Object(), productModel.tblCategory = category,Emmmanuel FIADUFERank #947 · 2.2K reputationPosted Oct 1, 2024, 6:39 AM EDT
Thank you Rajeesh