Sawan,
see my answers below:
- master key is stored in the $_SESSION["DetailTableName_masterkey1"] variable where DetailTableName is your actual table name.
- no. If you use auto-increment field ID of added record is availale in the After record added event only:
$id = mysql_insert_id();
If you don't use auto-increment field you can enter ID on the add page directly. In this case this value is available in the Before record added event:
$id = $values["FieldName"];