AnsweredAssumed Answered

How to fill up a field just under a certain condition?

Question asked by zymba2k zymba2k on Oct 21, 2014

I am using CE 6.5.16 and I would need some help trying to implement the following feature:

I have built a custom module for invoicing purposes. When the customer signs the contract, we record all the invoicing events as separate objects. So for example, if the customer pays in two times, we create two objects with the ammount and the due date.

I have setup a field in the module for the invoice number, a prefixed autoincremental (YY-xxxx). For this, I installed the DTG SugarCRM Autoincrement Field v0.2 beta from sugarforge, and it is working nice.

I also have setup a combo field with the invoice status (draft, approved, issued, paid)

The thing is I dont want the invoice field to be filled at the time of record creation, which is the actual behaviour, but I want it to be fill just at the time the status changes into "issued" state.

I am not good with php or programming at all, but I can do things if I have enough clear examples to inspire by.

How could I achieve this?

Thanks in advance,