Insert a value into database :
$transition = array(
'sid' => $form_state['values']['new_transition_from'],
'target_sid' => $form_state['values']['new_transition_to'],
'roles' => $tabroles,
);
drupal_write_record('workflow_transitions', $transition);
Update a value into database :
$transition = array(
'sid' => $form_state['values']['new_transition_from'],
'target_sid' => $form_state['values']['new_transition_to'],
'roles' => $tabroles,
'tid' => $tid
);
drupal_write_record('workflow_transitions', $transition, 'tid');
In Update primary key is tid
No comments:
Post a Comment