• Ranjith Shetty P
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies
Aura Components Basics - Connect to Salesforce with Server-Side Controllers
Getting below error in Save and Load Records with a Server-Side Controller

The Apex controller CampingListController doesn't have a 'getItems()' or 'saveItem(Camping_Item__c item)' method.
Getting error We can't find a filter on Account Name. (In Create Seed Bank Agencies challenge)
{
  "Load Account": {
    "action": "sfdcDigest",
    "parameters": {
      "fields": [
        {
          "name": "AccountNumber"
        },
        {
          "name": "Name"
        },
        {
          "name": "Phone"
        },
        {
          "name": "ShippingCity"
        },
        {
          "name": "ShippingCountry"
        },
        {
          "name": "ShippingState"
        },
        {
          "name": "ShippingStreet"
        },
        {
          "name": "ShippingPostalCode"
        }
      ],
      "object": "Account"
    }
  },
  "Load Agency Detail": {
    "action": "edgemart",
    "parameters": {
      "alias": "Agency_Detail"
    }
  },
  "Add Agency Fields": {
    "action": "augment",
    "parameters": {
      "operation": "LookupSingleValue",
      "left": "Load Account",
      "relationship": "AgencyDetail",
      "right": "Load Agency Detail",
      "left_key": [
        "AccountNumber"
      ],
      "right_key": [
        "AccountNumber"
      ],
      "right_select": [
        "Acres",
        "Currency",
        "Latitude",
        "SubRegion",
        "Region",
        "Longitude"
      ]
    }
  },
  "ID Agency Records": {
    "action": "computeExpression",
    "parameters": {
      "mergeWithSource": true,
      "source": "Add Agency Fields",
      "computedFields": [
        {
          "type": "Text",
          "name": "IsAgency",
          "label": "IsAgency",
          "saqlExpression": "case when Phone is not null then \"TRUE\" else \"FALSE\" end"
        }
      ]
    }
  },
  "Filter Agency Records": {
    "action": "filter",
    "parameters": {
      "source": "ID Agency Records",
      "filter": "IsAgency:EQ:TRUE"
    }
  },
  "Seed Bank Agencies": {
    "action": "sfdcRegister",
    "parameters": {
      "source": "Filter Agency Records",
      "alias": "seed_bank_agencies",
      "name": "CreateSeedBankAgencies"
    }
  }
}
 
Aura Components Basics - Connect to Salesforce with Server-Side Controllers
Getting below error in Save and Load Records with a Server-Side Controller

The Apex controller CampingListController doesn't have a 'getItems()' or 'saveItem(Camping_Item__c item)' method.
I'm stuck on step #2 of Einstein Analytics and Discovery Insights Specialist superbadge.  I'm getting this warning while checking the challenge:
Challenge #2 Not complete
The step "Churn Tenure' is in compact form, so the filter values need to be specifed as a minimum and maximum
The static step that feeds has the following the value:
 
"Tenure_Length": {
                "broadcastFacet": false,
                "label": "Tenure Length",
                "selectMode": "single",
                "type": "staticflex",
                "values": [
                    {
                        "display": "High Risk",
                        "value": "1 to 12 months",
                        "min": 1,
                        "max": 12
                    },
                    ...
                ]
            }


I'm using selection binding for min and max values.  The dashboard is correctly filtering:
User-added image
User-added image
Any ideas? 
I've tried a non-compact form step where I inject a saql fragment into the query, as well as where I inject min/max values using a range filter serialization...All these efforts end in the same challenge failure message.

Any help/suggesitions are welcome!
I've tried to complete the trailhead challenge Connect to Salesforce with Server-Side Controllers and I'm getting the following error:
The Apex controller CampingListController doesn't have a 'getItems()' or 'saveItem(Camping_Item__c item)' method.

I've completed the following challenge (Connect components with events) and everything worked fine! Has anyone run across this problem before?

Following my code:

campingListController.js

({
    // Load camping items from Salesforce
    doInit: function(component, event, helper) {
        
        // Create the action
        var action = component.get("c.getItems");
        
        // Add callback behavior for when response is received
        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);
            }
        });
        
        // Send action off to be executed
        $A.enqueueAction(action);
    },
    
    handleAddItem: function(component, event, helper) {
        var action = component.get("c.saveItem");
        var item = event.getParam("item");
        action.setParams({
        "item": item
        });
        
        //console.log(event.getParam("item"));
        
        action.setCallback(this, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            var items = component.get("v.items");
            items.push(response.getReturnValue());
            component.set("v.items", items);
        }
        });
        $A.enqueueAction(action);
    }
})

CampingListController.apxc

public with sharing class CampingListController {

    @AuraEnabled
    public static List<Camping_Item__c> getItems() {
    
        // Check to make sure all fields are accessible to this user
        String[] fieldsToCheck = new String[] {
            'Id', 'Name', 'Packed__c', 'Price__c', 'Quantity__c'
        };
        
        Map<String,Schema.SObjectField> fieldDescribeTokens = 
            Schema.SObjectType.Camping_Item__c.fields.getMap();
        
        for(String field : fieldsToCheck) {
            if( ! fieldDescribeTokens.get(field).getDescribe().isAccessible()) {
                throw new System.NoAccessException();
                return null;
            }
        }        
        
        // Perform isAccessible() checking first, then
        return [SELECT Id, Name, Packed__c, Price__c, Quantity__c 
                FROM Camping_Item__c];
    }
    
    @AuraEnabled
    public static Camping_Item__c saveItem(Camping_Item__c item) {
        // Perform isUpdatable() checking first, then
        upsert item;
        return item;
    }
}

Any help welcome!
Thanks!