Add a button in detail panel

You can specify a function as CallInEditor and the detail panel will show you a button for it.

UFUNCTION(BlueprintCallable, CallInEditor)