I have built a custom module named 'ABC'. I have created a content type 'CT' having some text fields. When a user add content of type 'CT' and Save/Preview the form, I want to use the values that the user added in the form and make a web service call and update the form values based on the data returned from the web service call which would further be saved to database.
I am using hook_node_submit()
as below.
function CT_node_submit($node, $form, &$form_state) {
global $user;
//dpm($user);
$nameofuser = $user->name;
$timezone = $user->timezone;
$title = $form['field_title']['#value'];
$pid = $user->uid;
$pname = $user->name;
$rurl = $form['field_recording_url']['#value'];
$purl = $form['field_presenter_url']['#value'];
$kdetails = array (
'nameofuser' => $nameofuser,
'title' => $title,
'pid' => $pid,
'pname' => $pname,
);
Make_A_WebService_Call($kdetails, $form, $form_state);
}
The problem is that when I am calling the above code from ABC.module file, the code is not being called on clicking the Save/Preview button.