PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Master Detail RAD problem
Master Detail RAD problem
Débuté par Gowrav, 30 juin 2008 12:17 - Aucune réponse
Posté le 30 juin 2008 - 12:17
Hi guys. I am new to win dev using 12 version.. I made a RAD form with master details linked table.. now every thing seems fine but the problem is, when I go for new record. it saves first the master record and then details can be feeded using updating facility. Now if I want to make some order form or Invoice Form. I want to save the master and details at the same time. what I should do .

I Think problem is the link since the new record of master is not added and does not have any ID it is giving error.

What I have done to overcome..

In Ok_BTN i changed the code like this
in case "create"
// transfer controls to file buffer
ScreenToFile(WIN_Form_and_Table_Order_Master_File_Order_Details_File,Order_Master_File)
// Add the record
HAdd(Order_Master_File)


IF ErrorOccurred THEN
Info("Unable to add record"+CR+HErrorInfo())
RETURN
END

HExecuteQuery(OrderMasterIDUpdateInDetails,hQueryDefault,Order_Master_File.Order_Master_FileID)


where OrderMasterIDUpdateInDetails Query sets the new ID to Details Table where Master ID is 0...

But if i am using it on multi user plateform and five users added the orders at same time then it may get logical error on this query as all five orders will get under any one master ID since all new five order details have Master ID to 0.


Any simple solutions..

Thank You