before_update code

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

before_update code

Post by grimblefritz » 2015-12-23 23:11

I've looked through the forums, faqs, etc, and I thought I had this right. I guess not.

Code: Select all

  function job_before_update(&$data, $memberInfo, &$args){
    $data['next_date'] = calc_next_date($data['service_date']);
    return TRUE;
  }

  function calc_next_date($service_date){
    return '1/1/2001';
  }
There are indeed fields in the job table named service_date and next_date.

When I edit a record, instead of getting 1/1/2001 in next_date, it remains blank.

What am I missing?

Once I see this basic hook work, I will be coding a proper calc_next_date(), of course.

Thanks!

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: before_update code

Post by grimblefritz » 2015-12-24 11:45

I got this sorted. It seems the date must be in Y-m-d (2001-01-01) format.

Post Reply