This topic is locked

Add date

4/19/2007 6:38:19 PM
PHPRunner General questions
A
andja author

Hi

Could someone help me with this?
I have three fields.
I would like to add 14 days from order date now() to delivery date if a

requirement not is fulfilled
OrderDate= now()

Requirement = Yes or No

DeliveryDate = now if Requirement = yes else now + 14 days

J
Jane 4/20/2007

Hi,
you can do it using Before record added or Before record updated event on the Events tab.

Here is a sample code:

if ($values["Requirement"]==1)

$values["DeliveryDate"] = date("Y-m-d", strtotime("+2 week"));

else

$values["DeliveryDate"] = now();

A
andja author 4/23/2007

Hi,

you can do it using Before record added or Before record updated event on the Events tab.

Here is a sample code:


Thanks this work great.

Is there any way to change the DeliveryDate direct when Requirement is changed.

J
Jane 4/24/2007

Hi,
to change DeliveryDate on the fly edit BuildEditControl function in the generated include/commonfunctions.php file manually.

Unfortunately we don't have a ready to go solution for this.