• Deepali Kulshrestha
  • SMARTIE
  • 600 Points
  • Member since 2016
  • Salesforce Developer
  • Cloud Analogy


  • Chatter
    Feed
  • 19
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 133
    Replies
I have been working on this superbadge today and all challenges have been checking fine until now, at which point I'm getting the following error.  I created a new playground for this challenge and the only activity I've completed in this playground has been tasks for this superbadge.  All other errors have been related to corrections I've needed to make in challenges along the way, but this one seems to be out of my control.  Can anyone help?
Error text
Hello,

I have a code like below
Cache.OrgPartition part = Cache.Org.getPartition('local.XYZToken');

I want to know how to clear the Cache and put inside the cache.

thanks 
Hi All,

I am getting below error when I run a test on a QuoteLineItem test class I created.
System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Pricebook2Id]: [Pricebook2Id]

My test class is below:

@isTest
public class QuoteLineItemResourceTest {
    public static testMethod void getQLI() {
    
        Account objaccount=new Account();
        objaccount.Name='TestAccount';
        insert objaccount;
        
        Id standardPB = Test.getStandardPricebookId();
        
        Opportunity objopportunity=new Opportunity();
        objopportunity.AccountID=objaccount.id;
        objopportunity.Name='TestOpportunity';
        objopportunity.StageName='Prospecting';
        objopportunity.CloseDate=Date.today();
        objopportunity.Pricebook2Id = standardPB;
        insert objopportunity;
        
                 
         Product2 objProduct2=new Product2();
         objProduct2.Name='ABC';
         objProduct2.CurrencyIsoCode='USD';
         insert objProduct2;
         
         PricebookEntry objpricebookentry =new PricebookEntry();
         objpricebookentry.Product2ID = objProduct2.id;
         objpricebookentry.UnitPrice=23.50;
         objpricebookentry.UseStandardPrice=true;
         objopportunity.Pricebook2ID=standardPB;
         insert objpricebookentry;
         
         Quote q1 = new Quote();
         q1.Name = 'Quote 1';
         q1.Budget_Estimate__c = 100;
         q1.OpportunityId = objopportunity.Id;
         q1.Pricebook2ID=standardPB;
         insert q1;
         
         QuoteLineItem objQLI = new QuoteLineItem(QuoteId = q1.Id,
                                                Quantity = 5,
                                                UnitPrice = 10,
                                                PricebookEntryId=objpricebookentry.id,
                                                Product2ID=objProduct2.id,
                                                Operating_System_Id__c = '1;2', 
                                                Third_Party_Provider_Id__c = '3;4',
                                                Third_Party_Audience_Id__c = '5;6',
                                                Country_Id__c = '7;8',
                                                State_Id__c = '4;5',
                                                DMA_Id__c = '6;7',
                                                Content_Limitation_Id__c = '4;5',
                                                Carriers_Id__c = '1;3',
                                                Weather_Temperatures_Id__c = '2;3',
                                                Weather_Conditions_Id__c = '4;5',
                                                Geosegment_Id__c = '2;3',
                                                Start_Date__c = Date.today().addDays(1),
                                                End_Date__c = Date.today().addDays(10),
                                                Planned_Cost__c = 100,
                                                Rate__c = 10,
                                                Planned_Unit__c = 100,
                                                Cost_Method__c = 'CPM');
        insert objQLI;
    

       
       Test.startTest();
        RestRequest req = new RestRequest(); 
        RestResponse res = new RestResponse();
        req.requestURI = '/services/apexrest/QuoteLineItem/'+objQLI.Id; 
        req.httpMethod = 'GET';
        req.addHeader('Content-Type', 'application/json'); 
        RestContext.request = req;
        RestContext.response = res;
        QuoteLineItemResource.doGet();
       
   Test.stopTest();   
   
   
    }
}

Any help will be appreciated. Thanks.
Hi! I'm just starting my Trailhead journey and wanted to pick your brains about how to best set this all up!

I will be leaving my company in a few weeks, yesterday I started Trailhead by logging in with LinkedIn (rather than a seperate new account).
Today I realised that when had I clicked to create the Trailhead Playground, this looks like it's linked to my SF work account which will be disappearing.

I have followed some advice posted here and created a developer account so I have the sandbox to play with, but it doesn't have the already-created playground setup that was created from Trailhead with my other account.

So.... should I start again with Trailhead using my Developer account to learn against (rather than the LinkedIn login).. will this allow me to create the playground pre-setup environment?

Also if I do this, and I'm not logged in to LinkedIn whilst progressing with Trailhead, is it just as easy to show badges etc from Linkedin if you're using a specified dev account rather than being logged into LinkedIn itself?

Thanks.
The button with the label “Activate Accounts”, when the User clicks the button “Activate Accounts”, the selected accounts should get the status Active = “Yes”.

The user also needs to get feedback about the successful update or any errors. The list should refresh after a successful update
I have the following trigger on a custom object. Basically it counts the nr of characters from a text filed and display the info in to a numeric filed. The trigger is working as expected when the object is being updated but it fails when you create a new one. 

trigger count_nr_of_characters_on_sales_description_es on pba__Property__c (before insert, before update){ 
for(pba__Property__c a: Trigger.new){ 
System.debug('Number of Characters for Description Field: ' + a.fm_web_Long_description_es__c.length()); 
a.Nr_of_characters_sales_description_es__c = a.fm_web_Long_description_en__c.length(); 

}
Create a method for inserting accounts.

To pass this challenge, create an Apex class that inserts a new account named after an incoming parameter. If the account is successfully inserted, the method should return the account record. If a DML exception occurs, the method should return null.

The Apex class must be called AccountHandler and be in the public scope
The Apex class must have a public static method called insertNewAccount
The method must accept an incoming string as a parameter, which will be used to create the Account name
The method must insert the account into the system and then return the record
The method must also accept an empty string, catch the failed DML and then return null
Hello,

I am sending an email from an apex class like
 
Messaging.SendEmailResult [] r = 
 Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});

This email is sent afer a modification made on opportunity.

When i send email:
I have Body, attachment.

I want this email to be showed on Opportunity.

Can i show this as Task and add it on related list on Opportunity ?
or I add an attachment and say that opportunity is the parent.

thank you in advance for suggestions
Hello,

I have developed a webservice on the salesforce , i exposed the data. Hence the user can connect to salesforce and read the information.

i have created a connected app and also secifieda user with API acess.

How can i create a swagger and let the user test the API

Thank you in advance
Hi,

Good Day!

How should i assign today date to 'Actual_start_date__c', When Start Project(Custom button) is clicked. The javascript code for the custom button is given below. 
 
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 

// identify the record 
var o = new sforce.SObject("Project__c"); 
o.id = "{!Project__c.Id}"; 

// Update the Record Type 
o.RecordTypeId = '01210000000FCJwAAO'; 
o.Status__c = 'Active';
o.Actual_start_date__c = {!TODAY()};

// save the change 
//sforce.connection.update(o); 
var result = sforce.connection.update([o]); 

//refresh the page 
//window.location.reload(); 

if( result[0].success === "true" ) { 
window.location.reload(); 
} 
else { 
alert( result[0].errors.message ); 
}


Thanks in advance,
Durairaj
Two users are having same profile and same role. If we want to restrict the record usage to one of the users, how can we achieve it?
Hi Guys,

I am new to salesforce and coding, need your help on below query:

I want to write a trigger to update the child record on the basis of parent record.

Parent Object: Account
Field: External_system__c

Child Object(Custom object): Classification__c
Field:Business_Status__c

Whenever a account is created with external_system__c=123 then the classification Business_Status__c should get updated to 'Active' and it should run only once on classification creation time.

Any help will be highly appreciated!!
  • January 02, 2019
  • Like
  • 0
Hello,

I have needed to write onblur event of div which is desingned to have a background image But this is not working.If some one have implemented this functionality then please share me.
Hi Friends,

I posted this below url to get access_token and i got access token also
But i want to create case , i dont know how to do this, please guid me with this issue

Note : I am using Postman tool for this action please help me how to pass the value

To Get Access_Tokent : -
Request : 
https://login.salesforce.com/services/oauth2/token?grant_type=password&username=r.ramesh@gmail.com&password=Ramesh@1234566QgZqsEmPk9JNxbeI6M9NV7&client_id=3MVG9pe2TCoA1Pf79wjDZewH4FE_H2OQVnt8rhRW4xG.Vn5c7OImJjmd18fUXPWRq3DJA5J3E0sB3Ci96PGd9&client_secret=8545568721922272496&redirect_uri=https://localhost:8443/RestTest/oauth/_callback

Response :
{
    "access_token": "00D0o000001AkD7!ARkAQHB5ZXtMMaH3QHUvkXxQJKPySstRsLaj3NIZZrgwC5Xgfu6QKURHop5_9p0beoED4P8ARDES8e1tAaAAoIBLeh8nKGFk",
    "instance_url": "https://ap8.salesforce.com",
    "id": "https://login.salesforce.com/id/00D0o000001AkD7EAK/0050o00000VMLvRAAX",
    "token_type": "Bearer",
    "issued_at": "1546239021943",
    "signature": "la6GCV2T8xhwyML9q+Xb5UnRwkOGaPG1QNddi+j2n+g="
}
Hi I have a application form in the portal. Once it has been filled by the person by that name need to create a user in the Sfdc. Can I know we cam make this functionality.

Regards
Rajesh
While iteration through a list in for loop, I noticed value is changed for the list without updating it. In the below code list 'cUser' should store same value for any iteration but here it is changing when a 'for' local variable is updated with new value, and same change is reflecting in the List 'listContact'

Please help me to understand what I am doing wrong.

Scenario :
Insert a new contact with the below details(contact standard fields) and run the below mentioned code in 'Execute Anonymous Window'
fistname='fname'
lastname='LastNameTest'
 
String str='LastNameTest';
List <Contact> listContact = new List <Contact>();
List<Contact> cUser = [Select id, firstname,lastname from Contact where lastname = :str];
for(integer i=0;i<2;i++){
    system.debug('** i='+i+'  ** cUser **  ' + cUser);
	for(Contact conTemp : cUser){
        if(i==0){
            system.debug('** if- before **' + conTemp);
            conTemp.firstname = 'abc';
            listContact.add(conTemp);
            system.debug('** if - after **' + conTemp);
        }
        else if(i==1){ 
            system.debug('## else-if-before ##' + conTemp);
            conTemp.firstname = 'xyz';
            listContact.add(conTemp);
            system.debug('## else-if-after ##' + conTemp);
        } 
     }
	system.debug('listContact = '+listContact);
}
                            

Actual Output : 

User-added image

01:30:10:009 USER_DEBUG [5]|DEBUG|** i=0  ** cUser **  (Contact:{Id=0030I00001q6J8QQAU, FirstName=fName, LastName=LastNameTest})
01:30:10:009 USER_DEBUG [8]|DEBUG|** if- before **Contact:{Id=0030I00001q6J8QQAU, FirstName=fName, LastName=LastNameTest}
01:30:10:009 USER_DEBUG [11]|DEBUG|** if - after **Contact:{Id=0030I00001q6J8QQAU, FirstName=abc, LastName=LastNameTest}
01:30:10:009 USER_DEBUG [20]|DEBUG|listContact = (Contact:{Id=0030I00001q6J8QQAU, FirstName=abc, LastName=LastNameTest})
01:30:10:009 USER_DEBUG [5]|DEBUG|** i=1  ** cUser **  (Contact:{Id=0030I00001q6J8QQAU, FirstName=abc, LastName=LastNameTest})
01:30:10:009 USER_DEBUG [14]|DEBUG|## else-if-before ##Contact:{Id=0030I00001q6J8QQAU, FirstName=abc, LastName=LastNameTest}
01:30:10:010 USER_DEBUG [17]|DEBUG|## else-if-after ##Contact:{Id=0030I00001q6J8QQAU, FirstName=xyz, LastName=LastNameTest}
01:30:10:010 USER_DEBUG [20]|DEBUG|listContact = (Contact:{Id=0030I00001q6J8QQAU, FirstName=xyz, LastName=LastNameTest}, Contact:{Id=0030I00001q6J8QQAU, FirstName=xyz, LastName=LastNameTest})

Expected output::
01:30:10:009 USER_DEBUG [5]|DEBUG|** i=0  ** cUser **  (Contact:{Id=0030I00001q6J8QQAU, FirstName=fName, LastName=LastNameTest})
01:30:10:009 USER_DEBUG [8]|DEBUG|** if- before **Contact:{Id=0030I00001q6J8QQAU, FirstName=fName, LastName=LastNameTest}
01:30:10:009 USER_DEBUG [11]|DEBUG|** if - after **Contact:{Id=0030I00001q6J8QQAU, FirstName=abc, LastName=LastNameTest}
01:30:10:009 USER_DEBUG [20]|DEBUG|listContact = (Contact:{Id=0030I00001q6J8QQAU, FirstName=abc, LastName=LastNameTest})
01:30:10:009 USER_DEBUG [5]|DEBUG|** i=1  ** cUser **  (Contact:{Id=0030I00001q6J8QQAU, FirstName=fName, LastName=LastNameTest})
01:30:10:009 USER_DEBUG [14]|DEBUG|## else-if-before ##Contact:{Id=0030I00001q6J8QQAU, FirstName=fName, LastName=LastNameTest}
01:30:10:010 USER_DEBUG [17]|DEBUG|## else-if-after ##Contact:{Id=0030I00001q6J8QQAU, FirstName=xyz, LastName=LastNameTest}
01:30:10:010 USER_DEBUG [20]|DEBUG|listContact = (Contact:{Id=0030I00001q6J8QQAU, FirstName=abc, LastName=LastNameTest}, Contact:{Id=0030I00001q6J8QQAU, FirstName=xyz, LastName=LastNameTest})
Guys Pls help, I am new to Salesforce,
In Google, I'm getting a lot of code I did n't understand that,
pls, explain with a simple example.

Any help greatly appreciated,
Thanks In advance,
Arun.



 
Hi All,
I want to get grand total of formula field.My report is meant to give the movement of work in progress value from month to month. For the same I have created two formula fields and every thing is working fine. Now what I want is to get grand total of one of the formula field. It is a matrix report. Please help me with this.

Thanks in advance.User-added image
 
Hi,
I created a process builder recently. As it was no longer in use I deleted it from my org. Now, while making any changes in the records I am still receiving the mail with error message regarding process builder failure. 
Error element myRule_1_A1 (FlowRecordUpdate).
The flow tried to update these records: 0034100000TxUl2AAF. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: Record rolled back because not all records were valid and the request was using AllOrNone header.

It would be helpful of you if you can solve my problem.
Regards,
Deepali
Hi,
I am trying to create dashboard using Sales Analytics app. It seems that lot has been changed in Winter'18 release. While creating new app I am getting following ERROR: 33 User Dataflow Instructions executed, 41 failed.Please let me know how to resolve it. Thanks 
Hi All, 
I am new to Pardot. My requirement is to send email alert to user and an additional email whenever a Prospect is created in Pardot. I want to send the same email which is generated by default to assigned user only. I tried creating engagement studio and one-to-one email but was not able to find the solution. Please help me solve my issue
Hi All,
While setting up developer console for my Enterprise edition I don't know why it is not showing up in lightning inspite of the fact that lightning is enabled for the org.​ Can anyone help me with it?​
User-added image

Regards,
Deepali
When I am doing my Lightning Reports and Dashboards Superbadge, after I create the Top Case Drivers by SolarBot Ownership, it comes up with the following error... "There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: WNGEFDSV", if I then delete that report then it says "We can’t find a report with name “Top Case Drivers by SolarBot Ownership” in the correct folder, or it uses an incorrect report type."
Hi Team,

I am working on "Lightning Experience Rollout Specialist" Super Badge and all of the sudden I am getting this following error
"Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: BIYYUZCU"

PLease do check it and fix this ASAP
Hello,

I have developed a webservice, i want to write a test class for the same. 
Can somone guide me on the test class ?

Thank you in advance 
Can anyone tell me why we dont have before undelete trigger ?
<aura:component implements="lightning:homeTemplate" 
                description="Lightning Home Page Template with One Region" >
    <aura:attribute name="column1" type="Aura.Component[]" />
    
    
    <div>
        <lightning:layout horizontalAlign="spread" pullToBoundary="small">
            <lightning:layoutItem size="4" flexibility="grow" 
                                  padding="around-small">
                {!v.column1}
            </lightning:layoutItem>
           
        </lightning:layout>
    </div> 
</aura:component>
anyone have an idea on how to create a custom template on lightning app builder
I just got an Error while trying to verify my challenge "Create reports and dashboards" in the Superbadge Trail "Business Administration Specialist" (https://trailhead.salesforce.com/de/content/learn/superbadges/superbadge_business_specialist). The system tells me:

"Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: YYYRAMMG"


I tried the challenge with a all-new Trailhead Playground in which all challenges within the Superbadge worked.

Can someone help me with this?

Thanks!
What is the difference between auth and oauth ? 
Got this error when working on step 7, Dashboard creation. Please help.

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: NGYUXALB

Hi,
My client asks me to use AES ECB PKCS5 128 encrypting method. I found a way to do it via JavaScript but that can presents some security issues.

Unfortunately, ECB mode is not supported in Salesforce (only CBC). I would like to find a way to do it in Apex. Maybe is there any solutions on AppExchange?

Thanks,
​​​​​​​Mik Jaf

Hi all.
I'm totally newbie at using Oauth2.0. Please help me kindly.

Before now, I've used Site for making public api.
However, this time, I need to consider security. So, after several hours study, I'm trying to use Connected App/Oauth2.0.
Using connectedApp(CId, CSecret) and username/password, I can get Access Token.

The point that I cannot understand now is 'Valid time of Access Token'.
Is it permanent for the same connected App and consumer?
or it is changed everytime it is issued?

1. Everytime calling api, get Access Token using CId, CSecret, username, password.
2. Using static attr, store access token and then, calling api with access token.
    Add logic : if static sttr is empty, get access token again.

Is 1 or 2 right approach? or any other things I need to consider?

Thanks!
I have been working on this superbadge today and all challenges have been checking fine until now, at which point I'm getting the following error.  I created a new playground for this challenge and the only activity I've completed in this playground has been tasks for this superbadge.  All other errors have been related to corrections I've needed to make in challenges along the way, but this one seems to be out of my control.  Can anyone help?
Error text
public class AccountController {
    @AuraEnabled
    public static List<Account> getLimitedAccounts(){
        List<Account> accounts = [SELECT Id, Name, Phone
                                  FROM Account ORDER BY CreatedDate LIMIT 20];  
        return accounts;
    }
}
  • February 01, 2019
  • Like
  • 0
Hello,

I have below code wheni try to get acccess token from Ouath 2.O
 
"common.apex.runtime.impl.ExecutionException: You have uncommitted work pending. Please commit or rollback before calling out"|

Can someone guide me ?
I am aware of configuring the body of it from the dropdown by selecting the edit layout but there is no option to configure the Header via that way. Any suggestions or ideas ?
Hello,

I am communicating with a externa webservice with the Ouath 2.0.

I wanted to know how can i replace this with an certificate. 

Thank you for advise.
As what I asked above, how can I do that in apex code?
Plz tell me step by step in codes.

PS:I didn't find profile about "Custom Community" profile?