Hello everyone, I don't know if my previous post was sent (had a sudden power loss).
Anyway, I'm trying to get the total of unpaid services our clients have with use that I then would like to send to them via SMS. Sending the SMS is no problem but getting the total seems to be a bother. Here's my script:
Event : Opening an Entry View card
Phase : After window display
Script :
var e = entry();
var clientLib = lib();
var entries = clientLib.find(e.field("Customer ID Numer"));
for(var i in entries) {
var paid = entries[i].field("Paid?");
var salesToday = entries[i].field("Sale for today :");
var sale = entries[i].field("Sale :");
var totalUnpaid = sale + saleToday;
message (totalUnpaid);
} else {
cancel ();
}
}
I created a dummy account with 4 clients that had services on different dates. 1 of the services is. already paid and each service costs $2. When I run the script; I get a message that says, 8, then 4 then blinks 4 twice. The message should just say 6. Help please?