• madhav sharma 1
  • NEWBIE
  • -11 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 31
    Replies
Hi. I am trying to get an access token for working with API

I always get the message 

{"error":"invalid_grant","error_description":"authentication failure"}*

I tried postman and curl 
 
curl -v https://login.salesforce.com/services/oauth2/token 
      -d "grant_type=password" -d "client_id=consumer_key" 
      -d "client_secret=consumer_secret" 
      -d "username=username" -d "password=password"

curl I repeat instruction from https://developer.salesforce.com/docs/atlas.en-us.api_iot.meta/api_iot/qs_auth_access_token.htm, but it still doesn't work 

what is wrong here? 
 
I have created a community and working on builder, but getting an error of - lightning...salesforce.com (org url) refused to connect. Can anyone help me know why this issue is coming and what should be done to fix this ?
Thanks,
Hello,

I am looking at the first challenge of the Trailhead's Apex Specialist Superbadge and I am facing some annoying error at the challenge 1.

When I submit my code, they ask me to populate the 'Equipment__c' field on the new Maintenance Request that has to be created from the Trigger. However, their is no 'Equipment__c' on the Maitnenance Request object.

Have you faced also this problem? How did you guys manage to solve it?

Thanks a lot!!
hi guys, i have one  government  tax editable/fillable  pdf form, uploaded into the static resource and from controller need to bind the values to that particular pdf and download the file ..

Do any one worked in such a way , Need your valuable suggestions to work on ..

Thanks and Regards,
Sfdc Franklin
Tryng to complete this module:

https://trailhead.salesforce.com/content/learn/projects/quick-start-build-a-workplace-command-center-app/set-up-your-developer-org

After create the my own dev org, there is a step:

2. In the Challenge section at the bottom of this page, select Log into a Developer Edition from the picklist.

I cannot fild the "Challenge section" mentioned above.

Can someone help?
Hi,

I need to create a formula field(Forecast Amount) and display total amount based on below criteria.

If Opportunity type = New
show sum of = Field 1 and Field 2 

If Oppotunity Type = Renewal
Show = field 3

I need both the conditions in same formula
Hi,

I am creating an LWC, where I am trying to do in multiple dynamic row entering record details and doing Quick Save. In Quick save function in js file i am sending the list value to Apex class method and doing upsert there and returning inserted records list to js file again from that same method. So that I can show in the same page and do update to the same record. But I unable to return that list to js file from apex. So if I do some modification and quick save it is creating another record instad of update (as id not there ). Can anyone help me on this how can i achieve it?

Thanks in advance!!
Hi,
Here is the usecase.
On Opportunity record, I want to show a Archive button. Onclick of the Archive button a prompt must display “Do you want to Archive the record?” , Cancel and Continue button must be displayed. Onclick of Cancel button the prompt must be closed.
Onclick of the Continue button the status of the record must be updated as ‘Archived’ and the Name of the record must be appended with ‘_Archived’. How can achieve this use case?
I have tried to create a flow and called from Quick action, but in flow i am not able to update a Status field? Does Lightning component required to achieve this case?
 hi, guys i have around 50 to 60 callouts with same code only Endpoint will changes in every method,  so how to reuse the same set of http code in all the methods, any solution for this will be apperiacated for the code re useability.. 
 
public void method1(){

  Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals');
request.setMethod('GET');
HttpResponse response = http.send(request);
// If the request is successful, parse the JSON response.
if (response.getStatusCode() == 200) {
    // Deserialize the JSON string into collections of primitive data types.
    Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
    // Cast the values in the 'animals' key as a list
    List<Object> animals = (List<Object>) results.get('animals');
    System.debug('Received the following animals:');
    for (Object animal: animals) {
        System.debug(animal);
    }
}

}


public void method2(){

  Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://th-apex-http-callout.herokuapp.com/countries');
request.setMethod('GET');
HttpResponse response = http.send(request);
// If the request is successful, parse the JSON response.
if (response.getStatusCode() == 200) {
    // Deserialize the JSON string into collections of primitive data types.
    Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
    // Cast the values in the 'countries' key as a list
    List<Object> countries= (List<Object>) results.get('countries');
    System.debug('Received the following countries:');
    for (Object country: countries) {
        System.debug(country);
    }
}

}

Note: how to reuse the same code in all the methods arount 50 methods, only the endpoint will changes here .. 

Thanks and regards
Soumya sree 
Hi,

I am trying to do trialhead Lightning platform api basics > Use SOAP api 
I logged in succesfully, but trying to create account via SOAP api, got error.

My request in SOAP api

<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>00D28000001PJ51!AREAQGVMdkru90jT8tISYYEoNMpiFQXFWEFI.nqbaOy_gGRIxX4qbw9QJEd2K6vLmuqnWQ5vVGfRxwPjvgmxSs0vNzky0GGp</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create>
         <!--Zero or more repetitions:-->
         <urn:sObjects xsi:type="urn1:Account" xmlns:xsi="https://login.salesforce.com/services/Soap/c/50.0/0DF0I0000000mmX">
           <Name>Bluebeards Grog House</Name>
           <description>It is better than Blackbeards.</description>
         </urn:sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>


Response is 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>UNKNOWN_EXCEPTION</faultcode>
         <faultstring>UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService</faultstring>
         <detail>
            <sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault">
               <sf:exceptionCode>UNKNOWN_EXCEPTION</sf:exceptionCode>
               <sf:exceptionMessage>Destination URL not reset. The URL returned from login must be set in the SforceService</sf:exceptionMessage>
            </sf:UnexpectedErrorFault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>


I understood that URL which i have sent, that is wrong. Please suggest correct one.
Up on authorize an org in VS code getting below error:

Error: spawn powershell ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn powershell',
path: 'powershell',
spawnargs: [
'-NoProfile',
'-NonInteractive',
'–ExecutionPolicy',
'Bypass',
'-EncodedCommand',
'UwB0AGEAcgB0ACAAIgBgACIAaAB0AHQAcABzADoALwAvAHQAZQBzAHQALgBzAGEAbABlAHMAZgBvAHIAYwBlAC4AYwBvAG0ALwAvAHMAZQByAHYAaQBjAGUAcwAvAG8AYQB1AHQAaAAyAC8AYQB1AHQAaABvAHIAaQB6AGUAPwByAGUAcwBwAG8AbgBzAGUAXwB0AHkAcABlAD0AYwBvAGQAZQAmAGMAbABpAGUAbgB0AF8AaQBkAD0AUABsAGEAdABmAG8AcgBtAEMATABJACYAcgBlAGQAaQByAGUAYwB0AF8AdQByAGkAPQBoAHQAdABwACUAMwBBACUAMgBGACUAMgBGAGwAbwBjAGEAbABoAG8AcwB0ACUAMwBBADEANwAxADcAJQAyAEYATwBhAHUAdABoAFIAZQBkAGkAcgBlAGMAdAAmAHMAdABhAHQAZQA9ADAAMABhAGUAYwBmAGQANwA0ADEAYgA1ACYAcAByAG8AbQBwAHQAPQBsAG8AZwBpAG4AJgBzAGMAbwBwAGUAPQByAGUAZgByAGUAcwBoAF8AdABvAGsAZQBuACUAMgAwAGEAcABpACUAMgAwAHcAZQBiACYAYwBvAGQAZQBfAGMAaABhAGwAbABlAG4AZwBlAD0AaABtAE4ARgB4AEIARAB1AFIAVwB4AHYAeABxAFAASwBOAEQAWQAtAGMARwBIADkASwBuAGcAeQBxADcAVwBpAF8AbQBEADgAcQBCAFIAQgBzAEsAOABgACIAIgA='
]
}
Hi,
How to retrieve picklist values of a field dynamically and display it in Lightning Aura Component?

Rgds,
Vai.

Hello all,
 
I would like to discuss a situation I encountered when I am trying to use the Composite API and the Composite Graph to build an integration from a middleware built in Java towards a Salesforce REST API:
 
We are trying to create a request that implies the following operations:
- 1 Account Upsert
- 1 Individual Upsert
- N ContactPoint Upsert
 
If I try to build the request with Composite API I will encounter a problem if I am trying to upsert more than 23 ContactPoint in the same Composite API due the 25 sub request limitation.
 
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_composite.htm
 
If I try to build the request with Composite Graph I will encounter a problem if I am trying to upsert more than 13 Contact Point in the same Composite Grapth due the 'limit of number of types of operations in a Graph call reached'.
 
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_graph_limits.htm
 
 
    "compositeRequest": [{
            "method": "PATCH",
            "url": "/services/data/v{{version}}/sobjects/Account/MDP_fld_extId__c/extId",
            "referenceId": "upsertAccount",
            "body": {
                ...
            }
        }, {
            "method": "PATCH",
            "url": "/services/data/v{{version}}/sobjects/Individual/id",
            "referenceId": "updateIndividual",
            "body": {
                ...
            }
        }, {
            "method": "PATCH",
            "url": "/services/data/v{{version}}/sobjects/ContactPointEmail/MDP_fld_extId__c/extId",
            "referenceId": "upsertContactPoint1",
            "body": {
 
 
            }
        }, {
             n upsertContactPoint
        }
    ]
    }
 
 
I don't know if this is how it should work and the way the Composite Graph nodes are counted. If counts each request for a record as 1, then I don't know why it allows 500 subrequests per Graph as I seems a bigger limitation than the original Composite.
 
If anyone could help me with this I would be very grateful.
 
Thank you very much.
 
Junjie.
Hi,

I am relatively new to interacting with Apex classes.  When pushing a change-set to production there is a validation error on the change-set due to an apex class that a previous consultant created and it is blocking the deployment.  I have worked through change-set before and never encountered this error.

The apex class itself is irrelevant and I wish to delete it completely from production.  I am slightly concerned about this because if I delete it from production I am not sure of the ramifications of how it interacts with other areas our instance.

Attached is a file of the error from the change set.  If you have advice about the best way to go about this that would be great.User-added image
Hi,

I'm stucked on Service Cloud Specialist step 6. It shows the error message:

Challenge Not yet complete... here's what's wrong: 
We can't find the Recipient field in the email template. Ensure the Cloudy Weather Email Template addresses the Recipient of the email.
Close errors

However, my email template called Cloudy weather (Text format) has the following body:

Hey {!Contact.FirstName}, Sorry to hear that your panels aren't generating the power you hoped for. Based on our research, it appears the low power produced is related to the cloudy weather in your area recently. In the worst conditions, Ursa Major panels produce ~25% of maximum power. If you have additional questions, please give us a call and reference case {!Case.CaseNumber}. Thanks! {!User.Name}, Ursa Major Solar

Any ideas?

Regards
Hi.  I am doing the tralhead https://trailhead.salesforce.com/modules/lex_javascript_button_migration/units/javascript_buttons_to_lightning_actions

I have attempted to do this tralhead for about 3 weeks now -- sent in some feedback, but no change seems apparent in the tralhead.

1.  I created a brand new "My Trailhead Playground 2"
2.  Open the Developer console.
3.  Create a Lightning Component called CreateUser.cmp
4.  Copy the text in for this code.
5.  Press Save
6.  Get Error.  Failed to save CreateUser.cmp: Invalid <aura:attribute> type: Test_User__c: Source

In order for this to save, I had to create an object Test_User (Test_User__c) with the following fields:
First or First__c
Last or Last__c
Nickname or Nickname__c
Email or Email__c
Password or Password__c

I also had to change several lines of code to reflect the Field name xxx__c rather than what was listed in the tralhead.
value="{!v.user.First}"  to value="{!v.user.First__c}"  etc.

I haven't finished with the tralhead examples...but I hope this will work.

Would someone please update the tralhead or fix it?

Thanks,
Stuart


 
Hello Experts,

In Contact Object, there is no field name Owner then how it is able to access "Contact.Owner.email" ??
Please explain its internal working.
Thanks.
Hi All,
Below is my code of VF page that i am rendering from another page via link :
Visualforce Page: Hierarchy_Clone 

<apex:page standardController="Account" showHeader="true" sideBar="true">
<apex:form > <c:HierarchyTree currId="{!Account.id}" />
</apex:form>
</apex:page>

But i am not getting a desire page because its not opning with sidebar and header.please suggest how to solve this issue.