SOLVED Thanks Giuseppe
please help
i had wrote some script onBeforeInsert in form application, but every i run form app to add my script doesnt work
but while i put my script at onLoad that work
but i couldnt put that change at onLoad because this is uniqueID
thanks in advance
Jaisyullah
my script :
sc_field_readonly({address_domisili}, ‘on’);
sc_field_readonly({city_domisili}, ‘on’);
sc_field_readonly({kecamatan_domisili}, ‘on’);
sc_field_readonly({kelurahan_domisili}, ‘on’);
/**
- Selecting a field from another table
*/
// Check for record
$check_sql = “SELECT max(custCode)”
. " FROM tbcustomer";
sc_lookup(rs, $check_sql);
$id = {rs[0][0]}+‘1’;
if ($id < ‘10’){
{custCode} = “00000$id”;
}
elseif ($id < ‘100’){
{custCode} = “0000$id”;
}
elseif ($id < ‘1000’){
{custCode} = “000$id”;
}
elseif ($id < ‘10000’){
{custCode} = “00$id”;
}
elseif ($id < ‘100000’){
{custCode} = “0$id”;
}
elseif ($id < ‘1000000’){
{custCode} = “$id”;
}
Solution : on custCode’s field i just need to untick ‘required’ option in edit field menu
[B]thanks Giuseppe, you are rocking man
;)[/B]