Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2020-09-01 11:09 AM
Hello community,
I have a question for Java Script experts: Can custom object determine if we have more than one record in the cross-reference grid on the layout?
If yes, is there some sample?
Thanks,
Gabil Kazimov
2020-09-01 11:24 AM
No need to use a Custom Object for this. You can leverage the COUNTA() function in a calculated field to count the number of references. Details: COUNTA Function
2020-09-01 11:58 AM
Hi Scott,
Thank you for the prompt reply.
However I need to count number of records in the cross-reference field BEFORE saving the record. The goal is to prevent saving such records. Generally speaking I need a CONDITIONALLY multi-select cross-reference field.
Thanks,
Gabil
2020-09-01 03:56 PM
Gabil, you can use the following to see how many records are selected in a cross-reference field:
$('input[name*="SelectedValues' + rxRefFieldId + '"]').val();
Then you can get a count of that array and go from there.
Advisory Consultant
2020-09-01 04:40 PM
Thanks David. Much appreciated.