If I modify Master ID @ Row_Inserting()...

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
netenken1
User
Posts: 64

If I modify Master ID @ Row_Inserting()...

Post by netenken1 »

I have a Master-Detail table

If I modify Master Table Primary ID @ Row_Inserting() events ... like above..

  • Code ----------------------------------------------------------
    function Row_Inserting($rsold, &$rsnew) {

    $rsnew["id"]= CurrentUserName()."_".$rsnew["id"];

    return TRUE;
    }
    -----------------------------------------------------------------

will cus the "DETAIL Record" error while insert/update ...

--Error Message --------------------------------------------------------------------------------

The current user (19) is not authorized to insert the record. Master filter: id='00002'

becuz the detail will be filtered by the "old ID" , how could I manual change the filter ID value to avoid the error ??


Webmaster
User
Posts: 9438

Post by Webmaster »

You can consider update the key values in Row_Inserted server event to avoid the error.


netenken1
User
Posts: 64

Post by netenken1 »

so, you means the master-detail update behavior is "MASTER" table "inserted/updated" and then trigger "DETAIL" table events


Webmaster
User
Posts: 9438

Post by Webmaster »

No, just use the master table Row_Inserted/Row_Updated server event. Perform SQL updates to update all the key values in the master/detail tables.


Post Reply