Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to hide 'Add New' Link for Cross-Reference Fields with Grid View

TimGooden
Contributor II

We just migrated to the SaaS and our custom object code doesn't work anymore. Support wants us to use professional services. I thought I'd reach out to the community to see if someone could help. I've tried using the new code in this article. However, it didn't work for grid view only works with single column. 

https://www.archerirm.community/t5/archer-custom-objects-knowledge/hiding-the-add-new-link-for-cross-reference-fields/ta-p/632035

<script type="text/javascript">

               //  Hide Buttons

               $('#master_btnAdd').css('display', 'none');  

               $('#master_btnCopy').css('display', 'none'); 

               //$('#master_btnApply').css('display', 'none');

               //$('#master_btnDelete').css('display', 'none');

 

               // Hide the Add New links

               // 661=Engagements, 652=Vendor, 14837=Master Agreement

               //

 

      var xrefFieldIds= [14837,652,661];

      var sectionId, clientId;

 

      Sys.Application.add_load(function() {

            $.each(xrefFieldIds,function(i,v){

                  sectionId = $CM._fields[v].sectionId;

                  clientId = $LM._sections[sectionId].clientId;

 

                  if($('a[id*="'+ v +'c_Add_New"]').length){

                        $('a[id*="'+ v +'c_Add_New"]').hide();

                  } else if($('a[id*="'+ clientId +'_Add_New"]').length) {

                        $('a[id*="'+ clientId +'_Add_New"]').hide();

                        $('a[id*="'+ clientId +'_Add_New"]').next().hide();

                  } else if ($('a[id*="'+ clientId + '_ss' + v + '_Add_New"]').length) {

                        $('a[id*="'+ clientId + '_ss' + v + '_Add_New"]').hide();

                        $('a[id*="'+ clientId + '_ss' + v + '_Add_New"]').next().hide();

                  }

            });

      });

</script>

 

0 REPLIES 0