• ADITYA PRAKASH 5
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Analyst
  • Goldman Sachs

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 8
    Replies
Hi,

I need to refresh the whole VF Page once my delete method executes. I have wriiten the below code. When I delete a particular record, the record is getting deleted but the page is not refreshing to show the updated records. Please help. 

VF Page:

<apex:page controller="viewdept_con" showHeader="false " id="mypage">
 <apex:form >
  <apex:pageBlock >
   <apex:pageblockTable value="{!deptlist}" var="item"> 
     <apex:column headerValue="Action">
     <apex:commandLink value="Detail" action="{!deptdetail}"/><b> | </b>
     <apex:commandLink value="Del" action="{!deptdelete}" reRender="mypage">
     <apex:param name="deptid" value="{!item.id}" assignTo="{!deptid}"/>
     </apex:commandlink>
     </apex:column>
     <apex:column value="{!item.name}"/>
   </apex:pageblockTable>
  </apex:pageBlock>
 </apex:form>
</apex:page>

Controller:

public class viewdept_con {

   public list<department__c> deptlist { get; set; }
   public id deptid {get; set;}
   public department__c dept {get; set;}
   
   public viewdept_con()
   {
   deptlist = [select id, name from department__c];
   }
   
   public pagereference deptdetail()
   {
     pagereference pg = new pagereference('/apex/DepartmentDetail?deptid=' + deptid);
     return pg;
   }
   
   public pagereference deptdelete()
   {
     dept = [select id, name from department__c where id = :deptid];
     delete dept;
     return null;
   }
}

Thank you,
Satya
<apex:page controller="Person">

        <apex:sectionHeader id="Own_VisualForce" title="Student Twin" subtitle="New Twin Student"
                        description="This is the VisualForce page of Student object"
                        help="/apex/MyVisualForcePage"
                        printUrl="https://c.ap2.visual.force.com/apex/Own?core.apexpages.request.devconsole=1"/>
    <apex:form >
    <apex:pageBlock id="OwnPageblock" title="Student Edit" tabStyle="Opportunity" dir="LTR" helpTitle="Any Help?"
                    helpUrl="https://ap2.salesforce.com/_ui/core/userprofile/UserProfilePage"
                    mode="inline edit" rendered="true" lang="en-IN">
   
        <apex:pageBlockButtons id="Own_pbb" title="PageBlockButtons" dir="LTR" lang="en-US" rendered="true" >
            <apex:commandButton value="Save"/>
            <apex:commandButton value="Save & New"/>
            <apex:commandButton value="cancel" />
            
        <apex:pageBlockSection collapsible="false" columns="4" rendered="true">
            <apex:inputField value="{!Person.Person_Name}"/>
            <apex:inputField value="{!Person.Course}"/>
            <apex:inputField value="{!Student.Country}"/>     

</apex:pageBlockSection>
        </apex:pageBlockButtons>
    </apex:pageBlock>
    </apex:form>
</apex:page>
            User-added image
What's wrong in the above program (ERROR in Line 0 --> Unknown property 'Person.Person') & i'm trying to get the fields of a custom obj named "Person" as shown in the above picture. How to write a class with set & get.
I have a requirement where I need to create a button on lead page when clicked it should redirect to Contact page with prepopulated values like  Lead Company Name - Account Name, Lead Phone - Contact Phone and so on.(standard pages) dont want to create a VF Page. Any suggestions would be appreciated.
Hello all,
I'm trying to create a page that has an editable table. My code is below:
<apex:page standardController="account">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:variable var="sr" value="{!0}"/>
            <apex:pageBlockTable value="{!account.contacts}" var="contact" rows="8">
                <apex:column headerValue="Membership Number"><apex:variable var="sr" value="{!sr + 1}"/>
                  {!sr}
                   </apex:column>  
                <apex:column headerValue="Reserved"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Shared"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Nights & Weekends"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Small Office"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Large Office"><apex:inputCheckbox /></apex:column>
                <apex:column headerValue="Membership Fee"><apex:inputText /></apex:column> %make this automatically update based on click of inputCheckbox
                <apex:column headerValue="Start Date"><apex:inputText /></apex:column>
                <apex:column headerValue="End Date"><apex:inputText /></apex:column>
                <apex:column headerValue="Comments"><apex:inputText /></apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

The table itself renders how I want it to, displaying like so:
User-added image

.  For some reason, whenever I click the "Save" button, an error occurs where the page does not save or update, and subsequent attempts create an inception-like view, where the actual webpage renders itself within the grid window.

This is obviously not what I want to do, as I'm actually just trying to create a pageBlockTable that can be edited and saved. Any suggestions on how to modify my code to accomplish this?

Hi All,

 

I think this is an easy fix for someone who knows what they are doing. Unfortunately I do not.

 

Here is the situation...

 

I've created a Visual Flow (at least that's what I think its called) with some basic decisions and input screens to collect information.  The flow is triggered by a button on the "Quote" screen.  At the end of the flow I would like to automatically run a DDP I previously created.  I want the DDP to include values from the quote and from values collected in the flow. I would also like to be able to control the delivery option.

 

I tried using the "Run DDP" element in the visual flow editor but I can't seem to get it to work.

 

PLEASE HELP

 

Thanks in advance!

 

Josh

Hi Guys,
  1. Until the Spring 15 release, Maps and Sets are Unordered Collections. So the returned order will be random.
  2. But beginning from Summer 15 release onwards, Maps and Set order is predictable. The order will be same that what you put from the beginning to end.
Example:
Map<String, String> orderedMap = new Map<String, String>();
orderedMap.put('Good', 'This is so good');
orderedMap.put('Bad', 'This is so bad');
System.debug(orderedMap);

If you run the above code snippet in Developer console you will get the returned order as below,

Until Spring 15 Release:

{Bad=This is so bad, Good=This is so good}

From Summer 15 Release:

{Good=This is so good, Bad=This is so bad}

This changes is not the API level, this is Schema level change. If anyone relying on the Map or Set order in your codes, change it as soon. 

Thanks.