• Lukesh Karmore
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 19
    Questions
  • 26
    Replies
iam trying fro 3 to4 days not getting solution error is

17:57:11.955 sfdx force:auth:web:login --setalias lkar --instanceurl https://login.salesforce.com --setdefaultusername
17:57:11.956 sfdx force:auth:web:login --setalias lkar --instanceurl https://login.salesforce.com --setdefaultusername
ended with error spawn C:\WINDOWS\system32\cmd.exe ENOET

i update CLI but not worked
please any working solution for me,  any help should be appriciated.
thank you
not able to create sandbox in DE , it is available in production org only and it is for paid user only.
i am using developer edition is this  a type of sandbox??
thank you
what it return 
map<string,object> params=(map<string,object>)Json.deseriliazeUntype(request.requestBody.toString);
here (request.requestBody.toString); is used for

thank you
in apex web service I receive continuous error
Challenge not yet complete in trailhead playground 5
Executing the 'AccountManager' method failed. Either the service isn't configured with the correct urlMapping, is not global, does not have the proper method name or does not return the requested account and all of its contacts.
  
my code is--
@RestResource(urlMapping='/Accounts/*/contacts')
global with sharing class AccountManager {
    @HttpGet
    global static Account getAccount() {
        RestRequest req = RestContext.request;
        String accId = req.requestURI.substringBetween('Accounts/', '/contacts');
        system.debug(accId);
        Account acc = [SELECT Id, Name, (SELECT Id, Name FROM Contacts)  FROM Account WHERE Id = :accId];
        return acc;
    }
}

test class---
@IsTest
private class AccountManagerTest {
    @isTest static void testGetContactByaccountId() {
        Id recordId = createTestRecord();
        // Set up a test request
        RestRequest request = new RestRequest();
        request.requestUri =
            'https://empathetic-panda-ususw6-dev-ed.lightning.force.com/services/apexrest/Accounts/' + recordId + '/contacts';
           
        request.httpMethod = 'GET';
        RestContext.request = request;
        // Call the method to test
        Account thisAccount = AccountManager.getAccount();
        // Verify results
        System.assert(thisAccount != null);
        System.assertEquals('Test record', thisAccount.Name);
    
    }  
    // Helper method
    static Id createTestRecord() {
        // Create test record
        Account accountTest = new Account(
           Name ='Test record');
        insert accountTest;
        Contact contactTest =new contact(
        FirstName='bada',
        LastName='Boom',
        AccountId=accountTest.id);
        insert contactTest;
        return accountTest.Id;
    }          
}
please can any one pss me the challenge ..
thank you
in following code 

@RestResource(urlMapping='/Account/*')
global with sharing class MyRestResource {
@HttpGet
global static Account doGet() {
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
Account result = [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId]; return result;
}
}
what is the use of this bold line in above code can any one explain mein simple words.
thank you
for ex-
@HttpPost
global static ID createCase(String subject, String status, String origin, String priority) {
Case thisCase = new Case(
Subject=subject, Status=status, Origin=origin, Priority=priority);
insert thisCase;
return thisCase.Id;
}
why we use this parameters like "String subject, String status, String origin"
thank you
i know it is easy question but i have doubt need to clear.
 what is endPointUrl actually is , it is the link of the page  or anything ,
can u clear please  with simple example
Thank you
Hii , after completing all modules , how to practice your code and all things  can any one suggest me a better way to do all things..
like i have to practice apex..
 
In REST API , i logged in to workbench but error shows....
Challenge not yet complete in trailhead playground 5
It doesn't appear that you have logged in with Workbench.
Can anyone solve this issue thank you.
What is the meaning of this line "instance of an event "
i faced it many times and the meaning is the server of salesforce u used.
But the another meaning of "instance of an event is the record of perticular data" i'm i right i don't know please any one clear it...
Thank you.
my code is :
AccountDetails.apxc
public with sharing class AccountDetails {
    @AuraEnabled
    public static list<Account> getMyAccount(){
        return[SELECT Id, NAME FROM ACCOUNT LIMIT 10];  
          }
}
 
AccountDetailsComponent.cmp
<aura:component controller="AccountDetails" >
  <aura:method name="seeDetails" action="{!c.getMessage}" 
  description="method shows Account Details"> 
    <aura:attribute name="callback" type="function" /> 
    </aura:method>
    </aura:component>

AccountDetailsComponentController
({
     getMessage : function(component, event, helper) {
       var params = event.getParam('arguments');
        if(params){
            myAcc=params.callback;
            }
        var action = component.get("c.getMyAccount");
        action.setCallback(this, function(response){
          var records = response.getReturnValue();
                  myAcc(records);        
        });
        $A.enqueueAction(action);
    }
})

ParentComponent.cmp
<aura:component >
    <aura:attribute name="AccountList" type="Account[]"/>
    <h1>Account Details:</h1>
    <c:AccountDetailsComponent aura:id= "child" />
    <aura:iteration items="{!v.AccountList}" var="item">
    <div>
          {!item.Name}
    </div>
    </aura:iteration>
    <lightning:button variant="brand" label="Show Details" onclick="{!c.callAuraMethod}" />
    </aura:component>

ParentComponentController 
({
    callAuraMethod : function(component, event, helper) {
        var Childcmp = component.find("c.child");
        Childcmp.seeDetails(function(result){
            console.log("callback for aura:method was executed");
            console.log("result: ", + result);
            var records = [];
            alert(result);
         component.set("v.AccountList",result);                 
           });
      }
})

error is:
This page has an error. You might just need to refresh it. Action failed: c:ParentComponent$controller$callAuraMethod [Cannot read property 'seeDetails' of undefined] Failing descriptor: {c:ParentComponent$controller$callAuraMethod}


thank u...

 
i have a little problem , i wrote an aura:method  in child component and while writing parent component controller what should i write  aura:method name or its action name...
hope u understand what i mean...thank u
my code is..
child component:
<aura:component controller="AccountDetails" >
 <aura:method name="sampleMethod" action="{!c.doAction}" 
  description="method shows Account Details"> 
  <aura:attribute name="param1" type="String" default="account"/> 
    <aura:attribute name="param2" type="Object" /> 
</aura:method>
 </aura:component>

parent component:


    callAuraMethod : function(component, event, helper) {
        var Childcmp = component.find("c.child");
        Childcmp.sampleMethod(function(result){
         component.set("v.AccountList",result)                 
                 });
      }
}) 
 

simply my issue is in parent component controller .....  Childcmp.sampleMethod(function(result)
                                    OR    Childcmp.doAction(function(result)

thank you
Create a formula field that determines the number of days between the end date of a contract and today.
Your renewals team wants to see how many days are left before a contract expires. Create a formula field that meets these requirements.
Object: Contract
Formula Return Type: Number
Field Label: Days Remaining
Field Name: Days_Remaining
Field Level Security: Visible and Read-Only for all profiles
Add the field to the standard Contract Layout page layout
The formula should return the number of days between the contract end date and today
The resulting API name for the field should be Days_Remaining__c
Error  message is :-
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [First_Name__c, Last_Name__c]: [First_Name__c, Last_Name__c]
i received an error in " use formula field "
Challange is :-

Create a formula field that determines the number of days between the end date of a contract and today.
Your renewals team wants to see how many days are left before a contract expires. Create a formula field that meets these requirements.
Object: Contract
Formula Return Type: Number
Field Label: Days Remaining
Field Name: Days_Remaining
Field Level Security: Visible and Read-Only for all profiles
Add the field to the standard Contract Layout page layout
The formula should return the number of days between the contract end date and today
The resulting API name for the field should be Days_Remaining__c
Error  message is :-
User-added image
My challange is to "Setup the  BOTanical app"
following instructions are :
Open an incognito browser window in Chrome.
In the incognito window, paste this link into the address bar to install the unmanaged package.
On the Salesforce login screen, enter the username and password for your Trailhead Playground, then click Log In.
Select Install for All Users, then click Install.
I did all of these without incognito window and receive error . What can i do to correct this to complete challange solve anyone plzz

they said copy the link ,
open incognito window
So in between i have little bit confusion of launching trailhead Playground . Where is to complete challange

Either in playground or copy link to incognito window ...???
After completing it shows not yet complete
 
While completing challange of install package (BOTanical)  there ia instructions of reset password , so if i have old good password then why should i change it.
if i can't change then i will not able to complete challange ?????
Thank you.
" create SOQL query in apex classes"
here  challange is create class AccountUtility
My code is :
public class AccountUtility { 
public static void viewAnnualRevenue () {
List<Account> accountsList = [SELECT Name, AnnualRevenue FROM Account]; 
String acctRev;
for(Account a : accountsList) { acctRev = a.Name + ': ' + a.AnnualRevenue;
system.debug(acctRev);
 } } }
I received an error plz help here to clear any one ,
Thank you.
I was doing the trailhead challenge on "Create SOQL Queries in Apex Classes"
Create a class
Name: AccountUtility
Create a method
Name: viewAnnualRevenue
Keywords: public, static, and void
Create a list
Name: accountsList
Create a query and assign the results to a list
Fields: Name and annual revenue (Hint: Use API names, not field names or labels)
Object: Account
Create a for loop that iterates through the query results
Object: Account
List name: accountsList
For each item, concatenate the account name, followed by a colon, followed by the account’s annual revenue: <account name> : <annual revenue>
Store the concatenated string in a variable named acctRev
Print the acctRev variable to the debug log
i write a code that shows me error
public class AccountUtility{
Public static void viewannualRevenue() {
List<Account>  accountlist = [ SELECT Name , annual Revenue From Account];
for(Account acc : accountlist){
string  accRev='<account name>: ' +acc.name+ , '<annual revenue>: ' +acc.annualrevenue;
System.debug(accRev);
}
}
}
thxx for help..
Hi, 

Please can someone can help me with this, look that is successful, but then I got an error and don`t know why. 

Starting SFDX: Set a Default Org
sfdx force:config:set defaultusername=https://um5.lightning.force.com/lightning/setup/SetupOneHome/home,Dev,DevHub,https://um5.lightning.force.com/lightning/page/home
=== Set Config
Name             Value                                                                                                                             Success
───────────────  ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────  ───────
defaultusername  https://um5.lightning.force.com/lightning/setup/SetupOneHome/home,Dev,DevHub,https://um5.lightning.force.com/lightning/page/home  false

ERROR running config:set:  No AuthInfo found for name https://um5.lightning.force.com/lightning/setup/SetupOneHome/home,Dev,DevHub,https://um5.lightning.force.com/lightning/page/home

sfdx force:config:set defaultusername=https://um5.lightning.force.com/lightning/setup/SetupOneHome/home,Dev,DevHub,https://um5.lightning.force.com/lightning/page/home
 ended with exit code 1


Many thanks, 
Iulian 
i know it is easy question but i have doubt need to clear.
 what is endPointUrl actually is , it is the link of the page  or anything ,
can u clear please  with simple example
Thank you
What is the meaning of this line "instance of an event "
i faced it many times and the meaning is the server of salesforce u used.
But the another meaning of "instance of an event is the record of perticular data" i'm i right i don't know please any one clear it...
Thank you.
my code is :
AccountDetails.apxc
public with sharing class AccountDetails {
    @AuraEnabled
    public static list<Account> getMyAccount(){
        return[SELECT Id, NAME FROM ACCOUNT LIMIT 10];  
          }
}
 
AccountDetailsComponent.cmp
<aura:component controller="AccountDetails" >
  <aura:method name="seeDetails" action="{!c.getMessage}" 
  description="method shows Account Details"> 
    <aura:attribute name="callback" type="function" /> 
    </aura:method>
    </aura:component>

AccountDetailsComponentController
({
     getMessage : function(component, event, helper) {
       var params = event.getParam('arguments');
        if(params){
            myAcc=params.callback;
            }
        var action = component.get("c.getMyAccount");
        action.setCallback(this, function(response){
          var records = response.getReturnValue();
                  myAcc(records);        
        });
        $A.enqueueAction(action);
    }
})

ParentComponent.cmp
<aura:component >
    <aura:attribute name="AccountList" type="Account[]"/>
    <h1>Account Details:</h1>
    <c:AccountDetailsComponent aura:id= "child" />
    <aura:iteration items="{!v.AccountList}" var="item">
    <div>
          {!item.Name}
    </div>
    </aura:iteration>
    <lightning:button variant="brand" label="Show Details" onclick="{!c.callAuraMethod}" />
    </aura:component>

ParentComponentController 
({
    callAuraMethod : function(component, event, helper) {
        var Childcmp = component.find("c.child");
        Childcmp.seeDetails(function(result){
            console.log("callback for aura:method was executed");
            console.log("result: ", + result);
            var records = [];
            alert(result);
         component.set("v.AccountList",result);                 
           });
      }
})

error is:
This page has an error. You might just need to refresh it. Action failed: c:ParentComponent$controller$callAuraMethod [Cannot read property 'seeDetails' of undefined] Failing descriptor: {c:ParentComponent$controller$callAuraMethod}


thank u...

 
My challange is to "Setup the  BOTanical app"
following instructions are :
Open an incognito browser window in Chrome.
In the incognito window, paste this link into the address bar to install the unmanaged package.
On the Salesforce login screen, enter the username and password for your Trailhead Playground, then click Log In.
Select Install for All Users, then click Install.
I did all of these without incognito window and receive error . What can i do to correct this to complete challange solve anyone plzz
While completing challange of install package (BOTanical)  there ia instructions of reset password , so if i have old good password then why should i change it.
if i can't change then i will not able to complete challange ?????
Thank you.
" create SOQL query in apex classes"
here  challange is create class AccountUtility
My code is :
public class AccountUtility { 
public static void viewAnnualRevenue () {
List<Account> accountsList = [SELECT Name, AnnualRevenue FROM Account]; 
String acctRev;
for(Account a : accountsList) { acctRev = a.Name + ': ' + a.AnnualRevenue;
system.debug(acctRev);
 } } }
I received an error plz help here to clear any one ,
Thank you.
Hello all! 

I am working on the 'Use Formula Fields' module and the challenge have me stumped.  The challenge is: 

"Create a formula field that determines the number of days between the end date of a contract and today."   With the following requirements: 
Object: Contract
Formula Return Type: Number
Field Label: Days Remaining
Field Name: Days_Remaining
Field Level Security: Visible and Read-Only for all profiles
Add the field to the standard Contract Layout page layout
The formula should return the number of days between the contract end date and today
The resulting API name for the field should be Days_Remaining__c

I have been consistently getting the error: 

"There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Account number must be 8 characters long.: []" 

Help would be much appreciated fellow developer wizards!  Thanks!!


 
Hi team,

I'm trying to complete the following  a Trailhead challenge :

"Create an Account Using SOAP API and SoapUI
Using SOAP API and SoapUI, create an account with the name "Bluebeards Grog House" and the description "It is better than Blackbeards." Note: if you receive a TLS error when connecting to your org with SoapUI, please see these instructions."


I'm using the following soap envelope to create the Account. Whatever I did, I have the following error message : 

Challenge Not yet complete... here's what's wrong: 
It doesn't appear that you have logged in using SoapUI.​


 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>00D24000000b1KS!AQIAQKIHBbjociN.LyBrUF2VztSYstjiP3QSDKQmvnO2LWJQ0r7myMCPq7DHWO7GN.0q5tQgftbS8Zi72_V4NWkgFoJFUo9m</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create>
         <!--Zero or more repetitions:-->
         <urn:sObjects xsi:type="urn1:Account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <!--Zero or more repetitions:-->
            <Name>Bluebeards Grog House</Name>
            <Description>It is better than Blackbeards.</Description>
         </urn:sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>

Could someone help?

Thanks in advance 
I am not able to get through this challenge. 
I logged in through SOAPUI and used the session id to create an account. The account gets created and returns success. However when I try to validate the challenge in trailhead, it gives me an error - 

Challenge Not yet complete... here's what's wrong: 
It doesn't appear that you have logged in using SoapUI.

I am not sure what did I miss out.
Here is the Question


Create an Apex class that implements the Schedulable interface to update Lead records with a specific LeadSource. Write unit tests that achieve 100% code coverage for the class. This is very similar to what you did for Batch Apex.
Create an Apex class called 'DailyLeadProcessor' that uses the Schedulable interface.
The execute method must find the first 200 Leads with a blank LeadSource field and update them with the LeadSource value of 'Dreamforce'.
Create an Apex test class called 'DailyLeadProcessorTest'.
In the test class, insert 200 Lead records, schedule the DailyLeadProcessor class to run and test that all Lead records were updated correctly.
The unit tests must cover all lines of code included in the DailyLeadProcessor class, resulting in 100% code coverage.
Run your test class at least once (via 'Run All' tests the Developer Console) before attempting to verify this challenge.


Here is my code so far

global class DailyLeadProcessor implements Schedulable {

    global void execute(SchedulableContext ctx) {
        list<leads>Lead = [select leadSource from lead where isnull= true]
        
         for (Integer i = 0; i < 200; i++) {
            Leads.add(new lead(
                name='Dream force'+i
            ));
        }
        insert Leads;
    }

I am not sure what is wrong here
The instructions state:

"The method must return the ID and Name for the requested record and all associated contacts with their ID and Name."

I am returning a List<sObject> where the first object is the Account and the remaining objects are the Contacts.

The error message is:

"Executing the 'AccountManager' method failed. Either the service isn't configured with the correct urlMapping, is not global, does not have the proper method name or does not return the requested account and all of its contacts."

I assume it is looking for a different structure to be returned by getAccount() besides List<sObject> but since Account doesn't have a field to store associated Contacts, I'm not sure what to return.

Anyone able to clarify for me what type & structure the return value should have?
I've completed the challenge, it has 100% coverage. I've checked all the method names. The URL is valid. I've used Work Bench and curl to test and even tested with multiple Accounts with and without contacts.

I know on other challenges, punctionation was important.  What about the defination of the return? Are there expected names?

I built a class to hold Account ID & Name along with a List of Contact names and IDs. Is this my issue?  Anyone else have a challenge with this challenge?


Any help or hints will be appreciated.

Here are snippets of my code:

@RestResource(urlMapping='/Accounts/*/contacts')
global with sharing class AccountManager {

....

global class APIAccount {
        public ID Id;
        public String Name;
        List<APIContact> Contacts;

...

@HttpGet
    global static APIAccount getAccount() {
        RestRequest request = RestContext.request;
...
 
Hi folks,
        Can anyone give me the real time example for apex REST callout

I wanna like 
enpoint url and apex code for real time apex callout


Thanks in advance
Karthick
Hey, is there any WhatsApp group available for salesforce developers? I want to list down it on https://wagrouplink.com

thank you.