1
votes

I have a table which name PaymentLines and i want to control dueDate field of records which have same InvoiceId value. If there is a different dueDate value, info -> Records with the same InvoiceId value cannot have different dueDate values

How can i do this?

enter image description here

1

1 Answers

2
votes

It depends when you want to control for example if you want to do the control when you put the value in DueDate field overwrite Modified event of this field in datasource PaymentLines.

PaymentLines PaymentLinesCheck;

;

select PaymentLinesCheck where PaymentLinesCheck.InvoiceId == PaymentLines.InvoiceId &&
                               PaymentLinesCheck.DueDate != PaymentLines.DueDate;
if(PaymentLinesCheck)
{
    info("Records with the same InvoiceId value cannot have different dueDate values");
    //If you want to show an error message
    //error("Records with the same InvoiceId value cannot have different dueDate values");
    PaymentLines.DueDate = DateNull();        
}