(sc_btn_new) not functioning correctly in Form-Grid View

Can someone confirm if I’m crazy?

Trying to capture when the “Add New” button is clicked using this code…

if (sc_btn_new) {
echo “New Button Pressed”;
} else {
//Do Nothing;
}

When I run the form the echo always happens twice even before I click on the button?

Am I missing something here?

Thanks for any help.

How are you calling your form? and where is this code exactly? It’s working correctly for me.

Hi. The form is Being called from a master app and is a master/detail form. The code is being called from “OnLoad” event. As the form has no records it starts with the “Add New” button. I thought that when I clicked on the button it would run the code and output the echo statement. But As soon as I run the form I always see the echo output without clicking on the button? Not sure why that is happening?

ok…it seems to work if the form is set to “Single Record” or “Multiple Record”. It does not work if form is set to “Editable Grid” or “Editable Grid View”.

Has to be a bug with SC ?