• Vineet Anand 5
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 1
    Replies
Hi All,
For PD2 Super Badge "Aura Component Specialist Task 4" I am getting below error:
"Failed to save BoatSearchForm.cmp: Invalid definition for null:BoatSearchFormController: ApexService.getType() return null with currentNamespace: c, namespace: null, name: BoatSearchFormController: Source"

Enclosing Boat Searchform.cmp:
<aura:component controller="BoatSearchFormController" implements="force:appHostable,flexipage:availableForAllPageTypes">
    <aura:handler name="formsubmit" event="c:FormSubmit" action="{!c.onFormSubmit}" phase="capture"/>
    <aura:attribute access="private" name="boatTypeList" type="BoatType__c[]" default="[]"/>
    <aura:attribute access="private" name="boatTypeIdByNameMap" type="Map"/>
    <aura:attribute access="private" name="selectedBoatType" type="BoatType__c"/>
    <aura:attribute access="private" name="showNewButton" type="Boolean" default="false"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
    <!--<h2 class="slds-page-header__title">Find a Boat</h2>-->
    <form>
        <lightning:layout horizontalAlign="center" verticalAlign="end">
            <lightning:select name="select" value="{!v.selectedBoatType}">    
                <option value="">All Types</option>
                <aura:iteration items="{!v.boatTypeList}" var="boatType">
                    <option value="{!boatType.Name}">{!boatType.Name}</option>
                </aura:iteration> 
            </lightning:select>
                <lightning:button name="Search" label="Search" variant="brand" onclick="{!c.onFormSubmit}" />
            <aura:if isTrue="{!v.showNewButton}">
                <lightning:button name="New" label="New" variant="neutral" onclick="{!c.createBoat}"/>
            </aura:if>
        </lightning:layout>
    </form>    
</aura:component>

BoatsearchformController.js
({
    doInit: function(component, event, helper) {
 var createNewBoat = $A.get("e.force:createRecord");
        if (createNewBoat) {
            component.set("v.showNewButton", true);
        }else{
             component.set("v.showNewButton", false);
        }
    var action = component.get("c.getboattypes");

    // Add callback behavior for when response is received
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            debugger
            console.log("responce : " + response.getReturnValue());
            component.set("v.btypes", response.getReturnValue());
        }
        else {
            console.log("Failed with state: " + state);
        }
    });

    // Send action off to be executed
    $A.enqueueAction(action);
    },
    createBoat: function (component) 
     {
            console.log('inside controller');
            var createRecordEvent = $A.get('e.force:createRecord');
            if (createRecordEvent) 
            {
                    var typeName = component.find('typeSelect').get('v.value');
                    //var typeMap = component.get('v.searchOptionToIdMap');
                    var typeId = null;
                    if (typeName) 
                    {
                            typeId = typeName;
                    }
                    createRecordEvent.setParams({
                        'entityApiName': 'Boat__c',
                        'defaultFieldValues': {
                            'BoatType__c': typeId
                        }
                    });
                    createRecordEvent.fire();
            }
       },
    onFormSubmit:function(component, event, helper) {
        debugger
        // var myEvent = $A.get("e.c:BoatSearchEvent");
        // myEvent.setParams({"typeId": component.get("v.selectedType")});
        // myEvent.fire();
        console.log("selectType "+ component.get("v.selectedType") );
        var boatTypeId = component.get("v.selectedType");
        console.log("Search button pressed " + boatTypeId);
        var formSubmit = component.getEvent("formsubmit");
        formSubmit.setParams({"formData":
                            {"boatTypeId" : boatTypeId}
        });
        formSubmit.fire();
        },
    handleChange:function(component, event, helper) {
        var y=component.find("boatTypes").get("v.value");
        console.log("val :  "+ y);
        component.set("v.selectedType",component.find("boatTypes").get("v.value"));
    }    
})

Please suggest remedy.

Rgd's
Hi All,
I have a query regarding Superbadge "Data Integration Specialist". I have installed the Pkg. successfully. Please confirm after Installing sObject Project__c will be having data provided by SF or we need to create data.
Thanks
Hi All,
For Superbadge Challange "Data Integration Specialist", Task 7 "Synchronize Salesforce project data with Square Peg's external billing system", I am getting error: "The SOAP call to the BillingService did not return the correct response. Please check your configurations and code". Not Sure about reason. Can any help me on same.
Rgd's
Hi All, 
Can any one tell how to Set USER ID + PWD + SECURITY TOKEN in sales force ORG. I am trying to login to saleforce from Heroko. Below is the screen I am looking for.

USER NAME -- ABC
PASSWORD --  XYZ
SECURITY TOKEN -- SALESFORCE SECURITY TOKEN

Not able to Post original screenshot but original screen shot is like this only. Please share how to go to this screen. If any information is missed out do let me know.
Thanks
Hi All,
I am trying to Install a Package from Trailhead to my Developers Org. When Installing I am getting error Custom Object "Project__c" already present. I have dropped the Custom Object & also from Recyclebin, still when trying to Install the Pkg. I am getting same error. Please suggest where I need to look for sObject.
Thanks
Hi All,
Need Help. For Aura Components Specialist - Superbadge, Challange 1. as instructed I have downloaded & uninstall the Package. I created my own ORG. I am getting below error not sure about the reason.
Error:
"Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Delete failed. First exception on row 13 with id 0017F00001DvSdUQAV; first error: DELETE_FAILED, Your attempt to delete IT could not be completed because it is associated with the following contacts.: Anand, Vineet : [] "

I am able to See sObject like "Boat", "Boat review", "Boat Type". In Developer console when query the sObject I am not seeing any Data i.e. 0 records. Not sure where I am doing wrong. Please advice.

Rgd's
Hi All,
I am working on Apex Specalist - Super Badge. I installed the required Pkg. to my org. Currently working on Automate record creation. As per Requirement need to fetch TYPE = REPAIR Or MAINTENANCE REQUEST. When query the table not finding any record having type define as Repair or Maintenance. Not sure why. Can any one guide me on same.
Rgd's
Hi All,
I am facing Below error for my piece of code. Any suggestion / help is highly Appreciable.

Error:
Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 5007F00000tAkWFQA0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, MaintenanceRequest: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object Class.MaintenanceRequestHelper.cycleCalc2: line 23, column 1 Class.MaintenanceRequestHelper.updateWorkOrders: line 14, column 1 Trigger.MaintenanceRequest: line 7, column 1: []

Trigger:
trigger MaintenanceRequest on Case (after update, after insert) {
    Public List<Case> closedCase = new List<Case>();
    List<Case> caseA = [select ID, vehicle__c, equipment__c, date_due__c from Case Where Id IN :Trigger.new AND status ='Closed' and Type IN ('Repair', 'Routine Maintenance')];
    for(Case a : caseA) {
        closedCase.add(a);
    }
     MaintenanceRequestHelper.updateWorkOrders(closedCase); 
}

MaintenanceRequestHelper:

public class MaintenanceRequestHelper {
    Public Static List<Case> oldCase = new List<Case>();
    public static void updateWorkOrders(List<Case> closedCase){
        oldCase = closedCase;
        List<Case> newCase = new List<Case>();
            for (Case newCase2 : oldCase) {
                 newCase.add(new Case(type = 'Routine Maintenance',
                                status = 'New',
                                origin = 'Web',
                                Subject = null,
                                Date_Reported__c = date.today(),
                                Vehicle__c = newCase2.Vehicle__c,
                                Equipment__c = newCase2.Equipment__c,
                                Date_Due__c = cycleCalc2()));  
        }
        insert newCase;
    }

    private static Date cycleCalc2() {        
        oldCase = [select ID from Case Where status = 'Closed' and Type IN ('Repair', 'Routine Maintenance')];
        AggregateResult[] minCycleDay2 = [Select min(Equipment__r.Maintenance_Cycle__c) FROM Work_Part__c  WHERE Equipment__r.Maintenance_Cycle__c != null AND         Maintenance_Request__c IN: oldCase];
        Integer minCycleNum = ((Decimal)minCycleDay2[0].get('expr0')).intValue();
        Date returnDate = date.Today() + minCycleNum;
        return returnDate;
        }
    }

Please help.
Rgd's
Hi All,
For Apex Specialist-Challange 1, I am facing below error.

"Challenge Not yet complete... here's what's wrong:
Inserting a new Maintenance Request of type 'Routine Maintenance' and then closing it did not create of a new Maintenance Request based upon the original record correctly. The challenge is expecting to find the closed Maintenance Request plus an 'New' Maintenance Request of type 'Routine Maintenance' with the same Vehicle as the closed one."

Below is my Code:
trigger MaintenanceRequest on Case (before update,after update) 
{
    if (TriggerHelperClass.MyBool==TRUE) 
        {
           MaintenanceRequestHelper.updateWorkOrders();
           TriggerHelperClass.MyBool=FALSE;
        }       
}

wMaintenanceRequestList= new List<Case>();
   for(Case cas:maintenanceRequestList){
     if(cas.Type=='Routine Maintenance' &&  cas.Status=='Closed'){
       case newMaintenanceRequest=new Case();
       newMaintenanceRequest.Subject='test';
       newMaintenanceRequest.Type='Routine Maintenance';
       newMaintenanceRequest.Vehicle__c= cas.Vehicle__c;
       newMaintenanceRequest.Equipment__c = cas.Equipment__c;
       newMaintenanceRequest.Date_Reported__c =date.Today();
       newMaintenanceRequest.Date_Due__c=Date.today().addDays(Integer.valueOf(cas.Equipment__r.Maintenance_Cycle__c));
       newMaintenanceRequest.Status='New';
       newMaintenanceRequest.Origin='Phone';
       newMaintenanceRequestList.add(newMaintenanceRequest);
     }
   }
       return newMaintenanceRequestList;
  }
}

public class TriggerHelperClass
{
    Public static boolean MyBool=TRUE;
}

When Boolean Variable was not Introduced, Code was going in Loop, to avoid loop added Boolean variable. Please suggest reason of error & if possible sol. for same.

Rgd's
Vineet Anand
Hi All,
Facing issue For Summer19 Maintenance Exam question. As istructed I installed the Package in Trailhead Playground1.Created Trigger "BatchApexErrorTrigger". To The "BatchLeadConvert" made required changes. When Go for Check the Challange I am getting Error
" Challenge not yet complete in My Trailhead Playground 1
No Apex class named 'BatchLeadConvert' was found. Refer to the setup instructions and install the unmanaged package."

I have recieve mail for Successful Installation of Package. Not sure what I am doing wrong & where. Please help me to clear the Challange.

Rgd's
Vineet Anand
Hi All,
I am working on Superbadge for PD2 certification. I have created Scratch Org in Developer Org. Scratch Org Created Successfully. Now trying to Push the App to Scratch Org I am getting below message.
"=== Pushed Source, No results found" Is this normal or I am making any mistake?. If Mistake then please suggest Remedy for same.I am following all the steps as suggested in the Git Document.Appreciate early response.
Rgd's
Vineet Anand
Hi All,
I am facing Issue with "Push & Deploy Lightning Web Component File." I am getting hard time to complete this challange. For Challange I am referring to "My Trailhead Playground 1". I have installed (1) CLI (2) Visual Studio  (3) Git Hub. Below are my Queries.

1) How to Create Scratch org for "My Trailhead Playground 1" .
2) From Trailhead I am trying to Login to Developer Org / My Org, it's not happening. How to do this.
3) For Testing I just navigate to my Org & when trying to create Scratch Org I am getting error "Property 'enableSetPasswordInApi' not valid in version 45.0".
4) If I want to create Scratch Org in "My Trailhead Playground 1" how can I create.

Any help in this regard will be a great help. Please advise.

Rgd's
Vineet Anand
Hi All,
How to Refer Last Name in "Lead" Object in Flow Builder. In Create Record Option, when Refering the Field Last Name / Company in 'Set Values for The Lead' I am getting Error: 'Menu data must be an array but was true', the moment Cursor is Placed over the Field. Please help.
Rgd's
Vineet Anand
Mail: anand_vin@hotmail.com (mailto:anand_vin@hotmail.com)

Hi All,
I am working on Super Badge 'Data Integration Specialist' for PD2 Certification. For the Challange 'Flow Builder' I am getting Below Error: "Menu data must be an array but was true"

the moment I Click the filed where I need to enter Col. name (Set Field Values For Leads) i.e. Last Name & Company Name for object = LEAD. Not sure about the issue. Other Parameter settings are as per requirement:

How Many Records to Create -- ONE

How to Set the Record Fields  -- Use separate variables, resources, and literal values
Please suggest remedy. I am Stuck Up.
Rgd's
Vineet Anand
Mail: anand_vin@hotmail.com (mailto:anand_vin@hotmail.com)

Hello All,
Please suggest any good URL which can be referred to Practice 4 Superbadges before appearing for PD-II.
Rgd's
Hi All,
I am facing Issue with "Push & Deploy Lightning Web Component File." I am getting hard time to complete this challange. For Challange I am referring to "My Trailhead Playground 1". I have installed (1) CLI (2) Visual Studio  (3) Git Hub. Below are my Queries.

1) How to Create Scratch org for "My Trailhead Playground 1" .
2) From Trailhead I am trying to Login to Developer Org / My Org, it's not happening. How to do this.
3) For Testing I just navigate to my Org & when trying to create Scratch Org I am getting error "Property 'enableSetPasswordInApi' not valid in version 45.0".
4) If I want to create Scratch Org in "My Trailhead Playground 1" how can I create.

Any help in this regard will be a great help. Please advise.

Rgd's
Vineet Anand