Hi,
You can create a button with a link to the page that has the frontend form, and pass the Project A post ID to the URL via a custom parameter. Like this
http://your-site.com/frontend-submission-page/?current_post_id=get_queried_object_id()
Then retrieve the project ID via the variable $_GET
add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) {
$project_id = $_GET['current_post_id'];
if( !empty( $project_id ) ) MB_Relationships_API::add( $project_id, $post_id, 'your-relationship-ID', $order_from = 1, $order_to = 1 );
}, 10, 2 );
Hope that makes sense.