Ah, that explains the requirement a bit more, thanks for the context.
But still, I'm not sure you're able to pass that as a parameter to the form.
"Thinking out loud", I can see two ways of implementing that.
Have a hidden field that you pass as a parameter from the grid, maybe a two options called ispartnership. And if that is true on the onload you applied the addCustomFilter.
Other way is to probably create a separate form on the connections where you have the onload function running every time and you use that form id on the navigateTo() function. So the default entity form is still the same but you have this specific form for partnership connections from that grid.
also, if you are setting the connection role, maybe you can use that to decide onload if you should use the addCustomFilter or not? Not sure how that part is being done so not sure if this would work.
hope this helps