• sfdcDeveloper 12
  • NEWBIE
  • 60 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 11
    Replies
User-added image

I have created two LWC component and in my prop.html I want to add lWC component.

<template>
    <ligthning-input label="percentage" type="number" min="0"
    max="100" value={percentage} onchange={changepercent}></ligthning-input>   
    <c-lwc percentage={percentage}></c-lwc>
</template>

When I try to push this to my scratch org I am getting the following error

User-added image

I am new to LWC

Happy Friday All!

Our AEs don't always remeber to add CampaignMembers when they create Tasks related to the Campaign. To save the AEs and kepp marketing happy it was decided that we could use an Apex Trigger to check if the Contact was already a CampaignMember and add if they were not.

I think my code is close, but it is not adding the CampaignMember. Can someone please take a look at my code to show me what I missing?


Kind regards,


Robert.

 

trigger Task_to_CampaignMember on Task (after insert, before update) {

//WhoId is ContactId;
//WhatId is CampaignId;

  List<ID> WhoIds = new List<ID>();
  List<String> prStr = new List<String>();
  List<CampaignMember> newList = new List<CampaignMember>();

for(Task Tsk: Trigger.new){
    String WhtId = Tsk.WhatId;
    String CmpPfx = WhtId.substring(0,3);	 

    if(CmpPfx == '701') //'701' Prefix is Campaign
	{
		prStr.add(Tsk.WhatId); 
	}
}

  
Map<String,Id> cmMap = new Map<String,ID>();

for(CampaignMember cm1 :[select id,CampaignId,ContactId from CampaignMember where CampaignId IN: prStr])
{
	cmMap.put(cm1.CampaignId,cm1.Id);

}

for(Task Tsk: Trigger.new){
    if(Tsk.WhatId!=Null)

	{
		CampaignMember cm = new CampaignMember(CampaignId=Tsk.WhatId,ContactId=Tsk.Whoid,Status='Responded');
		newList.add(cm);
	}
}

if(newList.size()==0)
{
	insert newList;
}


}
We have enabled lightning scheduler in our org and we need to add the scheduling app in our external website.
I have setup all the things given here (https://help.salesforce.com/articleView?id=ls_set_up_inbound.htm&type=5), but still I can't see anything in my external website. I guess, I'm confused with external page for an inbound scheduling flow (Which I created in salesforce) and Inbound Scheduling Flow (Which is in my external site).
But not sure what I missed. If would be great if anyone help me on this.
 
I'm looking for one appexchange products, which can help me scheduling meeting with my customer.
Bascially it will be added on my website and from there customers can schedule meeting with my agents based on availability. I also need to sync these meeting with my office 365.
I have couple of products in mind like: Calendy, Salesforce Lightning scheduler, Sumo Scheduler.
If anyone has experience with any of these or any other scheduling app please let me know how is the product.
 
I'm trying to change the default live agent icon with the custom image in my salesforce site. But its not getting updated. Here is the current Icon:
User-added image

I'm not able to find the correct place where I need to change the icon. I tried to update embedded_svc.settings.defaultMinimizedTex but it update the highlighted part in image. It's even not taking the image of chat button. Not sure from where to replace the icon.
 
<img id="liveagent_button_online_5730O000000byoz" style="display: none; border: 0px none; cursor: pointer" onclick="liveagent.startChat('5730O000000byoz')" src="https://saasdeveloper-developer-edition.ap7.force.com/liveAgent/resource/1555073074000/chat" /><div id="liveagent_button_offline_5730O000000byoz" style="display: none;"><!-- Offline Chat Content --></div><script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('5730O000000byoz', document.getElementById('liveagent_button_online_5730O000000byoz'));
liveagent.showWhenOffline('5730O000000byoz', document.getElementById('liveagent_button_offline_5730O000000byoz'));
});</script>

 
has anyone used any shift tracking app in salesforce. I know we don't have any OOTB feature in shift tracking. I checked there is one "ShiftExpert" product in appexchange. is there any other product?
I'm not able to add quick action on Lightning page named Key Sales Data. I can't see option to add Quick Action. Is there any permission which I need to enable?
I'm getting error while testing JWT Auth Flow

NARENDER@NARENDER-PC MINGW64 ~/desktop/SalesforceDX
$ sfdx force:auth:jwt:grant --clientid ${CLIENT_ID}     --jwtkeyfile ${JWT_KEY_FILE} --username ${HUB_USERNAME}     --setdefaultdevhubusername
 !    Unexpected argument C:Users/NARENDER/Documents/certificates/server.key


Not sure what I'm missing
How to add actions in a lightning page. I'm not able to add action. It seems to add action is not appearing in my app.
While completing developer console basics training I'm getting below error.
Ensure that your Execution Details perspective contains the Stack Tree, Execution Stack, Source, and Execution Overview panels.

Even though I have added all these panels in my Execution details perspective.
 
I'm getting this error while completing the trail head chalenge on Wave mobile exploration:
The 'Top Engineering Sales' lens does not appear to have the correct query. Please check the requirements and ensure everything is setup correctly. 

I have completed each and every thing asked in this module. I don't know if I'm missing anything.
I'm getting below error when I'm trying to create new account record using SOAPUI using SOAP API.
Error 405 GET not supported

I'm not able to change GET method to POST method.
I am getting below error 
"Challenge Not yet complete... here's what's wrong: 
The 'PhoneNumberInput' client-side controller is not setting the phone param"

Below is my code:
<aura:component >
    <aura:attribute name="number" type="String" default="No Phone Number"/>
    <ui:outputText aura:id="phone" value="{!v.number}"/>
    <aura:handler event="c:PhoneNumberEvent" action="{!c.answer}"/>

</aura:component>
 
<aura:component >
    <ui:inputPhone aura:id="phone" label="phone" />
    <aura:registerEvent name="phone" type="c:PhoneNumberEvent"/>
    <ui:button label="Show Phone" />
</aura:component>
 
<aura:event type="APPLICATION" description="Event template">
    <aura:attribute name="phone" type="String"/>
</aura:event>
 
<aura:application >
    <c:PhoneNumberInput />
    <c:PhoneNumberOutput />
</aura:application>

Thanks in advance for help

 
I have completed my all required challenge to win Compass of Wisdom badge and Cloak of Adventure sweatshirt but still didn't receive any mail.
I am not able to save my test class:

Below is my test Class:
@isTest
private class AnimalLocatorTest{
    @isTest static void AnimalLocatorMock1() {
        Test.setMock(HttpCalloutMock.class, new AnimalLocatorMock());
        string result = AnimalLocator.getAnimalNameById(0);
        String expectedResult = 'dog';
        System.assertEquals(result,expectedResult );
    }
}
My Mock Class:
@isTest
global class AnimalLocatorMock implements HttpCalloutMock {
    // Implement this interface method
    global HTTPResponse respond(HTTPRequest request) {
        // Create a fake response
        HttpResponse response = new HttpResponse();
        response.setHeader('Content-Type', 'application/json');
        response.setBody('{"name": ["dog"]}');
        response.setStatusCode(200);
        return response; 
    }
}

My Rest Class:
public class AnimalLocator{
    
    public string getAnimalNameById(Integer id){
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/:'+id);
        request.setMethod('GET');
        HttpResponse response = http.send(request);
        String ret;
        
        if(response.getStatusCode() == 200){
            Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
            List<Object> name = (List<Object>) results.get('name');
            for (Object animal: name) {
                ret = (String)animal;
            }
            
        }
        return ret;
    }


 
Getting below error:
"Challenge not yet complete... here's what's wrong: 
The 'My Data' Lightning App was not found."

I already created Lightning App and added custom component to that app
Not able to set the predefined value of the 'Type' field to 'Prospect'.
 
 
Found this in salesforce docs.
To set predefined field values:
1. Click the name of an action in the Buttons, Links, and Actions list or the Global Actions list.
2. On the action detail page, click New in the Predefined Field Values list.
3. Select the field you want to predefine a value for.
4. Specify the value for the field.
5. Click Save.

Not able to found the second step. Can anyone please help me
I am not able to understand the below challenge

The Marketing Coordinator and Account Manager both require access to view and update Account Records, but only the Account Manager should be able to see and edit certain fields. Specifically, only the Account Manager should be able to see and edit the Rating field. The Marketing Coordinator should not be able to see or edit the Rating field. Create one profile and one permission set with the appropriate field-level security to solve for this use case.The profile must be named 'Basic Account User' and result in an API name of 'Basic_Account_User'. It should use the 'Salesforce' user license type.
The permission set must be named ‘Account Rating’ and result in an API name of 'Account_Rating'.
 
Hi All,

I have a requirment where I need to create a VF page which will display all field name present in the object when We select the object in our VF page.
Can any one give me an idea on this as I am new to SFDC development.
Thanks
I have one requirement where I need to create one vf page where I will enter some input and then it will search it in google and show me that result in vf page. I don't know from where I need to start. If anyone share some dummy code it will be great help.
Thank you
I am not able to save my test class:

Below is my test Class:
@isTest
private class AnimalLocatorTest{
    @isTest static void AnimalLocatorMock1() {
        Test.setMock(HttpCalloutMock.class, new AnimalLocatorMock());
        string result = AnimalLocator.getAnimalNameById(0);
        String expectedResult = 'dog';
        System.assertEquals(result,expectedResult );
    }
}
My Mock Class:
@isTest
global class AnimalLocatorMock implements HttpCalloutMock {
    // Implement this interface method
    global HTTPResponse respond(HTTPRequest request) {
        // Create a fake response
        HttpResponse response = new HttpResponse();
        response.setHeader('Content-Type', 'application/json');
        response.setBody('{"name": ["dog"]}');
        response.setStatusCode(200);
        return response; 
    }
}

My Rest Class:
public class AnimalLocator{
    
    public string getAnimalNameById(Integer id){
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/:'+id);
        request.setMethod('GET');
        HttpResponse response = http.send(request);
        String ret;
        
        if(response.getStatusCode() == 200){
            Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
            List<Object> name = (List<Object>) results.get('name');
            for (Object animal: name) {
                ret = (String)animal;
            }
            
        }
        return ret;
    }


 
User-added image

I have created two LWC component and in my prop.html I want to add lWC component.

<template>
    <ligthning-input label="percentage" type="number" min="0"
    max="100" value={percentage} onchange={changepercent}></ligthning-input>   
    <c-lwc percentage={percentage}></c-lwc>
</template>

When I try to push this to my scratch org I am getting the following error

User-added image

I am new to LWC
Hello,
I need help with a deleing Contacts from an Account and updating the Account.  If I have multiple Contacts on an Account and one of the Contacts is checked as the primary then the checkbox on the Account should be checked.  If a contact is deleted I need to detemine if it was the Primary.  So if a non primary Contact is deleted then the checkbox on the Account remains checked.  But if the Contact that is flagged as the primary is deleted then i need checkbox on teh Account to be unchecked. 

Thanks

Happy Friday All!

Our AEs don't always remeber to add CampaignMembers when they create Tasks related to the Campaign. To save the AEs and kepp marketing happy it was decided that we could use an Apex Trigger to check if the Contact was already a CampaignMember and add if they were not.

I think my code is close, but it is not adding the CampaignMember. Can someone please take a look at my code to show me what I missing?


Kind regards,


Robert.

 

trigger Task_to_CampaignMember on Task (after insert, before update) {

//WhoId is ContactId;
//WhatId is CampaignId;

  List<ID> WhoIds = new List<ID>();
  List<String> prStr = new List<String>();
  List<CampaignMember> newList = new List<CampaignMember>();

for(Task Tsk: Trigger.new){
    String WhtId = Tsk.WhatId;
    String CmpPfx = WhtId.substring(0,3);	 

    if(CmpPfx == '701') //'701' Prefix is Campaign
	{
		prStr.add(Tsk.WhatId); 
	}
}

  
Map<String,Id> cmMap = new Map<String,ID>();

for(CampaignMember cm1 :[select id,CampaignId,ContactId from CampaignMember where CampaignId IN: prStr])
{
	cmMap.put(cm1.CampaignId,cm1.Id);

}

for(Task Tsk: Trigger.new){
    if(Tsk.WhatId!=Null)

	{
		CampaignMember cm = new CampaignMember(CampaignId=Tsk.WhatId,ContactId=Tsk.Whoid,Status='Responded');
		newList.add(cm);
	}
}

if(newList.size()==0)
{
	insert newList;
}


}
Hi All,
I am running this below code:

Date d=Date.today();
system.debug('todyas date:'+d);
Datetime dt = (DateTime)d;
String dayOfWeek = dt.format('EEEE');
system.debug('day Of Week :'+dayOfWeek);


And got the debug log:
22:01:52:002 USER_DEBUG [2]|DEBUG|todyas date:2019-08-23 00:00:00
22:01:52:002 USER_DEBUG [5]|DEBUG|day Of Week :Thursday

Error Log
but 23rd August 2019 is Friday. 
Can any one tell me what is the issue?
I'm trying to change the default live agent icon with the custom image in my salesforce site. But its not getting updated. Here is the current Icon:
User-added image

I'm not able to find the correct place where I need to change the icon. I tried to update embedded_svc.settings.defaultMinimizedTex but it update the highlighted part in image. It's even not taking the image of chat button. Not sure from where to replace the icon.
 
<img id="liveagent_button_online_5730O000000byoz" style="display: none; border: 0px none; cursor: pointer" onclick="liveagent.startChat('5730O000000byoz')" src="https://saasdeveloper-developer-edition.ap7.force.com/liveAgent/resource/1555073074000/chat" /><div id="liveagent_button_offline_5730O000000byoz" style="display: none;"><!-- Offline Chat Content --></div><script type="text/javascript">
if (!window._laq) { window._laq = []; }
window._laq.push(function(){liveagent.showWhenOnline('5730O000000byoz', document.getElementById('liveagent_button_online_5730O000000byoz'));
liveagent.showWhenOffline('5730O000000byoz', document.getElementById('liveagent_button_offline_5730O000000byoz'));
});</script>

 
I'm getting below error when I'm trying to create new account record using SOAPUI using SOAP API.
Error 405 GET not supported

I'm not able to change GET method to POST method.
I am not able to save my test class:

Below is my test Class:
@isTest
private class AnimalLocatorTest{
    @isTest static void AnimalLocatorMock1() {
        Test.setMock(HttpCalloutMock.class, new AnimalLocatorMock());
        string result = AnimalLocator.getAnimalNameById(0);
        String expectedResult = 'dog';
        System.assertEquals(result,expectedResult );
    }
}
My Mock Class:
@isTest
global class AnimalLocatorMock implements HttpCalloutMock {
    // Implement this interface method
    global HTTPResponse respond(HTTPRequest request) {
        // Create a fake response
        HttpResponse response = new HttpResponse();
        response.setHeader('Content-Type', 'application/json');
        response.setBody('{"name": ["dog"]}');
        response.setStatusCode(200);
        return response; 
    }
}

My Rest Class:
public class AnimalLocator{
    
    public string getAnimalNameById(Integer id){
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/:'+id);
        request.setMethod('GET');
        HttpResponse response = http.send(request);
        String ret;
        
        if(response.getStatusCode() == 200){
            Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
            List<Object> name = (List<Object>) results.get('name');
            for (Object animal: name) {
                ret = (String)animal;
            }
            
        }
        return ret;
    }


 
I am not able to understand the below challenge

The Marketing Coordinator and Account Manager both require access to view and update Account Records, but only the Account Manager should be able to see and edit certain fields. Specifically, only the Account Manager should be able to see and edit the Rating field. The Marketing Coordinator should not be able to see or edit the Rating field. Create one profile and one permission set with the appropriate field-level security to solve for this use case.The profile must be named 'Basic Account User' and result in an API name of 'Basic_Account_User'. It should use the 'Salesforce' user license type.
The permission set must be named ‘Account Rating’ and result in an API name of 'Account_Rating'.
 
I have one requirement where I need to create one vf page where I will enter some input and then it will search it in google and show me that result in vf page. I don't know from where I need to start. If anyone share some dummy code it will be great help.
Thank you
Hi,
Are there UI components that handle lookup field selection, for example lookup from my custom object to an account? From experience this takes a lot of effort to implement and would seem like a very common use case. Maybe there is an open source version?

Thanks