I have some apex validation where if a user forgets to enter something in a related list, the system will give them a pageMessage saying that they need to enter a row into that list. We want to create a link that will take them directly to the 'new' version of the page right in the pageMessage (i.e., clicking on the New button on top of the related list).
I thought this would work, but it doesn't:
Commission_Split__c commSplit = new Commission_Split__c(Opportunity__c = quoteRecord.zqu__Opportunity__c);
PageReference prNewCommSplit = new ApexPages.StandardController(commSplit).view();
...
// prNewCommSplit.getUrl(); returns a link back to the quoteRecord
Any ideas?