• 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
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