• Carole Reynolds1
  • NEWBIE
  • 35 Points
  • Member since 2012
  • CRM Admin
  • Michigan Technological University

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 8
    Replies

I have a VF page that uses the standardController for Opportunity. Is there a way, without writing an extension class, to get the Contact Name from the Contact Roles related list?

I found a solution for my email template that works like a charm (see below), but I'm struggling getting it to work on the VF page that is used by a custom button. I'm a developerless novice admin, pardon my ignorance. 

 

Working in VF Email Template: 

<apex:repeat value="{!RelatedTo.OpportunityContactRoles}" var="ContactRole"> {!ContactRole.Contact.Name}</apex:repeat>

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;
}

}
The invoices.get( ... ) in the last line returns null because the invoices keySet contains keys which are not Opportunity__c.Id's like I expected. I am doing something like this in the following execute anonymous code:

Id key = '006G000000TZ2f9IAD';
Map<Id, Invoice1__c> invoices = new Map<Id, Invoice1__c> ([SELECT Opportunity__c
                                                                , Name
                                                            FROM Invoice1__c
                                                            WHERE Opportunity__c = :key]);

system.debug('Created Map. Number of Invoice names mapped=' + invoices.size());
system.debug('Invoices.Get=' + invoices.get(key));

I would like to be able to pull the Invoice1__c.Name from the Map something like:

String invoiceName = invoices.get(newTicket.sbx_Opportunity__c).Name;

1. How do I properly populate a Map of <OpportunityID, Invoice1__c.Name>. Like this <006G000000TZ2f9IAD, 'Inv-0561'>

2.  What are the Id's that I currently see in the invoices variable keySet?

We are using email to case and have selected "bounce message".

We have discovered that on a couple occasions people have sent in attachments over the 10MB limit - the email did not come into SF of course, however, no one received a bounce notification. The person sending did not receive a message, and the email list that it was sent to did not.

We use gmail - and the email address for this particular email to case instance is an email list. I have a feeling the bounce is getting caught in some type of loop.


Has anyone experianced bounces for over the file limit size not working?  Is there a resolution?

AND/OR

Has anyone developed a trigger or something to notify another party on a bounce outside of the built in bounce function?

I want to use the contract object to track our interal software purchases and distrubution. So for each software contract we could potentially have 20 or more internal contacts using the contract seats.  

 

I'm assuming the only way to do this is with a custom button/VF page - I'm visualizing a button on the contract object "add contacts" which brings up a page that displays the contacts for our org which could be selected by checkbox. Has anyone attempted anything similar that would be willing to share code? My VF skills are severely lacking.

We are trying to assign a user name to a custom field (Assigned_To__c) that is in the standard case object through a trigger along with some other critera - everything is working except for the Assigned To where it is dumping the following error:

 

Save error: Illegal assignment from LIST<User> to Id

Here is the code:

 

if (newCase.Subject=='RS DB Stats') {
                    newCase.Type='RS DB Stats';
                    newCase.Reason='Other';
                    newCase.Assigned_To__c=[select Name from User where Name='Nick Koszykowski'];
                    newCase.Status='Closed';
                }

 

Any thoughts on what we've done wrong?

I have a VF page that uses the standardController for Opportunity. Is there a way, without writing an extension class, to get the Contact Name from the Contact Roles related list?

I found a solution for my email template that works like a charm (see below), but I'm struggling getting it to work on the VF page that is used by a custom button. I'm a developerless novice admin, pardon my ignorance. 

 

Working in VF Email Template: 

<apex:repeat value="{!RelatedTo.OpportunityContactRoles}" var="ContactRole"> {!ContactRole.Contact.Name}</apex:repeat>

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;
}

}

We are using email to case and have selected "bounce message".

We have discovered that on a couple occasions people have sent in attachments over the 10MB limit - the email did not come into SF of course, however, no one received a bounce notification. The person sending did not receive a message, and the email list that it was sent to did not.

We use gmail - and the email address for this particular email to case instance is an email list. I have a feeling the bounce is getting caught in some type of loop.


Has anyone experianced bounces for over the file limit size not working?  Is there a resolution?

AND/OR

Has anyone developed a trigger or something to notify another party on a bounce outside of the built in bounce function?

I want to use the contract object to track our interal software purchases and distrubution. So for each software contract we could potentially have 20 or more internal contacts using the contract seats.  

 

I'm assuming the only way to do this is with a custom button/VF page - I'm visualizing a button on the contract object "add contacts" which brings up a page that displays the contacts for our org which could be selected by checkbox. Has anyone attempted anything similar that would be willing to share code? My VF skills are severely lacking.

I have textbox which has a decimal  value fetched from controller. I need to show the value with 2 zero's after decimal point. Currently its displaying just 1 zero.

 

 

<apex:inputText styleclass="tb2" value="{!a.TimeCardObj.Monday_Hours__c}"/>

 

 

Thanks

Prady

  • February 14, 2011
  • Like
  • 0