Hello developers,
I have written some code for the Quote entity, but it appears to be malfunctioning. Could you please review it for any issues?
$target = list();
$i = 0;
while ($i < array\length(opportunity.contactsIds)) {
$contactId = array\at(opportunity.contactsIds, $i);
// Check if the contactId matches billingContactId.
if ($contactId == billingContactId) {
$target = array\push($target, '1');
} else {
$target = array\push($target, '0');
}
$i = $i + 1;
}
if (array\includes($target, '0')) {
recordService\throwBadRequest("Billing Contact is missing in the Opportunity.");
}
I have written some code for the Quote entity, but it appears to be malfunctioning. Could you please review it for any issues?
$target = list();
$i = 0;
while ($i < array\length(opportunity.contactsIds)) {
$contactId = array\at(opportunity.contactsIds, $i);
// Check if the contactId matches billingContactId.
if ($contactId == billingContactId) {
$target = array\push($target, '1');
} else {
$target = array\push($target, '0');
}
$i = $i + 1;
}
if (array\includes($target, '0')) {
recordService\throwBadRequest("Billing Contact is missing in the Opportunity.");
}
Comment