• Sai Shanmukh 15
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 12
    Questions
  • 8
    Replies
I have a requirement to display warning message on Account Object : Active customer (csutom field) which is checkbox when sales manager profile tries to check or uncheck that field it should throw warning message Are you sure? 
Can someone help me with this one please.
Hello,

I'm facing error while saving Lead Test records "No data purpose record exists?"

Can anyone help me why i'm facing this issue
How to display stagename and other fields on maps using lwc.
Currently, i am displaying only opportunity name and marker on map using location (Address fields salesforce). But how to display stagename and other fields on maps). (or) any account fields.
Please advise.Image of opportunities displayed on maps with only address
when an opportunity is won or lost all related quotes are updated won=accepted lost =denied using flow.
(Create quote, generate pdf, save pdf to opportunity , delete quote)
 
How to assign lead based on territories using flow
Hello,

I'm facing error while saving Lead Test records "No data purpose record exists?"

Can anyone help me why i'm facing this issue
(Create quote, generate pdf, save pdf to opportunity , delete quote)
 
I have a use case where I need to Update Quote Record, Stage = Complete, Status = Accepted when Opportunity Stage is "Closed Won" . and Update Quote Record, Stage = Complete, Status = Rejected when Opportunity Stage is "Closed Lost".

Please help mein this.
Thanks in Advnace !!
Hi, is it possible to create a button on the Opportunity object that generates a downloadable pdf using a pre-existing quote template?
 
I've successfully plotted the accounts on Google Map with Lightning Component and it works in Sandbox...but don't know how to write a test code for the ApexClass.

I describe the codes below and hope anyone can help with the test code part. Thank you!

Component (MapNearbyAccount.cmp)
<aura:component controller="MapNearbyAccountController" implements="flexipage:availableForAllPageTypes,force:hasRecordId">
    <aura:attribute name="mapMarkers" type="Object"/>
    <aura:attribute name="selectedMarkerValue" type="String" />
    
    <aura:handler name="init" value="{! this }" action="{! c.init }"/>
    
    <div class="slds-box slds-theme--default">
        <lightning:map 
                       mapMarkers="{! v.mapMarkers }"
                       selectedMarkerValue="{!v.selectedMarkerValue}"
                       markersTitle="accounts nearby"
                       listView="auto"
                       showFooter="false"
                       onmarkerselect="{!c.handlerMarkerSelect}" />
    </div>
</aura:component>
Controller (MapNearbyAccount.js)
({
    init: function (cmp, event, helper) {
        var recordId = cmp.get("v.recordId");     
        var action = cmp.get("c.getAccounts");
        action.setParams({recordId :recordId});
        cmp.set('v.mapMarkers', [{location: {}}]);

        action.setCallback(this, function(response){
            
            var accounts = response.getReturnValue();
            var markers = [];
            for(var i = 0; i < accounts.length; i++){
                var acc = accounts[i];
                markers.push({
                    location: {
                        Country : acc.BillingCountry,
                        State : acc.BillingState,
                        City: acc.BillingCity,
                        Street: acc.BillingStreet
                    },
    
                    icon : "standard:account",
                    value: acc.Id,
                    title: acc.Name,
                    description:acc.Description
                });
            }
            
            if(markers.length != 0){
                cmp.set('v.mapMarkers', markers);
            }
        });

        $A.enqueueAction(action);
    },

    handlerMarkerSelect: function (cmp, event, helper) {
        console.log(event.getParam("selectedMarkerValue"));
    }
});
ApexClass (MapNearbyAccountController)
public class MapNearbyAccountController {
    @AuraEnabled
    public static List<Account> getAccounts(String BillingCity, String BillingState, String recordId){
        Account acct = [SELECT Id, Name, BillingCountry, BillingState, BillingCity, BillingStreet, Industry FROM Account WHERE Id =:recordId];
        
        return [SELECT Id, Name, BillingCountry, BillingState, BillingCity, BillingStreet,Description
                FROM Account 
                WHERE BillingState = :acct.BillingState AND BillingCity LIKE :('%' + acct.BillingCity + '%') AND Industry = :acct.Industry LIMIT 10];
    }
}
TestClass
@isTest
public class MapNearbyAccountControllerTest {
@isTest
    static void testMapNearbyAccountController() {
        Account acc1 = new Account();
        acc1.Name='acc1';
        acc1.BillingCity='Shibuya';
        acc1.BillingState='Tokyo';
        insert acc1;
        
        MapNearbyAccountController ctrl = new MapNearbyAccountController();
        
        Test.startTest();
            List<Account> getAccounts = ctrl.getAccounts();
            System.assertEquals(false,getAccounts.isEmpty());
        Test.stopTest();
    }
    
}
Hello Dev Community,

I have a requirement to display a warning message when a user tries to change a field value. We don't want to prevent them from saving it, but when the page is in edit mode, and the user tries to change the value of the field (Cost Center), the a warning message pops up to warn the user. Any guidance is pretty much appreictated as I am not a developer.  

Thanks. 
  • October 01, 2020
  • Like
  • 1