• sridhar sivaraman
  • NEWBIE
  • 0 Points
  • Member since 2016


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 8
    Replies
While doing the super badge  "Lightning Component Framework Specialist" I get the Internal Server error.

here is the code snippet.

BoatSearchResults.apxc
public with sharing class BoatSearchResults {
 @AuraEnabled
    public static List<Boat__c> getBoats(String boatTypeID) {
        System.debug('BoatSearch Results : ' + boatTypeID);
        List<Boat__c> returnList;
            if (boatTypeID != ''){
                returnList = [Select ID, Name, BoatType__c, contact__r.Name, Geolocation__c, Picture__c from Boat__c
                       where BoatType__c =:boatTypeID];
            } else {
                returnList = [Select ID, Name, BoatType__c, contact__r.Name, Geolocation__c, Picture__c from Boat__c];
            }
        System.debug('BoatSearch Results Return Count: ' + returnList.size());
        return returnList;
    }
}

BoatSearchResultHelper.js
({
 onSearch : function(component) {
        // Create the action
        var boatTypeID = component.get('v.selectedBoatID'); 
  console.log('In onSearch function: ' + boatTypeID);
        var action = component.get("c.getBoats");
        action.setParams({boatTypeID : boatTypeID});
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
   console.log('In onSearch function state: ' + state);
            if (state === "SUCCESS") {
                component.set("v.boats", response.getReturnValue());
            }
            else {
          console.log('In onSearch function Failed: ' + response);
                console.info('RESPONSE', response);
               var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("***Error message: " +
                                 errors[0].message);
                    }
                 } else {
                    console.log("***Unknown error");
                }
                console.log("Failed with state: " + state); 
            }
        });
       
        // Send action off to be executed
        $A.enqueueAction(action);
 }
})

BoatSearchResultsHelper.js
({
 onSearch : function(component) {
        // Create the action
        var boatTypeID = component.get('v.selectedBoatID'); 
  console.log('In onSearch function: ' + boatTypeID);
        var action = component.get("c.getBoats");
        action.setParams({boatTypeID : boatTypeID});
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
   console.log('In onSearch function state: ' + state);
            if (state === "SUCCESS") {
                component.set("v.boats", response.getReturnValue());
            }
            else {
          console.log('In onSearch function Failed: ' + response);
                console.info('RESPONSE', response);
               var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("***Error message: " +
                                 errors[0].message);
                    }
                 } else {
                    console.log("***Unknown error");
                }
                console.log("Failed with state: " + state); 
            }
        });
       
        // Send action off to be executed
        $A.enqueueAction(action);
 }
})

BoatSearchResults.cmp
<aura:component implements="flexipage:availableForAllPageTypes" controller="BoatSearchResults">
    <aura:handler name="boatSelect" event="c:BoatSelect" action="{!c.handleBoatSelect}"/>
   
    <aura:method name="search"
      description="Method to search all boats related to boat type">
        <aura:attribute name="boatTypeId" type="String" />
    </aura:method>
   
   
    <aura:attribute name="selectedBoatID" type="String"/>
    <aura:attribute name="boats" type="Boat__c[]" default="[]"/>
   
 <lightning:layout horizontalAlign="space" multipleRows="true">
        <aura:if isTrue="{!not(empty(v.boats))}">
            <!--Iterate the mapEntry Component.-->
            <aura:iteration items="{!v.boats}" var="boat" >
                <lightning:layoutItem flexibility="auto" size="12" mediumDeviceSize="6" largeDeviceSize="3" padding="around-small">
                 <c:BoatTile boat="{!boat}" selected="false"/>
                </lightning:layoutItem>
            </aura:iteration>
            <aura:set attribute="else">
                <div class="slds-align_absolute-center" style="text-align:center;"> No boats found </div>
            </aura:set>
        </aura:if>>
    </lightning:layout>
</aura:component>

Strangely  I did clear the step 4 “Implement the search filter” even with this error. However I want this to be resolved so that I can go ahead with other steps.

Any help will be appreciated .
Hi all,

I'm getting an error while verifying the step 3:
  • Ensure that page performance is improved by only rerendering the table and error messages when a use clicks the Add button.
I have rerender attribute on the Add button but it doesn't work.
Anyone have an answer?

Thank you.
While doing the super badge  "Lightning Component Framework Specialist" I get the Internal Server error.

here is the code snippet.

BoatSearchResults.apxc
public with sharing class BoatSearchResults {
 @AuraEnabled
    public static List<Boat__c> getBoats(String boatTypeID) {
        System.debug('BoatSearch Results : ' + boatTypeID);
        List<Boat__c> returnList;
            if (boatTypeID != ''){
                returnList = [Select ID, Name, BoatType__c, contact__r.Name, Geolocation__c, Picture__c from Boat__c
                       where BoatType__c =:boatTypeID];
            } else {
                returnList = [Select ID, Name, BoatType__c, contact__r.Name, Geolocation__c, Picture__c from Boat__c];
            }
        System.debug('BoatSearch Results Return Count: ' + returnList.size());
        return returnList;
    }
}

BoatSearchResultHelper.js
({
 onSearch : function(component) {
        // Create the action
        var boatTypeID = component.get('v.selectedBoatID'); 
  console.log('In onSearch function: ' + boatTypeID);
        var action = component.get("c.getBoats");
        action.setParams({boatTypeID : boatTypeID});
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
   console.log('In onSearch function state: ' + state);
            if (state === "SUCCESS") {
                component.set("v.boats", response.getReturnValue());
            }
            else {
          console.log('In onSearch function Failed: ' + response);
                console.info('RESPONSE', response);
               var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("***Error message: " +
                                 errors[0].message);
                    }
                 } else {
                    console.log("***Unknown error");
                }
                console.log("Failed with state: " + state); 
            }
        });
       
        // Send action off to be executed
        $A.enqueueAction(action);
 }
})

BoatSearchResultsHelper.js
({
 onSearch : function(component) {
        // Create the action
        var boatTypeID = component.get('v.selectedBoatID'); 
  console.log('In onSearch function: ' + boatTypeID);
        var action = component.get("c.getBoats");
        action.setParams({boatTypeID : boatTypeID});
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
   console.log('In onSearch function state: ' + state);
            if (state === "SUCCESS") {
                component.set("v.boats", response.getReturnValue());
            }
            else {
          console.log('In onSearch function Failed: ' + response);
                console.info('RESPONSE', response);
               var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("***Error message: " +
                                 errors[0].message);
                    }
                 } else {
                    console.log("***Unknown error");
                }
                console.log("Failed with state: " + state); 
            }
        });
       
        // Send action off to be executed
        $A.enqueueAction(action);
 }
})

BoatSearchResults.cmp
<aura:component implements="flexipage:availableForAllPageTypes" controller="BoatSearchResults">
    <aura:handler name="boatSelect" event="c:BoatSelect" action="{!c.handleBoatSelect}"/>
   
    <aura:method name="search"
      description="Method to search all boats related to boat type">
        <aura:attribute name="boatTypeId" type="String" />
    </aura:method>
   
   
    <aura:attribute name="selectedBoatID" type="String"/>
    <aura:attribute name="boats" type="Boat__c[]" default="[]"/>
   
 <lightning:layout horizontalAlign="space" multipleRows="true">
        <aura:if isTrue="{!not(empty(v.boats))}">
            <!--Iterate the mapEntry Component.-->
            <aura:iteration items="{!v.boats}" var="boat" >
                <lightning:layoutItem flexibility="auto" size="12" mediumDeviceSize="6" largeDeviceSize="3" padding="around-small">
                 <c:BoatTile boat="{!boat}" selected="false"/>
                </lightning:layoutItem>
            </aura:iteration>
            <aura:set attribute="else">
                <div class="slds-align_absolute-center" style="text-align:center;"> No boats found </div>
            </aura:set>
        </aura:if>>
    </lightning:layout>
</aura:component>

Strangely  I did clear the step 4 “Implement the search filter” even with this error. However I want this to be resolved so that I can go ahead with other steps.

Any help will be appreciated .
I am working with a couple different objects:  Accounts<Locations<Serial Number<Service Call and made a process whereby a check box titled "PM" is available in the Service Call.  If the PM box is checked then it will look at the Date of Visit and use that date and input it into Date of Last PM under the Serial number, one object up.  It works for some but doesn't work for others.  I am trying to find out why.

Thank you!
Hi All,
Need help on bulding a formula for process builder, 
During the life cycle of an Opportunity the stage field would be updated as 'Confirmed'  i.e either at the time of creation or when edited later,then the process builder action(creating child record) has to be triggered only for the first time, My current criteria in PB acting as evaluation criteria in WFR like 'Created or every time edited' instead it should act like 'created, and any time it’s edited to subsequently meet criteria', To keep this short, even if the Stage Field is updated as 'Confirmed' many times PB action should fire and create child record only once, that is for the first time.

Help will be appreciated,

Thanks
I have created custom field on lead object with 
Forumla return type :text
Using below formula
CASE (MOD (TODAY () - DATE (1900, 1, 7), 7), 0, "Sunday", 1, "Monday", 2, "Tuesday", 3,"Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday”, “Error",NULL)
But issue is iam getting only TUESDAY as answer . please let me know where Iam wrong .
Thanks in Advance.


 
Hi Everyone,

Im looking for a formula field to trim text before street address. For example my street addresses are all entered this way " p/o maria Jenkins 123 West way Ave". An ideal solution would trim any text before the address and only leave me with "123 West way Ave". The address will always start with a numeric values.

Is this even possible with a formula field?
Hi Everyone,

I have the formula field below which works great. Basically if Account_Number__c contains '-1' it will populate ShippingStreet, else, BillingStreet.
IF(  CONTAINS(Account_Number__c , "-1") , ShippingStreet , BillingStreet)

Now, I want to add default address field so a third condition. So what I'm looking for is if Account_Number__c contains '-1' populate ShippingStreet, else, Billing​Street, if Billing Street is blank populate ShippingStreet.
Hi Everyone,

I need a way determine if the accountNumber field contains -1. I got it work when -1 is the only value in the account number field. The formula needs to identify identify wether -1 is present the string (i.e. 11706-1). Not sure what else I need to do here.
 
IF(  CONTAINS("-1", Site) , BillingCity , 
IF(   NOT( CONTAINS("-1", Site) ), ShippingCity , 
IF(  CONTAINS("", Site)  , ShippingCity , BillingCity) ) )