You need to sign in to do that
Don't have an account?
Jyosi jyosi
pulling the update values into visualforce page after updating the records
Hello Every ,
I have visualforce ,with the two button verify and submit.
When user clicks verify button .I insert the records and make a callout to thirdparty.
I get the response where i update the fields.but the updated fields are not reflected in visualforce page( Like i wont be closing the page)
Here is code for the button .
<apex:form id="form">
<apex:pageBlock mode="edit" id="pgBlckId">
<apex:pageblockbuttons >
<apex:commandButton value="Save As Draft " action="{!saveSample}" reRender="pgBlckId" status="actStatusId"/>
<apex:commandButton value="Verify" action="{!saveSample}" oncomplete="executeWS()" reRender="pgBlckId" status="actStatusId"/>
<apex:actionStatus id="actStatusId" rendered="true">
<apex:facet name="start" >
<apex:actionFunction name="executeWS" action="{!executeWS}" >
<div class="waitingSearchDiv" id="el_loading" style="background-color: #fbfbfb;
height: 100%;opacity:0.65;width:100%;">
<div class="waitingHolder" style="top: 74.2px; width: 91px;">
<img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
<span class="waitingDescription">Please Wait...</span>
</div>
</div>
</apex:actionFunction>
</apex:facet>
</apex:actionStatus>
</apex:pageblockbuttons>
the excute method
public PageReference executeWS(){
system.debug('executeWS === '+SAPOrderNumber.get(sampleRecord.Id)+'==='+this.j);
try{
if(SAPOrderNumber.get(sampleRecord.Id)==null)
{
callout.processSampleOrderRequestCreate(this,samplerecord.Id);
}else{
callout.processSampleOrderChangeRequest(this,samplerecord.Id);
}
/*PageReference pageref = new pagereference('/apex/sampleorderecc');
pageref.getParameters().put('recordID', samplerecord.Id);
pageref.setRedirect(true);*/
}catch(Exception e)
{
system.debug('Exception === '+e.getMessage());
}
return Null;
}
public void processSampleOrderRequestCreate(SampleOrderECC1 obj,Id sampleRecord)
{
here i make callout to thirdparty
}
public void processCreateResponse{
here i updated the records.
}
thanks for the ehlp
I have visualforce ,with the two button verify and submit.
When user clicks verify button .I insert the records and make a callout to thirdparty.
I get the response where i update the fields.but the updated fields are not reflected in visualforce page( Like i wont be closing the page)
Here is code for the button .
<apex:form id="form">
<apex:pageBlock mode="edit" id="pgBlckId">
<apex:pageblockbuttons >
<apex:commandButton value="Save As Draft " action="{!saveSample}" reRender="pgBlckId" status="actStatusId"/>
<apex:commandButton value="Verify" action="{!saveSample}" oncomplete="executeWS()" reRender="pgBlckId" status="actStatusId"/>
<apex:actionStatus id="actStatusId" rendered="true">
<apex:facet name="start" >
<apex:actionFunction name="executeWS" action="{!executeWS}" >
<div class="waitingSearchDiv" id="el_loading" style="background-color: #fbfbfb;
height: 100%;opacity:0.65;width:100%;">
<div class="waitingHolder" style="top: 74.2px; width: 91px;">
<img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
<span class="waitingDescription">Please Wait...</span>
</div>
</div>
</apex:actionFunction>
</apex:facet>
</apex:actionStatus>
</apex:pageblockbuttons>
the excute method
public PageReference executeWS(){
system.debug('executeWS === '+SAPOrderNumber.get(sampleRecord.Id)+'==='+this.j);
try{
if(SAPOrderNumber.get(sampleRecord.Id)==null)
{
callout.processSampleOrderRequestCreate(this,samplerecord.Id);
}else{
callout.processSampleOrderChangeRequest(this,samplerecord.Id);
}
/*PageReference pageref = new pagereference('/apex/sampleorderecc');
pageref.getParameters().put('recordID', samplerecord.Id);
pageref.setRedirect(true);*/
}catch(Exception e)
{
system.debug('Exception === '+e.getMessage());
}
return Null;
}
public void processSampleOrderRequestCreate(SampleOrderECC1 obj,Id sampleRecord)
{
here i make callout to thirdparty
}
public void processCreateResponse{
here i updated the records.
}
thanks for the ehlp
What you can do it you can combine both the actions into a single action. Merge action and oncomplete into one action.
Or
You can Change "oncomplete" to OnCLick ( Not sure this will work )
Thanks ,
Raj