• Alain Cabon
  • ALL STAR
  • 7389 Points
  • Member since 2016

  • Chatter
    Feed
  • 242
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1519
    Replies
Hi there

I have an Amazon VM Windows server and I have a Powershell script to download a CSV file. The date format in the CSV file is DD/MM/YYYY. I can't change the date format in the file becaus this is intended to be a daily automated process. Lots of people on the forum have problems with dates going in one day offset etc. but this problem is something else...

The Powershell script runs Data Loader on the command line to load the CSV file. Data Loader settings have the 'Use European Date Format' checked.

The server Control Panel has all the regional settings, time zone etc. set to UK.

I'm loading the dates in the CSV file into SF Date type field.

Problem is that the dates get transposed, e.g. June 1st 2018 in the file is 01/06/2018 but ends up in SF as Jan 6th.

Does anyone have any ideas? My workaround will be to load it into a text field and then convert/transpose it but I'd rather not. And I shouldn't have to should I?

Thanks in advance.

 
I’d like to combine two fields and another field that contains a string text of @domain.com to output to field called email.

I’d like to insert a period between the first and last name fields too. The final output should look like:

john.smith@domain.com

I’m not sure how I should create a field for the “.” and the “@domain” in order to create the necessary output.

i started with this but not sure how I’d create with a formula.

First_Name__c & " " &
Last_Name__c & “ ” &

@domain.com

thank you!
HI, I have a 'simple' trigger on the opportunity which creates new contact role entry whenever the Contact__c is changed. So the trigger is Before Update.
 
If(Trigger.IsUpdate){ //** 18/12/2017 - Changed from Insert to Update.. 
        For (Opportunity Opp: Trigger.new){
            if (Trigger.oldMap.get(opp.Contact__c) != null) { //** So we have a contact !!
               Opportunity OldContact = trigger.oldmap.get(Opp.Contact__c);
               If (Opp.Contact__c == OldContact.Id){
                   System.debug('** * ** ||AutoSetOpportunityLookupValues.Trigger - Old Contact....:'+OldContact);
                   System.debug('** * ** ||AutoSetOpportunityLookupValues.Trigger - New Contact....:'+Opp.Contact__c);
               }
            }
        }
So at first in my unit test I create opportunity without contact. All is fine. Then I perform several updates. One of these is to actually update the Contact__c with a value (contact Id) as it's a lookup.
NewQualificationOpportunity.VAT_Included__c = false;
         NewQualificationOpportunity.Contact__c = NewContactII.id;
         NewQualificationOpportunity.StageName='Written Approval';
         Update NewQualificationOpportunity;

However ... 

               Opportunity OldContact = trigger.oldmap.get(Opp.Contact__c);
               If (Opp.Contact__c == OldContact.Id){

are never touched ....

 
I want clean all the data in my org. How is the easiest way to do this?
Hi

How do you test the Lead Convert where you have selected the following from the UI:
  • New account should be created
  • Existing contact is selected
  • No opportunities
The documentation states, that you can use LeadConvert.setConvertedContactId, but then you have to set the ConvertedAccountId to be the same - but this contradicts what my use case is.
public static testMethod void myTest(){
        Contact existingContact = TestUtil.createContact(true);

        Lead ld = TestUtil.createLead(false);
        ld.FirstName = 'FirstName';
        ld.LastName = 'LastName';
        ld.ContactPersonFirstName__c = 'NOT FirstName';
        ld.ContactPersonLastName__c = 'NOT LastName';
        insert ld;

        Database.LeadConvert lc = new Database.LeadConvert();
        lc.setLeadId(ld.id);
        LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted = true LIMIT 1];
        lc.setConvertedStatus(convertStatus.MasterLabel);
// This is where I chose the existing contact, but as I want a new account created, then I do not specify an account id
        lc.setContactId(existingContact.Id); 

        Test.startTest();
        Database.LeadConvertResult lcr = null;
        User testUserContext = TestUtil.getTestContextUser(true);
        System.runAs(testUserContext) {
// Here is fails
            lcr = Database.convertLead(lc); 
        }
        Test.stopTest();
I get the error: System.DmlException: ConvertLead failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, accountId must be specified if contactId is not null: [Id]
Hi there, I am trying to emulate the "convert lead" action on a custom object of mine which I've made a path for (see below)User-added image

When I click on the final stage in my Path, I would like it to generate a pop-up that will then let me create new records in related objects.  Is this possible?  Here is a picture of what im talking about.

User-added image

If anyone could should me how to do this I would really appreciate it!
I am trying to upload (via Data Loader) Products and their related SKUs.  I am not able to map to the Product SKU field in Data Loader, although I made certain the field is not hidden in the org.  I have tried to upload the Product SKU separately from the Product, to no avail.  All fields are able to be mapped, including custom fields, except for this Salesforce standard field.  

Many thanks for your assistance!

Data Loader Screen Print - Product SKU Field is Not Available
Hello Everyone,

I am trying to create 2 boxes that I can place Apex:Outputfield's inside to have Salesforce populate the To's and From's for my document.

User-added image
I need the page to RenderAs="PDF" so i am limited to the older css styling rather than the new SLDS styling

below is my code so far:
<apex:page standardController="Account" renderAs="pdf" >
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
            <style type="text/css">
                body {
                font-family: sans-serif;
                font-size:12px;
                }
            </style>      
        </head>    
        <body>   
            <table cellpadding="6" width="100%">
                <tr>
                    <td>
                        <apex:outputPanel >
                            <apex:image url="/servlet/servlet.FileDownload?file=0151D0000005bAO" width="150" Height="75"/>
                        </apex:outputPanel>
                    </td>
                    <td>
                        <apex:outputPanel >
                            Case Information
                        </apex:outputPanel>
                    </td>
                    <td>
                        <apex:outputPanel >
                            Form 2067
                        </apex:outputPanel>
                    </td>    
                </tr>
            </table>  
              <table cellpadding="6" width="70%">
                <tr>
                    <td>
                        <apex:outputPanel >
                            To:
                        </apex:outputPanel>
                    </td>
                    <td>
                        <apex:outputPanel >
                            From:
                        </apex:outputPanel>
                    </td>

                </tr>
            </table>           
            
            
        </body>
    </html>
</apex:page>

Any Ideas?
Hello, there! I've checked all similar posts but still wasn't able to solve the problem. This is a pretty simple trigger from Trailhead:
trigger RestrictContactByName on Contact (before insert, before update) {
	
	//check contacts prior to insert or update for invalid data
	For (Contact c : Trigger.New) {
		if(c.LastName == 'INVALIDNAME') {	//invalidname is invalid
			c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML.');
		}

	}
}
This is my test class. The test class can get me 100% code coverage and the UI operation all works beautifully. The issue is the test result returned "System.AssertException: Assertion Failed" error at Line 15. Can anyone please explain to me why this is happening? Is it about Database opertion or DML statements? Thank you so much!
@isTest
private class TestRestrictContactByName {
    
     @isTest static void TestLastNameIsvalid() {	
        // Test data setup
        // Create a contact with a valid Last Name, and then try to insert/update it.
 		Contact c = new Contact (FirstName='Kathy',LastName='Smith',Department='Technology');
        insert c;
        // Perform test
        Test.startTest();
        Database.SaveResult result = Database.insert(c, false);
        Test.stopTest();
        // Verify 
        // In this case the insert/update should have been processed.
        System.assert(result.isSuccess());
    }          
    
    @isTest static void TestLastNameIsNotInvalid() {
        // Test data setup
        // Create a contact with a Last Name of 'INVALIDNAME', and then try to insert/update it.
        Contact c2 = new Contact (FirstName='Joe',LastName='INVALIDNAME',Department='Finance');
        insert c2;
        // Perform test
        Test.startTest();
        Database.SaveResult result = Database.insert(c2, false);
        Test.stopTest();
        // Verify 
        // In this case the deletion should have been stopped by the trigger,
        // so verify that we got back an error.
        System.assert(!result.isSuccess());
        System.assert(result.getErrors().size() > 0);
        System.assertEquals('The Last Name "INVALIDNAME" is not allowed for DML.',
                             result.getErrors()[0].getMessage());
    }   
}





 
Never received a final response to my last question... really need to get this one working.  Can someone help?

I am getting this error and I don't know why:
Action failed: ui:inputSelect$controller$valueChange [Maximum call stack size exceeded]

COMPONENT CODE:
<aura:component access="global" controller="DependentPicklistTestController">
    <aura:attribute name="object" type="String"/>
    <aura:attribute name="controllingField" type="String"/>
    <aura:attribute name="dependentField" type="String"/>
    <aura:attribute name="selectedValue" type="String"/>
    <aura:attribute name="fieldName" type="String"/>
    <aura:attribute name="selectedDependentOption" type="String"/>
    <aura:attribute name="isDependentDisable" type="Boolean" default="false"/>
    <aura:handler name="init" value="{!this}" action="{!c.loadOptions}" /> 
    
    <ui:outputText value="{!v.fieldName}"/>:&nbsp;&nbsp;&nbsp;<ui:inputSelect aura:id="picklistOptions" 
                                                                              disabled="{!v.isDependentDisable}" 
                                                                              class="slds-input" 
                                                                              labelClass="slds-form-element__label"
                                                                              value="{!v.selectedOption}"
                                                                              required="true"
                                                                              onError="{!c.handleError}"
                                                                              onClearErrors="{!c.handleClearError}"/>
</aura:component>

JS CONTROLLER CODE:
({
	loadOptions : function(component, event, helper) {      
        helper.getOptionsHp(component, component.get("v.object"), component.get("v.controllingField"), component.get("v.dependentField"), component.get("v.selectedValue"));
    }
})

JS HELPER CODE:
({
    /*
     * Function to get all picklist values for a controlling/dependent pair
     */
    
    getOptionsHp: function(component, obj, controllingField, dependentField, selectedValue) {
        var optionValues = [];  
        var action;
        
        if(dependentField == "NULL"){            
        	action = component.get("c.getTopLevelOptionsApx");
            action.setParams({ 
                'obj' : obj,
                'field' : controllingField});
        }
        else{       
        	action = component.get("c.getOptionsApx"); 
            action.setParams({
                'obj' : obj,
                'controllingField' : controllingField,
                'dependentField' : dependentField});
        }
        action.setCallback(this, function(response) {
            var state = response.getState();  
            if (state === "SUCCESS" && !$A.util.isEmpty(response.getReturnValue()) && !$A.util.isUndefined(response.getReturnValue())) {  
                var returnedValues = response.getReturnValue();
                component.set("v.optionsMap",returnedValues);
                
                optionValues.push({
                    class: "optionClass",
                    label: "--- None ---",
                    value: "--- None ---",
                    selected: true
                });
                
                if($A.util.isUndefined(selectedValue) || $A.util.isEmpty(selectedValue) || selectedValue == "NULL"){
                    for(var i = 0; i < returnedValues.length; i++){
                        optionValues.push({
                            class: "optionsClass",
                            label: returnedValues[i],
                            value: returnedValues[i]
                        })
                    }
                }
                else{
                    for(var i = 0; i < Object.values(returnedValues[selectedValue]).length; i++){
                        optionValues.push({
                            class: "optionsClass",
                            label: Object.values(returnedValues[selectedValue])[i],
                            value: Object.values(returnedValues[selectedValue])[i]
                        })
                    }
                }
                
                component.find("picklistOptions").set("v.options",optionValues);
            }
            else if(state === "ERROR"){
                ('A problem occurred: ' + JSON.stringify(response.error));
            }
        });
        
        $A.enqueueAction(action);
    }
})

If I comment out this line the error goes away, but then again so does the information I need!:
 
component.find("picklistOptions").set("v.options",optionValues);

​APEX CONTROLLER CODE:
public class DependentPicklistTestController {
    
    /*
     * Retrieve all controlling and dependent picklist options
     */
    
    @AuraEnabled
    public static Map<String,List<String>> getOptionsApx(String obj, String controllingField, String dependentField){        
        Map<String,List<String>> optionsMap = new Map<String,List<String>>();
        DependentPicklistController dpc = new DependentPicklistController();
        optionsMap = dpc.getOptions(obj, controllingField, dependentField);       
        return optionsMap;
    }
    
    /*
     * Retrieve all picklist options for top-level fields (those which have no dependencies)
     */
    
    @AuraEnabled
    public static List<String> getTopLevelOptionsApx(String obj, String field){    
        List<String> options = new List<String>();        
        Schema.SObjectType objectType = Schema.getGlobalDescribe().get(obj);
        Map<String, Schema.SObjectField> fieldMap = objectType.getDescribe().fields.getMap();        
        Schema.DescribeFieldResult fieldResults = fieldMap.get(field).getDescribe();
        List<Schema.PicklistEntry> ples = fieldResults.getPicklistValues();        
        for(Schema.PicklistEntry ple : ples){
            options.add(ple.getValue());    
        }        
        return options;
    }
}

Any help you can provide is greatly appreciated!

Thanks!
in a System.AssertEquals() is it possible to have some kind of logic in the expected outcome? For example, if I just need the expected outcome to be greater than 0.
 
System.AssertEquals(database.countquery('SELECT ts2__Placement__r.TCEDaudit__c FROM Placement'), > 1 );

 

I am going through the SLDS trail as follows:
Trailhead > Develop for Lightning Experience > Lightning Design System > Use Images, Icons, and Avatars
https://trailhead.salesforce.com/trails/lex_dev/modules/lightning_design_system/units/lightning-design-system5

In the Page Header section, a box is supposed to display an avatar alongside the header text "Accounts / My Accounts".  What I get is a missing image indicator and the brower console gives me a 404 error.

The code in question looks like this:

<img src="{!URLFOR($Asset.SLDS, '/assets/images/avatar1.jpg')}" alt="" />

(along with appropriate spans and divs)   Looking into the Visualforce documentation, I see that the path to assets should be without the leading slash, so the code should look like this:

<img src="{!URLFOR($Asset.SLDS, 'assets/images/avatar1.jpg')}" alt="" />
but that doesn't work, either.

Question:  how do you reference Salesforce assets in this context?

My full code is below.  (This whole module is very difficult to use because the code samples appear all on one (long) line without line breaks, making them very difficult to copy/paste.)
 

<apex:page showHeader="false" standardStylesheets="false" sidebar="false" 
           applyHtmlTag="false" applyBodyTag="false" docType="html-5.0"> 
    <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en"> 
        <head> 
            <meta charset="utf-8" /> 
            <meta http-equiv="x-ua-compatible" content="ie=edge" /> 
            <title>Salesforce Lightning Design System Trailhead Module</title> 
            <meta name="viewport" content="width=device-width, initial-scale=1" /> 
            <!-- Import the Design System style sheet --> 
            <apex:slds /> 
        </head> 
        <apex:remoteObjects > 
            <apex:remoteObjectModel name="Account" fields="Id,Name,LastModifiedDate"/> 
        </apex:remoteObjects> 
        <body>            
            <!-- REQUIRED SLDS WRAPPER --> 
            <div class="slds-scope"> 
                <!-- MASTHEAD --> 
                <p class="slds-text-heading--label slds-m-bottom--small"> 
                    Salesforce Lightning Design System Trailhead Module 
                </p> 
                <!-- / MASTHEAD --> 
                <!-- PAGE HEADER --> 
                <div class="slds-page-header" role="banner"> 
                    <div class="slds-grid"> 
                        <div class="slds-col slds-has-flexi-truncate"> 
                            <!-- HEADING AREA --> 
                            <div class="slds-media slds-no-space slds-grow"> 
                                <div class="slds-media__figure"> 
                                    <span class="slds-avatar slds-avatar--medium"> 
                                        <img src="{!URLFOR($Asset.SLDS, 'assets/images/avatar1.jpg')}" 
                                             alt="" />
                                    </span> 
                                </div> 
                                <div class="slds-media__body"> 
                                    <p class="slds-text-title--caps slds-line-height--reset">
                                        Accounts
                                    </p> 
                                    <h1 class="slds-page-header__title slds-m-right--small slds-align-middle slds-truncate" 
                                        title="My Accounts">
                                        My Accounts
                                    </h1> 
                                </div> 
                            </div> 
                            <!-- / HEADING AREA -->
                        </div> 
                        <div class="slds-col slds-no-flex slds-grid slds-align-top"> 
                            <button class="slds-button slds-button--neutral">
                                New Account
                            </button> 
                        </div> 
                    </div> 
                    <div class="slds-grid"> 
                        <div class="slds-col slds-align-bottom slds-p-top--small"> 
                            <p class="slds-text-body--small page-header__info">
                                COUNT items
                            </p> 
                        </div> 
                    </div> 
                </div> 
                <!-- / PAGE HEADER -->                
                <!-- PRIMARY CONTENT WRAPPER --> 
                <div class="myapp"> 
                    <!-- CREATE NEW ACCOUNT --> 
                    <div aria-labelledby="newaccountform"> 
                        <!-- CREATE NEW ACCOUNT FORM --> 
                        <form class="slds-form--stacked" id="add-account-form"> 
                            <!-- BOXED AREA --> 
                            <fieldset class="slds-box slds-theme--default slds-container--small"> 
                                <legend id="newaccountform" class="slds-text-heading--medium slds-p-vertical--medium">
                                    Add a new account
                                </legend> 
                                <div class="slds-form-element"> 
                                    <label class="slds-form-element__label" for="account-name">
                                        Name
                                    </label> 
                                    <div class="slds-form-element__control"> 
                                        <input id="account-name" class="slds-input" type="text" 
                                               placeholder="New account"/> 
                                    </div> 
                                </div> 
                                <button class="slds-button slds-button--brand slds-m-top--medium" type="submit">
                                    Create Account
                                </button> 
                            </fieldset> 
                            <!-- / BOXED AREA --> 
                        </form> 
                        <!-- CREATE NEW ACCOUNT FORM --> 
                    </div> 
                    <!-- / CREATE NEW ACCOUNT -->
                    <!-- ACCOUNT LIST TABLE --> 
                    <div id="account-list" class="slds-p-vertical--medium">
                        
                    </div> 
                    <!-- / ACCOUNT LIST TABLE --> 
                </div> 
                <!-- / PRIMARY CONTENT WRAPPER -->
                
                <!-- FOOTER --> 
                <footer role="contentinfo" class="slds-p-around--large"> 
                    <!-- LAYOUT GRID --> 
                    <div class="slds-grid slds-grid--align-spread"> 
                        <p class="slds-col">Salesforce Lightning Design System Example</p> 
                        <p class="slds-col">&copy; Your Name Here</p> 
                    </div> 
                    <!-- / LAYOUT GRID --> 
                </footer> 
                <!-- / FOOTER -->            
            </div> 
            <!-- / REQUIRED SLDS WRAPPER --> 
            <!-- JAVASCRIPT --> 
            <script> 
            (function() { 
                var account = new SObjectModel.Account(); 
                var outputDiv = document.getElementById('account-list'); 
                var updateOutputDiv = function() { 
                    account.retrieve( { 
                        orderby: [{ LastModifiedDate: 'DESC'}, 
                                  { Name: 'ASC'}
                                 ]//, 
                        //limit: 10 
                    }, function(error, records) { 
                        if (error) { 
                            alert(error.message); 
                        } else { 
                            // create data table 
                            var dataTable = document.createElement('table'); 
                            dataTable.className = 'slds-table slds-table--bordered slds-table--cell-buffer slds-no-row-hover'; 
                            // add header row 
                            var tableHeader = dataTable.createTHead(); 
                            var tableHeaderRow = tableHeader.insertRow(); 
                            var tableHeaderRowCell1 = tableHeaderRow.insertCell(0); 
                            tableHeaderRowCell1.appendChild(document.createTextNode('Account name')); 
                            tableHeaderRowCell1.setAttribute('scope', 'col'); 
                            tableHeaderRowCell1.setAttribute('class', 'slds-text-heading--label'); 
                            var tableHeaderRowCell2 = tableHeaderRow.insertCell(1); 
                            tableHeaderRowCell2.appendChild(document.createTextNode('Account ID')); 
                            tableHeaderRowCell2.setAttribute('scope', 'col'); 
                            tableHeaderRowCell2.setAttribute('class', 'slds-text-heading--label'); 
                            var tableHeaderRowCell3 = tableHeaderRow.insertCell(2); 
                            tableHeaderRowCell3.appendChild(document.createTextNode('Last Mod')); 
                            tableHeaderRowCell3.setAttribute('scope', 'col'); 
                            tableHeaderRowCell3.setAttribute('class', 'slds-text-heading--label'); 
                            // build table body 
                            var tableBody = dataTable.appendChild(document.createElement('tbody')); 
                            var dataRow, dataRowCell1, dataRowCell2, dataRowCell3, recordName, recordId; 
                            records.forEach(function(record) { 
                                dataRow = tableBody.insertRow(); 
                                dataRowCell1 = dataRow.insertCell(0); 
                                recordName = document.createTextNode(record.get('Name')); 
                                dataRowCell1.appendChild(recordName); 
                                dataRowCell2 = dataRow.insertCell(1); 
                                recordId = document.createTextNode(record.get('Id')); 
                                dataRowCell2.appendChild(recordId); 
                                dataRowCell3 = dataRow.insertCell(2); 
                                lastMod = document.createTextNode(record.get('LastModifiedDate')); 
                                dataRowCell3.appendChild(lastMod); 
                            }); 
                            if (outputDiv.firstChild) { 
                                // replace table if it already exists 
                                // see later in tutorial 
                                outputDiv.replaceChild(dataTable, outputDiv.firstChild); 
                            } else { 
                                outputDiv.appendChild(dataTable); 
                            } 
                        } 
                    } ); 
                } 
                updateOutputDiv(); 
            })(); 
            var accountForm = document.getElementById('add-account-form'); 
            var accountNameField = document.getElementById('account-name'); 
            var createAccount = function() { 
                var account = new SObjectModel.Account(); 
                account.create({ Name: accountNameField.value }, 
                               function(error, records) { 
                                   if (error) { 
                                       alert(error.message); 
                                   } else { 
                                       updateOutputDiv(); 
                                       accountNameField.value = ''; 
                                   } 
                               }); 
            } 
            accountForm.addEventListener('submit', 
                                         function(e) { 
                                             e.preventDefault(); 
                                             createAccount(); 
                                         }
                                        );
            </script> 
            <!-- / JAVASCRIPT -->
        </body> 
    </html> 
</apex:page>
Hi peeps, I need to create a report that shows a % of how many opportunities moved from stage to stage 
User-added image
This was created in excel and would like to create it in salesforce. Basically the way it was calculated was using a simple =SUMIFS(oppys amount,sales qualified stage,"x")/SUMIFS(oppys amount,unqualified stage,"x") formula.

Please help me understand if this is possible to re-create in salesforce or not. My VP of sales is counting on me. 
I wrote a Flow that works to update a field in a custom Object (Sample_Submission_Form__C, I think.  Maybe it's just Sample Submission Form).  I followed instructions I found on a website that showed how to invoke a Flow through a VF page.  The VF page already creates a pdf, and I added this code to the bottom of it.  But I'm getting an error: "
Error: The element type "s" must be terminated by the matching end-tag "</s>"."   Also, the Flow name is shown below, but the URL is just "UpdateSSFstatusToSubmitted".  Can someone tell me how to fix it?  Thanks
<standardController="Sample_Submission_Form__c">
<flow:interview name="UpdateSSFstatusToSubmitted_v3"/>
    <apex:param name="Sample_Submission_Form__c.ID" value="{!Sample_Submission_Form__c.ID}"/>
</flow:interview>

</apex:page>

 
if yes, can these fields be pulled into opportunities/and opportunity reports?
Hi,

I'm stuck (real stuck) .. as to working on the following challenge. We have many accounts and each account can have several entitlements. Some even have 20 !. Now, these accounts also have multiple contacts. We have performed import of accounts, contacts and entitlements but now I want to insert all (account) contactId's with all (account) entitlementid's into the entitlementcontact object. Like for example acount Y has 2 contacts and 3 entitlements. This should give 6 rows inside Entitlement contacts. However ... some records are already there as we are onboarding another team 

So I managed to create some code ... however I keep running into the following error: Before Insert or Upsert list must not have two identically equal elements

Below my complete code ... maybe i'm on the wrong trail here but ive tried several other ways. Joining data within Excel is not really within my conform zone. All support is much appreciated.
 
List<Id> contactIds = new List<Id>();
List<Id> EntIds = new List<Id>();
List<EntitlementContact> NewEnTlCont = new List<EntitlementContact>();
List<Account> listAccount = [select id,Name ,(select id, Product__c from Entitlements), (select id, email from contacts) from account where IsService__c = true and id in (Select Accountid from entitlement where Asset.Config_ID__c != null and TierSupportLookup__c = 'a0T25000003e0cX' and status='Active' and Status__c = 'No' and CreatedById='0052X000007vbYw') limit 500];

system.debug(LoggingLevel.Info,'*** Numb of Accounts ' + listAccount.size());

For(Account acc : listAccount)
{
        EntitlementContact newEntCnt = new EntitlementContact();
	List<Contact> lstContact = acc.contacts;
	for(Contact cont :lstContact)
	{
		//System.debug(LoggingLevel.Info,cont.id+'('+cont.email+')');
            //**    contactIds.add(cont.id);

               List<Entitlement> lstEntitlement = acc.Entitlements;
               for(entitlement entl:lstentitlement){
            //      System.debug(LoggingLevel.Info,'*** ContactId:'+Cont.id+', EntitlementId:'+  entl.id);
                  contactIds.add(cont.id);
                  EntIds.add(entl.id);
                 
                    newEntCnt.ContactId = cont.id;
                    newEntCnt.EntitlementId = Entl.id;
                    NewEnTlCont.add(NewEntCnt);
                 
               }
	}
}
system.debug(LoggingLevel.Info,'*** contactIds:' + contactIds.size());
system.debug(LoggingLevel.Info,'*** EntIds:' + EntIds.size());
System.debug(logginglevel.info,'*** NewEnTlCont:'+NewEnTlCont.size());
Insert NewEnTlCont;


 
Hi, did anyone experince the following problem when working with <lightning:datatable>? (see images below). If menu window covers rows in grid, there is no problem. A workaround might be to add "empty" rows", but this comes with all implications for sorting. Is there a simpler, better solution?

Thanks in advance.
User-added image                            User-added image
Hello All,

I found some code online to help me create a custom Rollup-Summary solution. It works great in Sandbox. But the system says that one of the queries is non-selective (at least when I did a big delete event).

How is it non-selective? The WHERE clause is based upon a lookup field (which is about as specific an index as possible).

Here is the code:
 
public class RollUpSummaryUtility {
    //the following class will be used to house the field names
    //and desired operations
    public class fieldDefinition {
        public String operation {get;set;}
        public String childField {get;set;}
        public String parentField {get;set;}
        public fieldDefinition (String o, String c, String p) {
            operation = o;
            childField = c;
            parentField = p;
        }
    }
    public static void rollUpTrigger(list<fieldDefinition> fieldDefinitions,
                                     list<sObject> records, String childObject, String childParentLookupField,
                                     String parentObject, String queryFilter) {
                                         //Limit the size of list by using Sets which do not contain duplicate
                                         //elements prevents hitting governor limits
                                         set<Id> parentIds = new set<Id>();
                                         for(sObject s : records) {
                                             parentIds.add((Id)s.get(childParentLookupField));
                                         }
                                         //populate query text strings to be used in child aggregrator and
                                         //parent value assignment
                                         String fieldsToAggregate = '';
                                         String parentFields = '';
                                         for(fieldDefinition d : fieldDefinitions) {
                                             fieldsToAggregate += d.operation + '(' + d.childField + ') ' +
                                                 ', ';
                                             parentFields += d.parentField + ', ';
                                         }
                                         //Using dynamic SOQL with aggergate results to populate parentValueMap
                                         String aggregateQuery = 'Select ' + fieldsToAggregate +
                                             childParentLookupField + ' from ' + childObject + ' where ' +
                                             childParentLookupField + ' IN :parentIds ' + queryFilter + ' ' +
                                             ' group by ' + childParentLookupField;
                                         //Map will contain one parent record Id per one aggregate object
                                         map<Id, AggregateResult> parentValueMap =
                                             new map <Id, AggregateResult>();
                                         for(AggregateResult q : Database.query(aggregateQuery)){
                                             parentValueMap.put((Id)q.get(childParentLookupField), q);
                                         }
                                         //list of parent object records to update
                                         list<sObject> parentsToUpdate = new list<sObject>();
                                         String parentQuery = 'select ' + parentFields + ' Id ' +
                                             ' from ' + parentObject + ' where Id IN :parentIds';
                                         //for each affected parent object, retrieve aggregate results and
                                         //for each field definition add aggregate value to parent field
                                         for(sObject s : Database.query(parentQuery)) {
                                             Integer row = 0; //row counter reset for every parent record
                                             for(fieldDefinition d : fieldDefinitions) {
                                                 String field = 'expr' + row.format();
                                                 AggregateResult r = parentValueMap.get(s.Id);
                                                 //r will be null if no records exist
                                                 //(e.g. last record deleted)
                                                 if(r != null) {
                                                     Decimal value = ((Decimal)r.get(field) == null ) ? 0 :
                                                     (Decimal)r.get(field);
                                                     s.put(d.parentField, value);
                                                 } else {
                                                     s.put(d.parentField, 0);
                                                 }
                                                 row += 1; //plus 1 for every field definition after first
                                             }
                                             parentsToUpdate.add(s);
                                         }
                                         //if parent records exist, perform update of all parent records
                                         //with a single DML statement
                                         if(parentsToUpdate.Size() > 0) {
                                             update parentsToUpdate;
                                         }
                                     }
}

Can somebody tell me what I am missing?
I have an attribute that's an sObject like --- 
<aura:attribute name="myAttr" type="MyCustomObject__c"/>

I can get to all the fields via API name except Id.  A reference like {!v.myAttr.id} does not work.  A reference like {!v.myAttr.Name} works fine.

Is there some magic word to get the Id field from an Object in Lighting.

 
I'm trying to create a Visual Workflow + Process Builder that writes the Campaign of which a Lead is a Campaign Member to a custom field on the Lead called Campain_LD_Copy__c. (this is a workaround from this post). I got the Process + Flow to work when a Lead is a Campaign Member of a Campaign, however the Flow fails when the Lead is not part of a Campaign. I thought that adding a Decision node to the Flow could solve for this, but I get an error of "Failed to find records" when the FastLookup tries to find a CampaignMember, and I don't know how to solve for it. 

The first step in the Flow is a FastLookup for Campaign that matches the LeadId, and this seems to be where it's failing (when no record is found). Is there a better way to approach this? Assuming that if there is then my second step (Decision) may be unnecessary (see 2nd screenshot).

Step 1: Fast Lookup
User-added image

Step 2 (Decision):
User-added image


 
Hi there

I have an Amazon VM Windows server and I have a Powershell script to download a CSV file. The date format in the CSV file is DD/MM/YYYY. I can't change the date format in the file becaus this is intended to be a daily automated process. Lots of people on the forum have problems with dates going in one day offset etc. but this problem is something else...

The Powershell script runs Data Loader on the command line to load the CSV file. Data Loader settings have the 'Use European Date Format' checked.

The server Control Panel has all the regional settings, time zone etc. set to UK.

I'm loading the dates in the CSV file into SF Date type field.

Problem is that the dates get transposed, e.g. June 1st 2018 in the file is 01/06/2018 but ends up in SF as Jan 6th.

Does anyone have any ideas? My workaround will be to load it into a text field and then convert/transpose it but I'd rather not. And I shouldn't have to should I?

Thanks in advance.

 
Hi 

i have a formula that i implemented in Salesforce , but the result is not the same as in Excel 
formula in excel is : Tier = [0.72 * IF( NbrEmp>120000,1,IF(NbrEmp<65000,3,2)) + 0.75 * IF(MCap>72,1,IF(MCap<26,3,2)) + 0.56 * IF(CA>57,1,IF(CA<20,3,2)) ] /2.03

i replaced some variable by the field name in SF so in SF it s 
(0.72 * IF( NumberOfEmployees >120000,1,IF( NumberOfEmployees <65000,3,2)) + 0.75 * IF( Market_Capitalization__c >72000,1,IF( Market_Capitalization__c <26000,3,2)) + 0.55 * IF( Revenue__c >56000,1,IF(Revenue__c<20000,3,2))  ) /2.03 

but the result of the operation i have is different in Excel and SF ... 

is there any explication to that ? 
Hi

I am tring to write an SOQL Query to return all Contract Numbers from the Wessex Contract Table that match an entered Common fixing number, Please see the image below 

User-added image

Any help would be greatly apreciated

R
I'm trying to make a calculator lightning component and I got everything working fine up until the "burdenPer" field is edited. If it stays as it's default, the calculation is correct, but if that particular field is edited the calculation jumps down to the negative thousands. 

component:
<aura:component implements="flexipage:availableForAllPageTypes"
                access="global">
    
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="placement" type="ts2__Placement__c" />
    
        <force:recordData recordId="{!v.recordId}" 
                          targetFields="{!v.placement}" 
                          layoutType="FULL" 
                          recordUpdated="{!c.recordUpdated}"/>
        
    <aura:attribute name="burden" type="Integer" />
    <aura:attribute name="hours" type="Integer" default="40"/>
    <aura:attribute name="payrate" type="Decimal" default="0.00"/>
    <aura:attribute name="billrate" type="Decimal" default="0.00"/>
    <aura:attribute name="burdenPer" type="Decimal" default="0.20"/>

 	<!-- Overtime items -->
    <aura:attribute name="othours" type="Integer" default="0"/>
    <aura:attribute name="otbillrate" type="Decimal" default="0.00"/>
    <aura:attribute name="otpayrate" type="Decimal" default="0.00"/>
    
    <!--Net spread items -->
    <aura:attribute name="miscSpreadDed" type="Decimal" default="0.00"/>
    <aura:attribute name="nonbillexp" type="Decimal" default="0.00"/>
    <aura:attribute name="nonbilloth" type="Decimal" default="0.00"/>
    <aura:attribute name="nonbillbon" type="Decimal" default="0.00"/>
    <aura:attribute name="referfee" type="Decimal" default="0.00"/>
    <aura:attribute name="compbon" type="Decimal" default="0.00"/>
    <aura:attribute name="vms" type="Decimal" default="0.00"/>
    <aura:attribute name="discount" type="Decimal" default="0.00"/>
    <aura:attribute name="perdiem" type="Decimal" default="0.00"/>
    
    
    <aura:attribute name="spread" type="Decimal"/>
    <aura:attribute name="netspread" type="Decimal"/>

  
    <aura:registerEvent name="change" type="c:spreadEvent"/>
    
    <aura:handler name="change" value="{!v.hours}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.payrate}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.billrate}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.vms}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.discount}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.perdiem}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.othours}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.otbillrate}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.otpayrate}" action="{!c.calculateSpread}"/>
	<aura:handler name="change" value="{!v.burdenPer}" action="{!c.calculateSpread}"/>
    
    <aura:handler name="change" value="{!v.miscSpreadDed}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.nonbillexp}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.nonbilloth}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.nonbillbon}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.referfee}" action="{!c.calculateSpread}"/>
    <aura:handler name="change" value="{!v.compbon}" action="{!c.calculateSpread}"/>

    <aura:handler name="init" value="{!this}" action="{!c.calculateSpread}" />
	
	<div> <div class="title2">Spread Calculator: </div>
        <div class="input">
            <lightning:input aura:id="hours" type="number" label="Hours worked a week:" step="0.1" value="{!v.hours}"/>
            <lightning:input aura:id="payrate" type="number" label="Pay rate:" formatter="currency"  step="0.01" value="{!v.payrate}"/>
            <lightning:input aura:id="billrate" type="number" label="Bill Rate:" formatter="currency"  step="0.01" value="{!v.billrate}"></lightning:input>

            <!-- drop down code -->
            
            <div class="slds-page-header11" style="cursor: pointer;" onclick="{!c.sectionOne}">
              <section class="slds-clearfix">
                <div class="slds-float--left ">
                    <lightning:icon class="slds-show" aura:id="articleOne" iconName="utility:right" size="xx-small" alternativeText="Indicates add"/>
                    <lightning:icon class="slds-hide" aura:id="articleOne" iconName="utility:down" size="xx-small" alternativeText="Indicates dash"/>
                </div>
                <div class="slds-m-left-x-small">Overtime Entry (optional)</div>
              </section>
   			</div>
            <div class="slds-hide slds-p-around--medium" aura:id="articleOne">
               <lightning:input aura:id="othours" type="number" label="Overtime hours worked a week:" step="0.1" value="{!v.othours}"/>
               <lightning:input aura:id="otpayrate" type="number" label="Overtime Pay Rate:" formatter="currency" step="0.01" value="{!v.otpayrate}"/>
               <lightning:input aura:id="otbillrate" type="number" label="Overtime Bill Rate:" formatter="currency" step="0.01" value="{!v.otbillrate}"/>
            </div>
            
             
           
                        <lightning:input aura:id="burdenPer" type="number" label="Burden:" formatter="percent"  step="0.01" value="{!v.burdenPer}"></lightning:input>
						 <lightning:helptext content="Enter burden in decimal form. (Example: .03 = 3%)"/> 
           
        </div>
        <div class="result">
            Spread Amount: 
            <br/>
            <lightning:formattedNumber value="{!v.spread}" style="currency" currencyCode="USD"/>
        </div>
        
        <!-- Net Spread dropdown -->

            
        <div class="slds-page-header11" style="cursor: pointer;" onclick="{!c.sectionOne1}">
          <section class="slds-clearfix">
            <div class="slds-float--left ">
                <lightning:icon class="slds-show" aura:id="articleOne1" iconName="utility:right" size="xx-small" alternativeText="Indicates add"/>
                <lightning:icon class="slds-hide" aura:id="articleOne1" iconName="utility:down" size="xx-small" alternativeText="Indicates dash"/>
            </div>
            <div class="slds-m-left-x-small">Calculate Net Spread</div>
          </section>
    	</div>
        
        <div class="slds-hide slds-p-around--medium" aura:id="articleOne1">
                        <lightning:helptext content="Enter percentages in decimal form. (Example: .03 = 3%)"/> 

            <lightning:input aura:id="vms" type="number" label="VMS Fee:" formatter="percent"  step="0.01" value="{!v.vms}"></lightning:input>
            <lightning:input aura:id="discount" type="number" label="Discount Fee:" formatter="percent"  step="0.01" value="{!v.discount}"></lightning:input>
            <lightning:input aura:id="perdiem" type="number" label="Per Diem:" formatter="currency"  step="0.01" value="{!v.perdiem}"></lightning:input>
            <lightning:input aura:id="miscSpreadDed" type="number" label="Misc Spread Deductions:" formatter="currency"  step="0.01" value="{!v.miscSpreadDed}"></lightning:input>
            <lightning:input aura:id="nonbillexp" type="number" label="All Nonbillable Expenses" formatter="currency"  step="0.01" value="{!v.nonbillexp}"></lightning:input>
            <lightning:input aura:id="nonbilloth" type="number" label="Nonbillable Other Earnings" formatter="currency"  step="0.01" value="{!v.nonbilloth}"></lightning:input>
            <lightning:input aura:id="nonbillbon" type="number" label="Nonbillable Bonus" formatter="currency"  step="0.01" value="{!v.nonbillbon}"></lightning:input>
            <lightning:input aura:id="referfee" type="number" label="Referral Fees" formatter="currency"  step="0.01" value="{!v.referfee}"></lightning:input>
            <lightning:input aura:id="compbon" type="number" label="Completion Bonus" formatter="currency"  step="0.01" value="{!v.compbon}"></lightning:input>

 			<div class="result">
                Net Spread Amount: 
                <br/>
                <lightning:formattedNumber value="{!v.netspread}" style="currency" currencyCode="USD"/>
        	</div>        
        
        </div>

    </div>    
    
</aura:component>
helper:
({
	calculateSpread : function(component) {
        // 1. Calculate monthly payment
        var payrate = component.get("v.payrate");
        var billrate = component.get("v.billrate");
        var burdenPer = component.get("v.burdenPer");
        var hours = component.get("v.hours");
        var othours = component.get("v.othours");
        var otbillrate = component.get("v.otbillrate");
        var otpayrate = component.get("v.otpayrate");
        	 var vms = component.get("v.vms");
        	 var discount = component.get("v.discount");
        	 var perdiem = component.get("v.perdiem");
         	 var miscSpreadDed = component.get("v.miscSpreadDed");
             var nonbillexp = component.get("v.nonbillexp");
             var nonbilloth = component.get("v.nonbilloth");
             var nonbillbon = component.get("v.nonbillbon");
             var referfee = component.get("v.referfee");
             var compbon = component.get("v.compbon");
        
        
        if (payrate && billrate > 0){
            
            var totalBillings = (hours * billrate) + (othours * otbillrate);
            var totalPayroll = (hours * payrate) + (othours * otpayrate);
            var totburden = (1 + burdenPer)
            var spread = totalBillings - (totalPayroll * (totburden));
                
        	component.set("v.spread", spread);
            
            var vmsfee = billrate * (1- vms);
            var discountfee = billrate * (1-discount);
            
            var netVariables = (perdiem + miscSpreadDed + nonbillexp + nonbilloth + nonbillbon + vmsfee + discountfee + referfee + compbon)
            var netspread = spread - netVariables
            component.set("v.netspread", netspread);

            
            
            // 2. Fire event with new spread data
            var event = $A.get("e.c:spreadEvent");
            event.setParams({"payrate": payrate,
                             "billrate": billrate,
                             "burdenPer": burdenPer,
                             "vms": vms,
                             "discount": discount,
                             "hours": hours,
                             "perdiem": perdiem,
                             "othours": othours,
                             "otbillrate": otbillrate,
                             "otpayrate": otpayrate,
                                "miscSpreadDed": miscSpreadDed,
                                "nonbillexp": nonbillexp,
                                "nonbilloth": nonbilloth,
                                "nonbillbon": nonbillbon,
                                "referfee": referfee,
                                "compbon": compbon,
                             "netspread": netspread,
                             "spread": spread});
            event.fire();
        }
	},
    	helperFun : function(component,event,secId) {
	  var acc = component.find(secId);
        	for(var cmp in acc) {
        	$A.util.toggleClass(acc[cmp], 'slds-show');  
        	$A.util.toggleClass(acc[cmp], 'slds-hide');  
       }
	},
    
	helperFun1 : function(component,event,secId1) {
	  var acc1 = component.find(secId1);
        	for(var cmp1 in acc1) {
        	$A.util.toggleClass(acc1[cmp1], 'slds-show');  
        	$A.util.toggleClass(acc1[cmp1], 'slds-hide');  
       }
	}
})

 
I’d like to combine two fields and another field that contains a string text of @domain.com to output to field called email.

I’d like to insert a period between the first and last name fields too. The final output should look like:

john.smith@domain.com

I’m not sure how I should create a field for the “.” and the “@domain” in order to create the necessary output.

i started with this but not sure how I’d create with a formula.

First_Name__c & " " &
Last_Name__c & “ ” &

@domain.com

thank you!
HI, I have a 'simple' trigger on the opportunity which creates new contact role entry whenever the Contact__c is changed. So the trigger is Before Update.
 
If(Trigger.IsUpdate){ //** 18/12/2017 - Changed from Insert to Update.. 
        For (Opportunity Opp: Trigger.new){
            if (Trigger.oldMap.get(opp.Contact__c) != null) { //** So we have a contact !!
               Opportunity OldContact = trigger.oldmap.get(Opp.Contact__c);
               If (Opp.Contact__c == OldContact.Id){
                   System.debug('** * ** ||AutoSetOpportunityLookupValues.Trigger - Old Contact....:'+OldContact);
                   System.debug('** * ** ||AutoSetOpportunityLookupValues.Trigger - New Contact....:'+Opp.Contact__c);
               }
            }
        }
So at first in my unit test I create opportunity without contact. All is fine. Then I perform several updates. One of these is to actually update the Contact__c with a value (contact Id) as it's a lookup.
NewQualificationOpportunity.VAT_Included__c = false;
         NewQualificationOpportunity.Contact__c = NewContactII.id;
         NewQualificationOpportunity.StageName='Written Approval';
         Update NewQualificationOpportunity;

However ... 

               Opportunity OldContact = trigger.oldmap.get(Opp.Contact__c);
               If (Opp.Contact__c == OldContact.Id){

are never touched ....

 
Currently we are using a custom list view Visual Force page button for mass actions to export data to excel sheet in salesforce classic.
Objects and relations:
  • Static List (Custom object with Master relationship to Static List Member )
  • Static List Member (Custom junction object to static list and static list member )
  • Contact (Standard object with Master relationship to Static List Member )
Expected behavior for the visual force page:
  • On the static List, list view select the static list and click export
  • The export in the excel file should return all the static list members for each static list.
  • -Known limitations: The number of items in a collection that can be handled by iteration components is 10,000 in read only mode.
Current Behavior: Export for each list is maxed out at 1999 rows.
I'm trying to figure out if the current behavior is a salesforce bug or Am I missing something? Any help appreciated, below is the code snippet.
<apex:page standardController="Static_List__c" recordSetVar="staticLists" contentType="application/vnd.ms-excel#Static_List_Export{!NOW()}.xls" readOnly="true">
<!-- Vf page to generate the static member list records into a single excel sheet using standard controller functionality-->
<!-- Using content type along with date time stamp to create unique name every time the excel report is created-->
<!-- Using recordsetvar to fetch all the records from the list view-->
<head>
    <style>
        #contacttable {
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        border-collapse: collapse;
        width: 100%;
        }
        #contacttable td, #contacttable th {
        border: 1px solid #ddd;
        padding: 8px;
        }
        #contacttable tr:nth-child(even){background-color: #f2f2f2;}
        #contacttable tr:hover {background-color: #ddd;}
        #contacttable th {
        padding-top: 12px;
        padding-bottom: 12px;
        text-align: left;
        background-color: #4CAF50;
        color: white;
        }
    </style>
</head>
<table id="contacttable">
    <tr>
        <th>Static List: List Name</th>
        <th>Prefix</th>
        <th>Name</th>
        <th>Company Name</th>
        <th>Status</th>
        <th>Email opt-out</th>
        <th>Email</th>
        <th>Phone</th>
        <th>Street Address</th>
        <th>City</th>
        <th>State</th>
        <th>Country</th>
        <th>Zip</th>
    </tr>
    <!-- Iterating over the selected records on the list view -->
    <apex:repeat value="{!selected}" var="sL">
        <!-- Iterating over the child records using relationship-->
        <apex:repeat value="{!sL.Static_List_Members__r}" var="sLM">
            <tr >
                <td>   {!sLM.Static_List__r.Name}    </td>
                <td>   {!sLM.Contact_Name__r.Salutation}</td>
                <td>   {!sLM.Contact_Name__r.Name}</td>
                <td>   {!sLM.Company_Name__c}        </td>
                <td>   {!sLM.Contact_Status__c}      </td>
                <td>   {!sLM.Email_Opt_Out__c}       </td>
                <td>   {!sLM.Email__c}               </td>
                <td>   {!sLM.Contact_Name__r.Phone}</td>
                <td>   {!sLM.Contact_Name__r.MailingStreet}</td>
                <td>   {!sLM.Contact_Name__r.MailingCity}</td>
                <td>   {!sLM.Contact_Name__r.MailingState}</td>
                <td>   {!sLM.Contact_Name__r.MailingCountry}</td>
                <td>   {!sLM.Contact_Name__r.MailingPostalCode}</td>
            </tr>                        
        </apex:repeat>
    </apex:repeat>
</table>

 
I have a line of code in one of my components

 <lightning:overlaylibrary aura:id="overlayLib"/>

This works fine in the Sandbox, but when I installed in production, I got the following error

Component class instance initialization error [Definition does not exist on the client for descriptor:markup://lightning:overlaylibrary]

Would appreciate some help

 
I am receiving this error message: Content cannot be displayed: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at input location [1,2]

This is for a visualforce page.  Here is the Class:
public class AccountShippingController {
   
    public String trackingnumber {get;set;}
    public String shipmentStatus {get;set;}
    public String shipperAddr {get;set;}
    public String consigneeAddr {get;set;}

    public AccountShippingController(ApexPages.StandardController stdController){
        Account account =(Account)stdController.getRecord();
        account = [SELECT Id, XPO_Tracking__c FROM Account WHERE Id =:account.Id];
        
        String accountTracking = account.XPO_Tracking__c;
        String apiKey = 'XXXXXXXXXXXXXX';
        
        String requestEndpoint = 'https://app.ltl.xpo.com/appjs/tracking/#/tracking';
        requestEndpoint += 'details/' + accountTracking;
        requestEndpoint += '&APPID=' + apiKey;
        
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint(requestEndpoint);
        request.setMethod('GET');
        HttpResponse response = http.send(request);
        
        if (response.getStatusCode() == 200) {
            
            Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
            trackingnumber = String.valueOf(results.get('referenceNumbers'));
      		
            Map<String, Object> shipmentStatusDtlsResults = (Map<String, Object>)(results.get('shipmentStatusDtls'));
            shipmentStatus = String.valueOf(shipmentStatusDtlsResults.get('shipmentStatus'));
            shipperAddr = String.valueOf(shipmentStatusDtlsResults.get('shipperAddr'));
            consigneeAddr = String.valueOf(shipmentStatusDtlsResults.get('consigneeAddr'));
        } else {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'There was an error retrieving the information.  Double check the Tracking Number, then contact a system administrator.');
            ApexPages.addMessage(myMsg);
            
        }
    }
}
(I have removed the API key)

And the VF Page is:
<apex:page standardController="Account" extensions="AccountShippingController" showHeader="false" sidebar="false">
           <apex:pageBlock title ="Shipping Information">
    			<apex:pageBlockSection>
                
                    <apex:pageMessages/>
               
                    <apex:outputText label="Shipping Status" value="{!shipmentStatus}"/>
                    <apex:outputText label="Shipper Information" value="{!shipperAddr}"/>
                    <apex:outputText label="Consignee Information" value="{!consigneeAddr}"/>
                                                                                                            
                </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
Any and all suggestions are welcome!  
 
All,

On one custom object, I have about 50 fields with formulas (I did not create them). I would like to list these fields and their formulas in a tabular way.

Does anyone know I can get this detail out of Salesforce and paste nicely in to Word/Excel?
Hi there, I am trying to emulate the "convert lead" action on a custom object of mine which I've made a path for (see below)User-added image

When I click on the final stage in my Path, I would like it to generate a pop-up that will then let me create new records in related objects.  Is this possible?  Here is a picture of what im talking about.

User-added image

If anyone could should me how to do this I would really appreciate it!
While MavensMate is riding off into the sunset, it's going to remain relevant for a bit.  That said, what's The Thing to use moving forward to connect VS Code, Atom, or Sublime to the Salesforce backend?

Thanks,

Steve 

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.