Recognize whether copy-button has been used

Hi,
I have a date field that i initially populate like (Events -> onLoadRecord):

if (empty({BuchungId}) )
    {
        {BuchungsdatumId} = date('Ymd');
        {ZahltypId} = 2;
    }

However, if I use the copy button in an editable grid view I don’t want that initial value to show, but I want the copied value to appear.

I am looking for a solution like:

if (empty({BuchungId}) && [[notclickedcopybutton]] )
    {
        {BuchungsdatumId} = date('Ymd');
        {ZahltypId} = 2;
    }

Thank you for your help and best regards,
Konstantin

I think you can use a global variable for know if the button is cliked. Into event onclick for the button asign the value to global variable. [SIZE=12px][[/SIZE][SIZE=12px]notclickedcopybutton[/SIZE][SIZE=12px]] = FALSE;[/SIZE]

Hi ! I am not sure I understood this. I use the “copy” button as provided by the Toolbar module. Can I add assign a variable to this button as well?