Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Pipe Delimiters

Anonymous
Not applicable

In v5.5 we have a custom object that hides the Add New link in a cross-reference grid, leaving just the Lookup link. We want to force new records to be created from the parent application.  In v6.4 P1 the functionality works the same but now there is an extra pipe "|" delimiter displayed in front of where Add New used to be displayed. The js used to hide the Add New link is attached.

pastedImage_1.png

I can find the information in the source that shows the pipe character. 

<span class="ml-command-item-divider subSection-ml-command-items-div First">|</span>

 

How can the first instance of the pipe be hidden from the page view? Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

jsol5
Advocate II

Literally, just did this yesterday.

$("#master_DefaultContent_rts_s"+Field_ID"+"_commands").children("span.ml-command-item-divider.Last").hide();

Where field_ID is the field of the cross reference field.

View solution in original post

8 REPLIES 8

jsol5
Advocate II

Literally, just did this yesterday.

$("#master_DefaultContent_rts_s"+Field_ID"+"_commands").children("span.ml-command-item-divider.Last").hide();

Where field_ID is the field of the cross reference field.

TimothyYoung1
Contributor II

I have this to block the "Add New" for a cross-reference

<script type="text/javascript">
$(document).ready(function(){
$("#master_DefaultContent_rts_s11831_ss26781_Add_New").children("span.ml-command-item-divider.Last").hide();
});
</script>

If I just use $("#master_DefaultContent_rts_s11831_ss26781_Add_New").hide(); the result is Add New is gone and the pipe still remains "|"

 

If I use the entire code above it doesn't work at all, please help what am I missing?

I have this to block the "Add New" for a cross-reference

<script type="text/javascript">
$(document).ready(function(){
$("#master_DefaultContent_rts_s11831_ss26781_Add_New").children("span.ml-command-item-divider.Last").hide();
});
</script>

If I just use $("#master_DefaultContent_rts_s11831_ss26781_Add_New").hide(); the result is Add New is gone and the pipe still remains "|"

 

If I use the entire code above it doesn't work at all, please help what am I missing?

Try, 

<script type="text/javascript">
Sys.Application.add_load(function(){
$("#master_DefaultContent_rts_s11831_ss26781_Add_New").hide();
$("#master_DefaultContent_rts_s11831_ss26781_Add_New").prev().hide();
});
</script>

 Advisory Consultant

Yes That Worked.  Thanks David!!!

The line below doesn't seem to work to hide the lookup button of the grid am I missing anything?

 

$("#" + $CM.getFieldById(fldIds.ActionPlans).clientId + "_Lookup").hide();

Anderson, the element id for the lookup link doesn't contain the _fnnnn at the end, so when you use the .clientId the browser cannot find the element.  You just need to strip out the _fnnnn like so,

$('#' + $CM.getFieldById(fldIds.ActionPlans).clientId.split('_f')[0] + '_Lookup').hide()‍‍

 Advisory Consultant

Thanks David, it is working.