• Donald Hursey
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
I have a request to create a visualforce page to be used as a sub tab to display field values from a related object. I am using the code below but received the error "System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Equipment__c.Leasing_Company__c"

What am I missing in my extension or vf page? I'm not sure if this is the best way to accomplish what I'm trying to do so any suggestions would be helpful.
 
<apex:page standardController="Equipment__c" extensions="AgreementExtV2" lightningStylesheets="true"> 
       
 <apex:pageBlock id="agrDetails" title="Agreement Details">
     
      <apex:repeat value="{!$ObjectType.Agreements__c.FieldSets.Lease_Agreement}" var="f">
      <option value="{!$ObjectType.Agreements__c.Fields[f].localname}">{!$ObjectType.Agreements__c.Fields[f].label}</option>     
      <apex:outputField value="{!Equipment__c[f]}"/>      
     </apex:repeat>
     
  
  </apex:pageBlock>                
</apex:page>


public class AgreementExtV2 { 
public List<Agreements__c> agreement{get; set;} 
public List<Equipment__c> currentRecord{get; set;}

    public AgreementExtV2(ApexPages.StandardController controller) {
     currentRecord = [SELECT Id FROM Equipment__c WHERE Id = :ApexPages.currentPage().getParameters().get('id')];  
	 agreement = [SELECT Id, Leasing_Company__c, Lease_ID__c, Lease_Exp_Date__c, Lease_Type__c, Leased_Amount__c, Lease_Rate__c, Lease_Term__c, Lease_Payment__c, Equipment__c FROM Agreements__c Where Equipment__c = :currentRecord]; 
	} 
}



 
I have an visualforce page controller that stopped working because the code snippet below is looking for the instance name in the the url. I have another instance tha is working, and has the instance number available in the url for the visualforce page. I've checked over domains, sites, remote site settings to see if that was the issue, but didn't see anything that sttod out as the problem. Is there another way to get the instance number to be used in the tooling API url?
 
HttpRequest req = new HttpRequest();
            req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
            req.setHeader('Content-Type', 'application/json');
            
String host = System.URL.getSalesforceBaseUrl().getHost();
            Integer firstDot = host.indexOf('.')+1;
            String sUrlRewrite = 'https://'+ host.substring(firstDot,host.indexOf('.',firstDot)) + '.salesforce.com';
            req.setEndpoint(sUrlRewrite+'/services/data/v33.0/tooling/query?

 
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,