I have a silly problem but I'm not able to find a solution. I have a VF page inside a record detail page. Inside the VF page I have a command button. At the end of the function inside the button action I want that the record detail page is reloaded. If I set "return null" or "return Apex.Currentpage()",solely the VF page is reloaded, not the entire page . How can I solve this issue? Thank you (below the code)
VF page inside the detail record page (section)
</apex:page>
<apex:pageMessages />
<apex:form styleClass="formstyle" >
<div class='leftLabelColumn' style="margin-left:10px">
<apex:param name="plId" value="{!P_L__c.id}" />
</div>
<div class='middleLabelColumn' style="margin-left:20px">
</div>
<div class='righLabelColumn' style="margin-right:-20px" >
<apex:commandButton id="calc2" action="{!calc}" value="Calculate"/>
</div>
[cal is the function I mentioned...... ]
</tr>
</table>
</div>
</apex:form>
</apex:page>
and the controller function
public pagereference calc(){
System.debug('calculate');
Decimal appoggio;
//this function when you impose a target revenue calculate the extra discount needed to reach it
P_L__c p = [select id,TargetMatRevenue__c,TargetSerRecRevenue__c,TargetServNotRecRevenue__c
from P_L__c where id=:pl.id];
System.debug('pel '+ p);
//first step ......update the target revenue with the values inserted
p.TargetMatRevenue__c=pl.TargetMatRevenue__c;
p.TargetSerRecRevenue__c=pl.TargetSerRecRevenue__c;
p.TargetServNotRecRevenue__c=pl.TargetServNotRecRevenue__c;
update p;
return null;
}
N.B. The code is too long I simply it it.