• RReddy
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies

Hi, I designed a VF page with save and cancel buttons . On Clicking Save button, Cancel button also need to go into Saving mode, similar to Salesforce standard page.

 

My Requirement is :

 

On Clicking Save Button we should disble both Save & Cancel buttons and need to show saving text for both buttons

 

Thanks,

Ramana

  • November 12, 2012
  • Like
  • 0


Hi all,

 

   we are going to replace SControls by VF Pages.we are overriden  New Opportunity button on Account Detail Page.

Could you please help how to write code in VFpage and Controller.Is there any other ways to solve this problem.

Please Feel free to write comment on this ..

 

 Opporunity SControl Code

 

html
<body>
<script type="text/javascript">

//This condition restricts the new opportunity to be created under Inactive accounts
if (("{!Account.Status__c }"=="Inactive" ) ){
alert( 'You do not have sufficient rights to Create / Update an Opportunity against an Inactive Account. Please contact Customer Data Team for any assistance.');
window.parent.location.href ="{!URLFOR( $Action.Account.View , Account.Id, null, true)}";
}
else

/* This S control will override the Opportunity New Button with the SaveURL and retURL specified which overrride the Save and Cancel action.SaveURL include the relative URL for the Opportunity Product Page therefore so User on saving the New opportuntiy will be taken to the Add Product Page.
*/

window.parent.location.href ="{!URLFOR($Action.Opportunity.New,Account.Id,[saveURL='/apex/OpportunityProducts?requestFlag=1', retURL=URLFOR($Request.retURL, null,null,true)],True) }"

</script>
</body>
/html

Hi, I designed a VF page with save and cancel buttons . On Clicking Save button, Cancel button also need to go into Saving mode, similar to Salesforce standard page.

 

My Requirement is :

 

On Clicking Save Button we should disble both Save & Cancel buttons and need to show saving text for both buttons

 

Thanks,

Ramana

  • November 12, 2012
  • Like
  • 0


Hi all,

 

   we are going to replace SControls by VF Pages.we are overriden  New Opportunity button on Account Detail Page.

Could you please help how to write code in VFpage and Controller.Is there any other ways to solve this problem.

Please Feel free to write comment on this ..

 

 Opporunity SControl Code

 

html
<body>
<script type="text/javascript">

//This condition restricts the new opportunity to be created under Inactive accounts
if (("{!Account.Status__c }"=="Inactive" ) ){
alert( 'You do not have sufficient rights to Create / Update an Opportunity against an Inactive Account. Please contact Customer Data Team for any assistance.');
window.parent.location.href ="{!URLFOR( $Action.Account.View , Account.Id, null, true)}";
}
else

/* This S control will override the Opportunity New Button with the SaveURL and retURL specified which overrride the Save and Cancel action.SaveURL include the relative URL for the Opportunity Product Page therefore so User on saving the New opportuntiy will be taken to the Add Product Page.
*/

window.parent.location.href ="{!URLFOR($Action.Opportunity.New,Account.Id,[saveURL='/apex/OpportunityProducts?requestFlag=1', retURL=URLFOR($Request.retURL, null,null,true)],True) }"

</script>
</body>
/html

On a standard Salesforce edit page, when the save button is clicked, the button immediately grays out and prevents the user from clicking the button multiple times.  I'm trying to get the same effect on a VFP but I am having no luck.  Has anybody already done this?  I don't know if it's pertinent, but my save button is calling a method called Save in a custom controller.

 

 

<apex:pageBlockButtons > <apex:commandButton action="{!Save}" value="Save" id="saveBtn" /> </apex:pageBlockButtons>

 

 

 

  • March 02, 2009
  • Like
  • 0