• jenny_j_chen1.3971006870153901E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
We are catching history of users in a custom object, called UserHistory.  I used Trigger on User and i can catch most info changes except user email change and if user is frozen (by the freeze button). 

The issue with email : Salesforce is not changing user email, it sent an email to the new and old email address. However, inside the user trigger, oldValue and newValue of email are the same, so it did not catch the change. 

The issue with frozen user : i don't see any field or flag on user, what can i do?
Thank you for your help.
We are trying to implement a mass edit type VF page that displays a few fields in a list and allows the user to edit one of those fields. We have a requirement that the list be sortable by column. I’ve taken examples from SFDC and pieced together an implementation using an extension class to do the sorting and the standardsetcontroller. The problem we are having is once a user makes edits to the data on the page and presses the Save button, their changes are not saved; When I examine the records the user supposedly edited I see no changes. Moreover, the debug logs do not indicate any updates were done.  What do I need to do to get my VF page to Save (update) the records the user has edited? 

Here is our VF Page:

<apex:page standardController="Ticket1__Ticket__c" extensions="SortingController,selectedSizeController" showHeader="false" recordsetvar="tickets">
    <apex:form >
   
        <apex:pageMessage summary="Selected Collection Size: {!selectedSize}"
            severity="info"
            id="mupms"
        />
        <apex:pageMessage summary="Record Set Size: {!recordsSize}"
            severity="info"
            id="mupmr"
        />
   
        <apex:pageBlock title="Ticket Mass-Update" mode="edit" id="mub1">
            <apex:pageMessages />
           
            <apex:pageBlockSection id="mus1">
                <apex:inputField value="{!Ticket1__Ticket__c.Status__c}" id="status">
                    <apex:actionSupport event="onchange" rerender="muselectedlist"/>
                </apex:inputField>
            </apex:pageBlockSection>
           
            <apex:pageBlockButtons location="bottom" id="mubut">
                <apex:commandButton value="Save" action="{!save}" id="butsav"/>
                <apex:commandButton value="Cancel" action="{!cancel}" id="butcan"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
       
        <apex:pageBlock title="Campaign Tickets" id="muselectedlist">
            <apex:pageBlockTable value="{!tickets}" var="tix" id="mutab">
           
                <apex:column >
                    <apex:outputText value="{!tix.Id}" />
                </apex:column>
               
                <apex:column >
                    <apex:outputText value="{!tix.Name}" />
                </apex:column>               
                            
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!sort}" value="Ticket1__tix_LastName__c{!IF(sorterUtil.column=='Ticket1__tix_LastName__c',IF(sorterUtil.sortDirection='ASC','?','?'),'')}">
                            <apex:param value="Ticket1__tix_LastName__c" name="column" assignTo="{!sorterUtil.column}" ></apex:param>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputText value="{!tix.Ticket1__tix_LastName__c}" />
                </apex:column>
               
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!sort}" value="Ticket1__tix_FirstName__c{!IF(sorterUtil.column=='Ticket1__tix_FirstName__c',IF(sorterUtil.sortDirection='ASC','?','?'),'')}">
                            <apex:param value="Ticket1__tix_FirstName__c" name="column" assignTo="{!sorterUtil.column}" ></apex:param>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputText value="{!tix.Ticket1__tix_FirstName__c}" />
                </apex:column>
               
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!sort}" value="Attendee_Role__c{!IF(sorterUtil.column=='Attendee_Role__c',IF(sorterUtil.sortDirection='ASC','?','?'),'')}">
                            <apex:param value="Attendee_Role__c" name="column" assignTo="{!sorterUtil.column}" ></apex:param>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputText value="{!tix.Attendee_Role__c}" />
                </apex:column>
               
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!sort}" value="Status__c{!IF(sorterUtil.column=='Status__c',IF(sorterUtil.sortDirection='ASC','?','?'),'')}">
                            <apex:param value="Status__c" name="column" assignTo="{!sorterUtil.column}" ></apex:param>
                        </apex:commandLink>
                    </apex:facet>
                        <apex:inputField value="{!tix.Status__c}"/>
                </apex:column>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>


Here is our controller:

public class SortingController {
//[Select Id, Name, Tickets1__tix_LastName__c, Tickets1__tix_FirstName__c, Attendee_Role__c, Status__c From Tickets1__Ticket__c];

private final ApexPages.StandardSetController cntr;
String qid;

private String defaultSortColumn = 'Tickets1__tix_LastName__c'; /** Set the default sort Column. /
private String sortDirection = 'ASC';
public SortingControllerUtil sorterUtil {get; set;} /* Declare Sorter Utility class Object. /

public SortingController(ApexPages.StandardSetController controller) {

qid = ApexPages.currentPage().getParameters().get('id');
system.debug('Id of object in context is=' + qid);

cntr = (ApexPages.StandardSetController)controller;

sorterUtil = new SortingControllerUtil(defaultSortColumn, sortDirection); /* Create Sorter_UTIL Object. /
}
public List<Tickets1__Ticket__c> getTickets() {
/* Add the column and sort direction value at the end of query.*/
String stringQuery =
  'Select Id, Name, Tickets1__tix_LastName__c, Tickets1__tix_FirstName__c, Attendee_Role__c, Status__c From Tickets1__Ticket__c ' +
  'Where Tickets1__tix_Campaign__c= :qid ' +
  'Order By ' + sorterUtil.getColumn() + ' ' + sorterUtil.getSortDirection() +' NULLS LAST';
return database.query(stringQuery);
}

public PageReference sort() { /* Define sorting method. **/
/** Do nothing here. **/
return null;
}

}