Hey everyone. Not sure anyone can assist me on this. I need to use a ifThen formula within the record\create. Below is what Im using. Anyone see where Im messing up on this? I've messed with this for hours but can't seem to have any luck.
$invoiceId=record\create(
'Invoice',
'dateInvoiced', datetime\now(),
'billToId', ownerId,
'accountId', id,
'preDiscountedAmount', fireDueCost,
'grandTotalAmount', fireDueCost,
'dueDate',ifThen(
client.fireDuesNetTerms == '14 Days',
entity\setAttribute('dueDate', datetime\addDays(dateInvoiced, 14))
);
ifThen(
client.fireDuesNetTerms == '30 Days',
entity\setAttribute('dueDate', datetime\addDays(dateInvoiced, 30))
);
ifThen(
client.fireDuesNetTerms == '60 Days',
entity\setAttribute('dueDate', datetime\addDays(dateInvoiced, 60))
);
ifThen(
client.fireDuesNetTerms == '90 Days',
entity\setAttribute('dueDate', datetime\addDays(dateInvoiced, 90))
);,
);
$invoiceId=record\create(
'Invoice',
'dateInvoiced', datetime\now(),
'billToId', ownerId,
'accountId', id,
'preDiscountedAmount', fireDueCost,
'grandTotalAmount', fireDueCost,
'dueDate',ifThen(
client.fireDuesNetTerms == '14 Days',
entity\setAttribute('dueDate', datetime\addDays(dateInvoiced, 14))
);
ifThen(
client.fireDuesNetTerms == '30 Days',
entity\setAttribute('dueDate', datetime\addDays(dateInvoiced, 30))
);
ifThen(
client.fireDuesNetTerms == '60 Days',
entity\setAttribute('dueDate', datetime\addDays(dateInvoiced, 60))
);
ifThen(
client.fireDuesNetTerms == '90 Days',
entity\setAttribute('dueDate', datetime\addDays(dateInvoiced, 90))
);,
);
Comment