• Michael Davis 15
  • NEWBIE
  • 45 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 8
    Replies
Here is the code snippit:
trigger WorkOrderJobRollUp on Work_Order__c (before update, after insert, after delete, after undelete) {
    
    // Check to make sure work order is not being deleted
    IF (trigger.isdelete == FALSE)
    {
        // Run trigger for all situations with the exception of the AFE Approval process
        For(Work_Order__c wo : Trigger.New)
        {
            try
            {
                Work_Order__c beforeUpdate = Trigger.oldMap.get(wo.ID);
                system.debug('Work Order ID New: ' + wo.ID);
                system.debug('Work Order ID Old: ' + beforeUpdate.ID);
                
                string oldstatus = beforeUpdate.Work_Order_Status__c;
                
                system.debug('New WO Status: ' + wo.Work_Order_Status__c);
                system.debug('Old WO Status: ' + beforeUpdate.Work_Order_Status__c);
                system.debug('Old WO Status: ' + trigger.oldmap.get(wo.ID).Work_Order_Status__c);
                system.debug('Old WO Status: ' + oldstatus);
                   
                   IF (wo.Work_Order_Status__c == 'Approved' && beforeUpdate.Work_Order_Status__c == 'Pending Approval') return;
            }
            catch(exception e){}
        }
    }

Here is a snippit of the debug log:
14:09:14.853 (9285875790)|USER_DEBUG|[12]|DEBUG|Work Order ID New: a270j0000009ASKAA2 14:09:14.853 (9285880579)|STATEMENT_EXECUTE|[13] 14:09:14.853 (9285889523)|HEAP_ALLOCATE|[13]|Bytes:18 14:09:14.853 (9285894991)|HEAP_ALLOCATE|[13]|Bytes:37 14:09:14.853 (9285898897)|USER_DEBUG|[13]|DEBUG|Work Order ID Old: a270j0000009ASKAA2 14:09:14.853 (9285901596)|STATEMENT_EXECUTE|[15] 14:09:14.853 (9285907986)|VARIABLE_SCOPE_BEGIN|[15]|oldstatus|String|false|false 14:09:14.853 (9285914795)|VARIABLE_ASSIGNMENT|[15]|oldstatus|"Approved" 14:09:14.853 (9285916837)|STATEMENT_EXECUTE|[17] 14:09:14.853 (9285920997)|HEAP_ALLOCATE|[17]|Bytes:23 14:09:14.853 (9285925680)|USER_DEBUG|[17]|DEBUG|New WO Status: Approved 14:09:14.853 (9285928468)|STATEMENT_EXECUTE|[18] 14:09:14.853 (9285932040)|HEAP_ALLOCATE|[18]|Bytes:23 14:09:14.853 (9285935598)|USER_DEBUG|[18]|DEBUG|Old WO Status: Approved 14:09:14.853 (9285938221)|STATEMENT_EXECUTE|[19] 14:09:14.853 (9285964009)|HEAP_ALLOCATE|[19]|Bytes:23 14:09:14.853 (9285968749)|USER_DEBUG|[19]|DEBUG|Old WO Status: Approved 14:09:14.853 (9285971863)|STATEMENT_EXECUTE|[20] 14:09:14.853 (9285974149)|HEAP_ALLOCATE|[20]|Bytes:23 14:09:14.853 (9285978158)|USER_DEBUG|[20]|DEBUG|Old WO Status: Approved

The value of the Work Order Status field is changing from Pending Approval to Approved and I don't want the body of the trigger to fire off when this happens.  How does the Trigger.newmap and trigger.oldmap values equal each other?
Without using code, is there a way to filter the child related list on the masters detail page?  The use case is we have a group of sites where we track the people that are currently on that site.  We want to be able to show just the people that are currently on that site.  We setup an object that is the list of sites and a child object that is a list of the people that have visited the site with a check in date and time and a check out date and time.  The ask is to have a list of the users which do not have a check out date and time filled in display in the related list on the master records detail page.  The only way I can seem to accomplish this is with a custom VF page.  Is there a way to do this natively in SF without the VF page?
Working through the Trailhead Visualforce Beginner section and working in the Using Standard List Controller section.  Following through the lesson, I am trying to get the pagination section to work but cannot seem to.  I have tried like 5 times now.  Any ideas on what I am doing wrong?

<apex:page standardController="Contact" recordSetVar="contacts">
    <apex:form>
        <apex:pageBlock title="Contacts List" id="contacts_list">
        
            Filter: 
            <apex:selectList value="{! filterId }" size="1">
                <apex:selectOptions value="{! listViewOptions }"/>
                <apex:actionSupport event="onchange" reRender="contacts_list"/>
            </apex:selectList>
        
            <!-- Contacts List -->
            <apex:pageBlockTable value="{! contacts }" var="ct">
                <!-- Pagination -->
                <table style="width: 100%"><tr>
                <td>
                <!-- Page X of Y -->
                    Page: <apex:outputText
                          value=" {!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
                </td>            

                <td align="center">
                   <!-- Previous page -->
                <!-- active -->
                    <apex:commandLink action="{! Previous }" value="« Previous"
                         rendered="{! HasPrevious }"/>
                <!-- inactive (no earlier pages) -->
                    <apex:outputText style="color: #ccc;" value="« Previous"
                         rendered="{! NOT(HasPrevious) }"/>

                    &nbsp;&nbsp;  

                <!-- Next page -->
                <!-- active -->
                    <apex:commandLink action="{! Next }" value="Next »"
                         rendered="{! HasNext }"/>
                <!-- inactive (no more pages) -->
                    <apex:outputText style="color: #ccc;" value="Next »"
                           rendered="{! NOT(HasNext) }"/>
                <!-- Next page -->
                </td>
    
                <td align="right">
                <!-- Records per page -->
                    Records per page:
                    <apex:selectList value="{! PageSize }" size="1">
                        <apex:selectOption itemValue="5" itemLabel="5"/>
                        <apex:selectOption itemValue="20" itemLabel="20"/>
                        <apex:actionSupport event="onchange" reRender="contacts_list"/>
                    </apex:selectList>
                </td>
                

                </tr></table>

                <apex:column value="{! ct.FirstName }"/>
                <apex:column value="{! ct.LastName }"/>
                <apex:column value="{! ct.Email }"/>
                   <apex:column value="{! ct.Account.Name }"/>
            </apex:pageBlockTable>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>
Working through the Trailhead Visualforce Beginner section and working in the Using Standard List Controller section.  Following through the lesson, I am trying to get the pagination section to work but cannot seem to.  I have tried like 5 times now.  Any ideas on what I am doing wrong?

<apex:page standardController="Contact" recordSetVar="contacts">
    <apex:form>
        <apex:pageBlock title="Contacts List" id="contacts_list">
        
            Filter: 
            <apex:selectList value="{! filterId }" size="1">
                <apex:selectOptions value="{! listViewOptions }"/>
                <apex:actionSupport event="onchange" reRender="contacts_list"/>
            </apex:selectList>
        
            <!-- Contacts List -->
            <apex:pageBlockTable value="{! contacts }" var="ct">
                <!-- Pagination -->
                <table style="width: 100%"><tr>
                <td>
                <!-- Page X of Y -->
                    Page: <apex:outputText
                          value=" {!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
                </td>            

                <td align="center">
                   <!-- Previous page -->
                <!-- active -->
                    <apex:commandLink action="{! Previous }" value="« Previous"
                         rendered="{! HasPrevious }"/>
                <!-- inactive (no earlier pages) -->
                    <apex:outputText style="color: #ccc;" value="« Previous"
                         rendered="{! NOT(HasPrevious) }"/>

                    &nbsp;&nbsp;  

                <!-- Next page -->
                <!-- active -->
                    <apex:commandLink action="{! Next }" value="Next »"
                         rendered="{! HasNext }"/>
                <!-- inactive (no more pages) -->
                    <apex:outputText style="color: #ccc;" value="Next »"
                           rendered="{! NOT(HasNext) }"/>
                <!-- Next page -->
                </td>
    
                <td align="right">
                <!-- Records per page -->
                    Records per page:
                    <apex:selectList value="{! PageSize }" size="1">
                        <apex:selectOption itemValue="5" itemLabel="5"/>
                        <apex:selectOption itemValue="20" itemLabel="20"/>
                        <apex:actionSupport event="onchange" reRender="contacts_list"/>
                    </apex:selectList>
                </td>
                

                </tr></table>

                <apex:column value="{! ct.FirstName }"/>
                <apex:column value="{! ct.LastName }"/>
                <apex:column value="{! ct.Email }"/>
                   <apex:column value="{! ct.Account.Name }"/>
            </apex:pageBlockTable>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>
 
Here is the code snippit:
trigger WorkOrderJobRollUp on Work_Order__c (before update, after insert, after delete, after undelete) {
    
    // Check to make sure work order is not being deleted
    IF (trigger.isdelete == FALSE)
    {
        // Run trigger for all situations with the exception of the AFE Approval process
        For(Work_Order__c wo : Trigger.New)
        {
            try
            {
                Work_Order__c beforeUpdate = Trigger.oldMap.get(wo.ID);
                system.debug('Work Order ID New: ' + wo.ID);
                system.debug('Work Order ID Old: ' + beforeUpdate.ID);
                
                string oldstatus = beforeUpdate.Work_Order_Status__c;
                
                system.debug('New WO Status: ' + wo.Work_Order_Status__c);
                system.debug('Old WO Status: ' + beforeUpdate.Work_Order_Status__c);
                system.debug('Old WO Status: ' + trigger.oldmap.get(wo.ID).Work_Order_Status__c);
                system.debug('Old WO Status: ' + oldstatus);
                   
                   IF (wo.Work_Order_Status__c == 'Approved' && beforeUpdate.Work_Order_Status__c == 'Pending Approval') return;
            }
            catch(exception e){}
        }
    }

Here is a snippit of the debug log:
14:09:14.853 (9285875790)|USER_DEBUG|[12]|DEBUG|Work Order ID New: a270j0000009ASKAA2 14:09:14.853 (9285880579)|STATEMENT_EXECUTE|[13] 14:09:14.853 (9285889523)|HEAP_ALLOCATE|[13]|Bytes:18 14:09:14.853 (9285894991)|HEAP_ALLOCATE|[13]|Bytes:37 14:09:14.853 (9285898897)|USER_DEBUG|[13]|DEBUG|Work Order ID Old: a270j0000009ASKAA2 14:09:14.853 (9285901596)|STATEMENT_EXECUTE|[15] 14:09:14.853 (9285907986)|VARIABLE_SCOPE_BEGIN|[15]|oldstatus|String|false|false 14:09:14.853 (9285914795)|VARIABLE_ASSIGNMENT|[15]|oldstatus|"Approved" 14:09:14.853 (9285916837)|STATEMENT_EXECUTE|[17] 14:09:14.853 (9285920997)|HEAP_ALLOCATE|[17]|Bytes:23 14:09:14.853 (9285925680)|USER_DEBUG|[17]|DEBUG|New WO Status: Approved 14:09:14.853 (9285928468)|STATEMENT_EXECUTE|[18] 14:09:14.853 (9285932040)|HEAP_ALLOCATE|[18]|Bytes:23 14:09:14.853 (9285935598)|USER_DEBUG|[18]|DEBUG|Old WO Status: Approved 14:09:14.853 (9285938221)|STATEMENT_EXECUTE|[19] 14:09:14.853 (9285964009)|HEAP_ALLOCATE|[19]|Bytes:23 14:09:14.853 (9285968749)|USER_DEBUG|[19]|DEBUG|Old WO Status: Approved 14:09:14.853 (9285971863)|STATEMENT_EXECUTE|[20] 14:09:14.853 (9285974149)|HEAP_ALLOCATE|[20]|Bytes:23 14:09:14.853 (9285978158)|USER_DEBUG|[20]|DEBUG|Old WO Status: Approved

The value of the Work Order Status field is changing from Pending Approval to Approved and I don't want the body of the trigger to fire off when this happens.  How does the Trigger.newmap and trigger.oldmap values equal each other?
We have seen the SSO errors with Salesforce happen sporadically. Any advice?  Here is the error I get:

Single Sign-On Error
We can't log you in. Check for an invalid assertion in the SAML Assertion Validator (available in Single Sign-On Settings) or check the login history for failed logins.

The logins will work in subsequent attempts. Here's what I've found in the login history. As you can see, the login succede and fail randomly:

Username Login Time (Eastern Daylight Time) Source IP Login Type Status Browser Platform Application Client Version API Type API Version Login URL TLS Protocol TLS Cipher Suite Country Code Country Subdivision City PostalCode Latitude Longitude
abc@abc.com 1/19/2017 9:30 209.36.16.130 SAML Sfdc Initiated SSO Success Chrome 55 Windows 7 Browser N/A N/A N/A abc.my.salesforce.com TLS 1.2 ECDHE-RSA-AES256-GCM-SHA384 US United States Rhode Island West Warwick 2893 41.697 -71.5254
abc@abc.com 1/19/2017 9:05 209.36.16.130 SAML Sfdc Initiated SSO Failed: InResponseTo Invalid Chrome 55 Windows 7 Browser N/A N/A N/A abc.my.salesforce.com TLS 1.2 ECDHE-RSA-AES256-GCM-SHA384
abc@abc.com 1/19/2017 9:05 209.36.16.130 SAML Sfdc Initiated SSO Failed: InResponseTo Invalid Chrome 55 Windows 7 Browser N/A N/A N/A abc.my.salesforce.com TLS 1.2 ECDHE-RSA-AES256-GCM-SHA384
abc@abc.com 1/19/2017 9:02 209.36.16.130 SAML Sfdc Initiated SSO Success Chrome 55 Windows 7 Browser N/A N/A N/A abc.my.salesforce.com TLS 1.2 ECDHE-RSA-AES256-GCM-SHA384 US United States Rhode Island West Warwick 2893 41.697 -71.5254
abc@abc.com 1/19/2017 8:56 209.36.16.130 SAML Sfdc Initiated SSO Failed: InResponseTo Invalid Chrome 55 Windows 7 Browser N/A N/A N/A abc.my.salesforce.com TLS 1.2 ECDHE-RSA-AES256-GCM-SHA384
Without using code, is there a way to filter the child related list on the masters detail page?  The use case is we have a group of sites where we track the people that are currently on that site.  We want to be able to show just the people that are currently on that site.  We setup an object that is the list of sites and a child object that is a list of the people that have visited the site with a check in date and time and a check out date and time.  The ask is to have a list of the users which do not have a check out date and time filled in display in the related list on the master records detail page.  The only way I can seem to accomplish this is with a custom VF page.  Is there a way to do this natively in SF without the VF page?
Working through the Trailhead Visualforce Beginner section and working in the Using Standard List Controller section.  Following through the lesson, I am trying to get the pagination section to work but cannot seem to.  I have tried like 5 times now.  Any ideas on what I am doing wrong?

<apex:page standardController="Contact" recordSetVar="contacts">
    <apex:form>
        <apex:pageBlock title="Contacts List" id="contacts_list">
        
            Filter: 
            <apex:selectList value="{! filterId }" size="1">
                <apex:selectOptions value="{! listViewOptions }"/>
                <apex:actionSupport event="onchange" reRender="contacts_list"/>
            </apex:selectList>
        
            <!-- Contacts List -->
            <apex:pageBlockTable value="{! contacts }" var="ct">
                <!-- Pagination -->
                <table style="width: 100%"><tr>
                <td>
                <!-- Page X of Y -->
                    Page: <apex:outputText
                          value=" {!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>
                </td>            

                <td align="center">
                   <!-- Previous page -->
                <!-- active -->
                    <apex:commandLink action="{! Previous }" value="« Previous"
                         rendered="{! HasPrevious }"/>
                <!-- inactive (no earlier pages) -->
                    <apex:outputText style="color: #ccc;" value="« Previous"
                         rendered="{! NOT(HasPrevious) }"/>

                    &nbsp;&nbsp;  

                <!-- Next page -->
                <!-- active -->
                    <apex:commandLink action="{! Next }" value="Next »"
                         rendered="{! HasNext }"/>
                <!-- inactive (no more pages) -->
                    <apex:outputText style="color: #ccc;" value="Next »"
                           rendered="{! NOT(HasNext) }"/>
                <!-- Next page -->
                </td>
    
                <td align="right">
                <!-- Records per page -->
                    Records per page:
                    <apex:selectList value="{! PageSize }" size="1">
                        <apex:selectOption itemValue="5" itemLabel="5"/>
                        <apex:selectOption itemValue="20" itemLabel="20"/>
                        <apex:actionSupport event="onchange" reRender="contacts_list"/>
                    </apex:selectList>
                </td>
                

                </tr></table>

                <apex:column value="{! ct.FirstName }"/>
                <apex:column value="{! ct.LastName }"/>
                <apex:column value="{! ct.Email }"/>
                   <apex:column value="{! ct.Account.Name }"/>
            </apex:pageBlockTable>
        
        </apex:pageBlock>
    </apex:form>
</apex:page>
I am trying to complete the challenge of the Integrating External Data challenge, and am hitting an 'interesting' problem.  I believe I've gone through all the steps correctly, but an getting the error below:

The 'Phone__x' external object is not correctly setup with an indirect relationship to the User standard object.

When I go do External Objects/phones/edit UUID I can see the UUID field definition.  I have numerous times clicked on Change FIeld Type/Indirect Lookup Relationship/Related to User/Target Field Phone_UUID__c/Next/Save.  Each time I go though that when I get to the Target Field value the value is set to --None--.  It's acting like it forgets that I gave it a value.  That would explain the error message

Any ideas as to how I can get around this?

Thanks
Hi ,
I was trying to solve the trailhead challenge under "Using Static Resources".

Am getting following message:
Challenge not yet complete... here's what's wrong: 
The page does not include a reference to the specified image

Following code am using.
<apex:page >
            <apex:pageBlock title="Pic" >
                    <apex:pageBlockSection >
                         <apex:image value="{!URLfor($Resource.vfimagetest, '/cats/kitten1.jpg')}"/>
                    </apex:pageBlockSection>
             </apex:pageBlock>
</apex:page>
Am I missing something here?

Regards,
Manjunath C Sarashetti

We have a custom object that uses an auto number field to uniquely identify each record.

 

For a number of internal reasons we have to use sharepoint document libraries to manage attachments.  This policy will never change until SF.com incorporates versions and check in/check out within the content module.

 

Has anybody ever built a custom button that would automatically create a new folder within an existing sharepoint document library.

 

For example:

 

  1. Our custom SF.com object is called "Deal Request", the auto number field is called "DR Number".
  2. Our document library is located at www.test.com\sharepoint\documents  
  3. When a new deal request record is created the user would be able to push a button called "create attachments folder"
  4. Pushing the button would automatically create a new folder in the existing document library:  www.test.com\sharepoint\documents\drnumber  (where dr number is the new number assigned to the new record just created).

Has anyone ever done something like this?  Could you provide any tips or tricks to look for?

 

Thanks in advance.