Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2022-04-05 04:03 PM
Thank you @DavidPetty for this code, it's really helpful.
When I tried using it, it only worked for Single Column cross reference, but not for the Grid.
The lookupFieldId function couldn't find the id for the Grid cross reference.
Do you have any updated version or insights?
Thank you
2022-04-06 12:29 PM - edited 2022-04-06 01:31 PM
That's not the line that looks for cross-reference/sub-form fields. This is the line,
try {if (!goFindId) goFindId = $('.SectionLabel:findField("' + fldName + '")')[0].id;} catch (err) {}
Is there no space before or after the field name in the Application Builder or the custom object code?
Same code and it's hiding for me,
var crossReferenceToHideAddNew = getFieldId(['Select First Stakeholder', 'Control Standards']);
Advisory Consultant
2022-04-05 04:35 PM
@Archerwizz2022 is the cross-reference field set as a grid in its own section or embedded in an existing section?
Advisory Consultant
2022-04-05 04:38 PM - edited 2022-04-05 04:47 PM
Multiple cross references are placed in one section, some are grid and others are single column.
2022-04-05 04:49 PM
Thanks, which version of Archer?
Advisory Consultant
2022-04-05 04:53 PM
Version 6.10 P1 HF2
2022-04-06 09:48 AM
@Archerwizz2022, I just tested the custom object with a few cross-reference fields inside a section and had no issues hiding the Add New link.
If you change the debugging variable from false to true, what's being outputted in the browser developer tools console?
Advisory Consultant
2022-04-06 11:31 AM
As you can see, the first Grid cross reference still has the "Add New", while the single column cross reference had the "Add" link disappeared.
After reviewing the code, I thought it could be because of the colon you added in the
if($(this).text().indexOf(fldName + ':') != -1){
Which I removed, since the grid cross reference doesn't have a colon, but still, it didn't work.
Also, I noticed that the label for the grid cross reference is an image, and not a text. While the single column cross reference, the label is a text. Could that be the issue.
Thank you
2022-04-06 12:29 PM - edited 2022-04-06 01:31 PM
That's not the line that looks for cross-reference/sub-form fields. This is the line,
try {if (!goFindId) goFindId = $('.SectionLabel:findField("' + fldName + '")')[0].id;} catch (err) {}
Is there no space before or after the field name in the Application Builder or the custom object code?
Same code and it's hiding for me,
var crossReferenceToHideAddNew = getFieldId(['Select First Stakeholder', 'Control Standards']);
Advisory Consultant
2022-04-06 01:41 PM
It's finally working. I guess you know your code better. The cross reference field name had a space.