"New" ("Insert", "Add") button can't be hidden in a detail grid displayed from a master

Hi.
I’ve been struggling to be able to hide the “New” button in my grid.

I know I can:

  • remove the “Form buttons” buttons group in the Toolbar
  • use the “sc_btn_display(new, off);” macro (I tried to use it in all events).
    Nothing of this works. The “New” button keeps showing up again.

My grid is displayed from a master Form with the “master-detail” feature. Therefore there is no setting here to tell the grid to display or not the New button individually.
I tried to switch from “Grid view mode = Enable all features” to “View only”. This hides all buttons in the Toolbar, even the other buttons I want to keep. Grrrr …

I also tried to use the “sc_btn_macro” in different ways (saw them in the forum):
sc_btn_display(new, off);
sc_btn_display(“new”, “off”);
sc_btn_display(‘new’, ‘off’);
and did the same thing with “sc_btn_display(insert, off);”
This New button does not want to go away …
Any idea to help me ?
Thanks a lot.

Hi jefch, did you check this in your master form?

Regards,
Mauricio

Hi dossamau.
Yes I did and it had no effect.
But what I’ve finally done is I deleted the Edit Application Link and recreated it. Then now the “New” button disappeared …
Thanks for taking the time to respond.

Hi
I think when you create the relationship master-detail you state the visible options for new, edit and delete buttons, and these prevail over the other options (toolbar and sc_btn_display)

regards.

Hi aamartinez.
If I’m not mistaking, in the “Master-Detail” settings, there is no such thing (see printcreen #1)
What you are talking about are the settings of an application link (see printscreen #2).
In thiscase, the issue was coming I think from what dossamau pointed out (the arrow on the printscreen).

PRINTSCREEN #1

PRINTSCREEN #2

and did you try changing “Grid view mode” to “view only”?
In this case it won’t show the buttons, but I don’t know if that is what you want.

regards

Yes, I did. This hides ALL buttons, even the other buttons I want to display … so not a solution. Thx for the option.

A workaround that I implement in my code is to echo out CSS disabling the button like so:


echo "<style>#sc_b_new_t{display: none !important;}</style>";

Thx Jeffrey. Tis is a good one. I’ll keep it.