• Olivia Porter 1
  • NEWBIE
  • 35 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 7
    Questions
  • 9
    Replies
This may be difficult to type out but I am confused on the difference between using "without sharing" and just not declaring any sharing rules at all.

Can you only declare conditions that allow a user to see parts of the salesforce org? For example: if I wanted to block someone from seeing any Account in the org, would that be a part of the sharing rules?

If so, then I really don't get the difference between "without sharing" and just simply not declaring any sharing rules for the class.

Why does this javascript not work on my page? It works perfect in JSFiddle. I can see that the console is returning bananas. But I get no .innerHTML change what so ever. Any insight? 

<script> 
    var bananas = true;      
    console.log(bananas);
    if (bananas == true) {
        document.getElementById("changeString").innerHTML = "You have successfully run the report."
    }
</script>     

<div class="cell" id="changeString">Instant ID Report has not yet been pulled for this organization.</div>

 

 

Hello, I have followed this trailhead exactly as they have asked and I am unable to render the SLDS view. The output is in standard HTML. I have seen other forums that have faced similar problems and I have copied their exact code over with no avail. I am 99.9% sure the code is correct, but perhaps the static resource is not uploading correctly? I can not figure out what is going wrong. 

I have seen some people use this tag:<ltng:require styles="/resource/SLDS282/assets/styles/salesforce-lightning-design-system.css"/>
And the trailhead suggests using this tag: <ltng:require styles="{!$Resource.SLDS12345 +
         '/assets/styles/salesforce-lightning-design-system-ltng.css'}"/>

If not the static resource, then perhaps it is this tag?

Any help would be greatly appreciated. 

My App:
     <aura:application>
        <ltng:require styles="/resource/SLDS282/assets/styles/salesforce-lightning-design-system.css"/>
        <div class="slds">    
            <c:camping/>
        </div>
</aura:application>

My camping.cmp: *please note I have also attempted to just do the expenses example on the trailhead but with no success 

<aura:component >
 <aura:component >   
    div style="slds">
        <c:campingHeader />
        <c:campingList /> 
    </div>
</aura:component >

My header:
<aura:component >
        <div class="slds-col slds-col--padded slds-p-top--large">
            <div style="slds">
        <div class="slds-page-header" role="banner">
            <div class="slds-grid">
                <div class="slds-col">
                    <h1 class="slds-text-heading--medium">Camping List</h1>
                </div>
            </div>
        </div>
    </div>
    </div>
</aura:component>

I won't past the other content for the header isn't even working. 
Hello, I have been to this documentation: https://help.salesforce.com/apex/HTViewSolution?urlname=Increasing-Archive-Days-for-your-Organization&language=en_US that states I need to open a case in order to increase my archived Activities/Tasks to more then 365 days. This is my attempt at asking. Is there another way of getting this done? Can I query for the archived files myself? Any help would be greatly appreciated, I am looking to be able to pull tasks from 2 years ago. 
I have 100% Overall Test Coverage for my class. When I go to my actual class, the drop down 'Code Coverage' states :None. When I click the drop down, there are no options. There is no color hilghlighting for the code. Is there a bug Salesforce? Why is this happening? Help! I have edited, saved, reopened, re-ran, refreshed, tried different browsers, cleared all test history, etc...
I am trying to compare the Campaign.StartDate to today's date. Because they are of different Types, APEX won't let me do this. Is there a way around this? Is it possible to convert a Date type into a CampaignMember type? Or vise versa? Please see below code:

public class RecordIdPass {
    Date val= Date.today();
    List<CampaignMember> StartDateTest = [SELECT Campaign.StartDate FROM CampaignMember WHERE LeadId = :leadId];
    
    public RecordIdPass() {
         //error- cannot compare two different Types of list objects
        if (StartDateTest != val) {    
            List<CampaignMember> cms= [SELECT CampaignId, LeadId, Status, Campaign.StartDate FROM CampaignMember WHERE LeadId = :leadId ORDER BY Campaign.StartDate DESC limit 1];
        }
    }
}
Hello, I am a developer and am very new to Salesforce. I am attempting to overwrite a Leads page with narrowed down content: a View pick list and a Recent Leads list. I found a tutorial on overriding an existing page but the "create page tabbedAccount" link is not listed. I added the appropriate url extension but the only content on the page is: "Page tabbedAccount does not exist", and no link to create a tabbedAccount. Is it possible someone in my organization removed this link? 

This is the tutorial link: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_tabs.htm

Why does this javascript not work on my page? It works perfect in JSFiddle. I can see that the console is returning bananas. But I get no .innerHTML change what so ever. Any insight? 

<script> 
    var bananas = true;      
    console.log(bananas);
    if (bananas == true) {
        document.getElementById("changeString").innerHTML = "You have successfully run the report."
    }
</script>     

<div class="cell" id="changeString">Instant ID Report has not yet been pulled for this organization.</div>

 

 

I have 100% Overall Test Coverage for my class. When I go to my actual class, the drop down 'Code Coverage' states :None. When I click the drop down, there are no options. There is no color hilghlighting for the code. Is there a bug Salesforce? Why is this happening? Help! I have edited, saved, reopened, re-ran, refreshed, tried different browsers, cleared all test history, etc...
I am trying to compare the Campaign.StartDate to today's date. Because they are of different Types, APEX won't let me do this. Is there a way around this? Is it possible to convert a Date type into a CampaignMember type? Or vise versa? Please see below code:

public class RecordIdPass {
    Date val= Date.today();
    List<CampaignMember> StartDateTest = [SELECT Campaign.StartDate FROM CampaignMember WHERE LeadId = :leadId];
    
    public RecordIdPass() {
         //error- cannot compare two different Types of list objects
        if (StartDateTest != val) {    
            List<CampaignMember> cms= [SELECT CampaignId, LeadId, Status, Campaign.StartDate FROM CampaignMember WHERE LeadId = :leadId ORDER BY Campaign.StartDate DESC limit 1];
        }
    }
}
I'm having trouble with one of the trailhead modules, Lightning Components Basics Input Data Using Forms https://developer.salesforce.com/trailhead/lex_dev_lc_basics/lex_dev_lc_basics_forms

In a previous module I set up the SLDS static resource and now in this module I'm asked to acess it and I'm not getting the custom styling that is supposed to be implimented. I copy-pasted the code exactly as it is shown in the module and only changed the name of the static resource.

expensesApp.app
<aura:application>
 
    <!-- Include the SLDS static resource (adjust to match package version) -->
    <ltng:require styles="{!$Resource.SLDS201 +
         '/assets/styles/salesforce-lightning-design-system-ltng.css'}"/>
 
    <!-- Add the "scoping" element to activate SLDS on components
         that we add inside it. -->
    <div class="slds">
       
        <!-- This component is the real "app" -->
        <c:expenses/>
       
    </div>
    <!-- / SLDS SCOPING DIV -->
 
</aura:application>
expenses.cmp
<aura:component>

    <!-- PAGE HEADER -->
    <div class="slds-page-header" role="banner">
      <div class="slds-grid">
        <div class="slds-col">
          <p class="slds-text-heading--label">Expenses</p>
          <h1 class="slds-text-heading--medium">My Expenses</h1>
        </div>
      </div>
    </div>
    <!-- / PAGE HEADER -->

    <!-- NEW EXPENSE FORM -->
    <div class="slds-col slds-col--padded slds-p-top--large">


        <!-- [[ expense form goes here ]] -->


    </div>
    <!-- / NEW EXPENSE FORM -->

</aura:component>

I've tried uninstalling and re-uploading the resource as well as changing the filepath but I can't seem to figure out how to acces this file.
Any help would be really appreciated.
 
HI ,

I need to delete the post in the community , could anyone help me.

this is the link

https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BVjIIAW

Thanks in advance
Hi,

I am working on salesforce, my requirement is to create custom object and to add visualforce page in custom object page layout. I am able to create custom object but i could not see any option to add visuaforce  page to custom object page, can any one help me how to do it.

I have attched screen shot.

thanks in advance

Sonu GuptaUser-added image

I'm sending a query to SalesForce (using the SOAP API) that includes an IN clause, however, I keep getting a MALFORMED_QUERY error.  Could someone point me in the right direction of what the query syntax is when using the IN clause?  I've tried the following without success (the ids are made up in these examples):

 

SELECT Id FROM Lead WHERE Id IN {'000000000000000','111111111111111'}

SELECT Id FROM Lead WHERE Id IN '0000000000000','111111111111111'

 

Thanks.

Hi,

I can't pass the challenge (https://developer.salesforce.com/trailhead/force_com_dev_intermediate/lex_dev_lc_basics/lex_dev_lc_basics_events). This is the error when check challenge:

Challenge Not yet complete... here's what's wrong: 
The campingList JavaScript controller isn't adding the new record to the 'items' value provider.


I tryed in the browser add new Camping Items and it's working correctly. The item is added to database and the list is updated.

This is my code:

campingList Component
<aura:component controller="CampingListController">
    
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    <aura:handler name="addItem" event="c:addItemEvent" action="{!c.handleAddItem}"/>
    
    <div class="slds-page-header" role="banner">

      <div class="slds-grid">

        <div class="slds-col">

          <p class="slds-text-heading--label">Camping Items</p>

          <h1 class="slds-text-heading--medium">My Camping Items</h1>

        </div>

      </div>

    </div>

      
  <div aria-labelledby="newitemform">

      <fieldset class="slds-box slds-theme--default slds-container--small">
    
        <c:campingListForm />
    
      </fieldset>

	</div>
    
    
     <aura:attribute name="items" type="Camping_Item__c[]"/>

    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Camping List Items</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="campItem">
                    <c:campingListItem item="{!campItem}"/>
                </aura:iteration>
            </div>
        </section>
    </div>

</aura:component>

campingList Controller.js
({
    
    doInit: function(component, event, helper) {
    
        var action = component.get("c.getItems");
    
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {
                component.set("v.items", response.getReturnValue());
            }
            else {
                console.log("Failed with state: " + state);
            }
        });
    
        $A.enqueueAction(action);
    },    
    
    handleAddItem: function(component, event, helper) {
        var item = event.getParam("item");
                
        var action = component.get("c.saveItem");
        action.setParams({
            "item": item
        });
        
        action.setCallback(this, function(response){
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {        
                var theItems = component.get("v.items");
                theItems.push(item);
                component.set("v.items",theItems);
            }
        });
        $A.enqueueAction(action);
    }
    
})

CampingListController
public with sharing class CampingListController {

    @AuraEnabled 
    public static List<Camping_Item__c> getItems() {
        return [SELECT Id, Name, Price__c, Quantity__c, Packed__c FROM Camping_Item__c];
    }
    
    @AuraEnabled
    public static Camping_Item__c saveItem(Camping_Item__c item) {
        upsert item;
        return item;
    }
}

CampingListForm Component
<aura:component >
    
     <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Packed__c': false,
                    'Price__c': '0',
                    'Quantity__c': '0' }"/>
	<aura:registerEvent name="addItem" type="c:addItemEvent"/>
    
  <div aria-labelledby="newitemform">
      <fieldset class="slds-box slds-theme--default slds-container--small">
    
        <legend id="newitemform" class="slds-text-heading--small 
          slds-p-vertical--medium">
          Add Camping Item
        </legend>
    
        <form class="slds-form--stacked">
    
          <div class="slds-form-element slds-is-required">
              <div class="slds-form-element__control">
                  <ui:inputText aura:id="name" label="Camping Item Name"
                      class="slds-input"
                      labelClass="slds-form-element__label"
                      value="{!v.newItem.Name}"
                      required="true"/>
              </div>
         </div>
            
          <div class="slds-form-element">
              <ui:inputCheckbox aura:id="packed" label="Packed?"
                  class="slds-checkbox"
                  labelClass="slds-form-element__label"
                  value="{!v.newItem.Packed__c}"/>
          </div>
            
        <div class="slds-form-element">
              <div class="slds-form-element__control">
                  <ui:inputCurrency aura:id="price" label="Price"
                      class="slds-input"
                      labelClass="slds-form-element__label"
                      value="{!v.newItem.Price__c}" />
    
              </div>
          </div>
    
         <div class="slds-form-element">
              <div class="slds-form-element__control">
                  <ui:inputNumber aura:id="quantity" label="Quantity"
                      class="slds-input"
                      labelClass="slds-form-element__label"
                      value="{!v.newItem.Quantity__c}"/>
    
              </div>
          </div>
    
          <div class="slds-form-element">
              <ui:button label="Create Camping Item"
                  class="slds-button slds-button--brand"
                  press="{!c.clickCreateCampingItem}"/>
          </div>
    
        </form>
    
      </fieldset>
</div>

</aura:component>

CampingListForm Controller.js
({    
    
    clickCreateCampingItem : function(component, event, helper) {
        
        var validCamping = true;

        // Name must not be blank
        var nameField = component.find("name");
        var expname = nameField.get("v.value");
        if ($A.util.isEmpty(expname)){
            validCamping = false;
            nameField.set("v.errors", [{message:"Camping Item name can't be blank."}]);
        }
        else {
            nameField.set("v.errors", null);
        }

        
        var priceField = component.find("price");
        var price = priceField.get("v.value");
        if ($A.util.isEmpty(price) || isNaN(price) || (price <= 0.0)){
            validCamping = false;
            priceField.set("v.errors", [{message:"Camping Item price can't be blank."}]);
        }
        else {
            priceField.set("v.errors", null);
        }
        
        var quantityField = component.find("quantity");
        var quantity = quantityField.get("v.value");
        if ($A.util.isEmpty(quantity) || isNaN(quantity) || (quantity <= 0)){
            validCamping = false;
            quantityField.set("v.errors", [{message:"Camping Item quantity can't be blank."}]);
        }
        else {
            quantityField.set("v.errors", null);
        }

        if(validCamping){
            
            helper.createItem(component);
            
        }
        
    },
})

CampingListForm Helper.js
({
    
     createItem : function(component) {
        var newItem = component.get("v.newItem");
        var addEvent = component.getEvent("addItem");
        addEvent.setParams({"item" : newItem});
        addEvent.fire();
        component.set("v.newItem",
                     { 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Packed__c': false,
                    'Price__c': 0,
                    'Quantity__c': 0});
    }
})

Could anyone help me?

Thanks,
Regards.