• sofogabe
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
For a custom object, is there a built-in action I can specify within a command button to get a "Save & New" button?
 
<apex:commandButton value="Save" action="{!Save}"/>
 
hi
 
i want to retrieve the Server URL in trigger or in APEX class?
 
Actual my requirement is:
 
i had an object RelatedAttachement. in that Hyperlink field is of URL type. in that i am saving the URL like /servlet/servlet.FileDownload?file=00PR0000000MqVH. For this i want to retrieve the server URL and concatenate that Server URL to this field and updating this field.  in one server it looks like http://cs2.salesforce.com/servlet/servlet.Download?file=00PR0000000MqVH and in another server it looks like http://na2.salesforce.com/servlet/servlet.Download?file=00PR0000000MqVH so for this one i want to retrieve the server URL and i want to concatenate that URL to that field.
 
So please tell me how to retrieve the Server URL in trigger or in APEX class? 
Hi,
 
I need to override the standard edit page for a custom object. If the status of the custom object record is "Approved", then I do not want users to edit the record, else I need to redirect the users to the standard edit page for this record.
 
I have the following code in VF and controller. I can see the the URL is changed to the edit page URL when I click the edit button after overiding the button with the VF page, but the standard edit page is not getting displayed. Insatead the word Hello is getting displayed.
 
VF Code:
<apex:page standardController="Fixture_Order__c" extensions="conSEditOverrideFixtureOrder" 
id="mypage">
Hello
</apex:page>

 
Controller Code:
public class conSEditOverrideFixtureOrder {
Fixture_Order__c fixordobj; 

private String vid; 


public conSEditOverrideFixtureOrder(ApexPages.StandardController controller) { 

this.vid = ApexPages.currentPage().getParameters().get('id'); 
reset();

} 

public PageReference reset() { 

if(fixordobj.Approval_Status__c=='Approved'){
 PageReference editPage = new PageReference('/'+this.vid+'/e—retURL=' + this.vid);
 editPage.setRedirect(true);
 return editPage;
}else{
PageReference errPage = new PageReference('/apex/editFixtureOrderError');
 errPage.setRedirect(true);
 return errPage;
 
}

return null; 

} 

public String getApprovalStatus(){
 return this.fixordobj.Approval_Status__c;
}

public Fixture_Order__c getFixtureOrder() { 

if(fixordobj == null) reset(); 

return fixordobj; 

} 


public void setLead(Fixture_Order__c leaddet) { 

fixordobj = leaddet; 

} }

 

Can anyone please help to understand the cause? Appreciate all your valuable feedbacks.

Thanks and regards,
Ambili
  • September 02, 2008
  • Like
  • 0