• sreenath reddy 21
  • NEWBIE
  • 100 Points
  • Member since 2019

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 3
    Questions
  • 20
    Replies
Hi,
i need to send current case to lightning component and wrote below apex but seems i am not able to send current case record  id to lightning component,any solution
 
public static Case getCaseFromId(Id caseID) { 


    if(caseID == null) {
            return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
        }
    
     List<Case> cases = [ SELECT Id, Subject, Description, Status from CASE where ID = :caseID ];
        
        if(cases.size() == 0) {
            return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
        } else {
            return cases[0];
        }        

}
cmp file
<aura:attribute name="record" type="case[]"/>

controller file
var action = component.get("c.getCaseFromId");
    action.setCallback(this, function(response){
        var state = response.getState();
        if (state === "SUCCESS") {
          
            var navEvent = $A.get("e.force:navigateToSObject");
             alert("hello there!"+ component.get("v.record",response.getReturnValue())); 
            navEvent.setParams({

               "recordId": component.get("v.record",response.getReturnValue())

            });
            navEvent.fire();

Problem is alert shows "undefined" in browser that means something is wrong,any suggestions

Fiona

public class TestTriggerss {
    
     for(Opportunity cp:[Select (Select Id from OpportunityContactRoles ), (SELECT product2.name from OpportunityLineItems) from Opportunity where id=0065g000006qGQZAA2])
     {
            System.debug(cp.ContactId);
            System.debug(cp.Pricebook2Id);
     }
}
 
By using  lwc, I am creating website, when i enter details and click on submit button it is saving results to the custom objects, when i click submit button multiple times it is saving record multiple times, how to prevent this i need only 1 time click on submit and record saved to org 
@AuraEnabled(cacheable=true)
    public static List<Benefit_Tab__mdt> getBenefitData() {
        List<Benefit_Tab__mdt> benefitTab;
        try {
                if (Benefit_Tab__mdt.sObjectType.getDescribe().isAccessible()) {
                    benefitTab = [Select Masterlabel,DeveloperName,Tab_Description__c,Category__c,
                                    Order__c,CSS_Class__c,Journey_Steps__c
                                    from Benefit_Tab__mdt
                                    where Category__c = 'International'
                                    order by Order__c];
                }
                return benefitTab;
        } catch (QueryException e) {
            throw new AuraHandledException(e.getMessage());
        }
    }

Can any one please help me to write test class for custom meta data class 
https://user-provisioning--mydev.my.salesforce.com/services/data/v49.0/query?jb =SELECT +Id+Name+End_Date__c+Is_JF_Active__c+Is_Chat_User__c+Is_CRM_Content_User__c+Is_Debug_Mode_Enabled__c+Is_Flow_User__c+Is_Knowledge_User__c+Is_Marketing_User__c+Is_Offline_User__c+Is_Sales_Anywhere_User__c+Is_Service_Cloud_User__c+Job_Function_Type__c+Profile__c+Profile_Id__c+Profile_UserType__c+Role__c+Role_Id__c+Salesforce_Licence_for_profile__c+Secondary_JobFunction__c+Secondary_Job_Function__c+Start_Date__c +FROM +Job_Function__c

I am getting   "message": "A query string has to be specified",
        "errorCode": "MALFORMED_QUERY"  this error, please help me to solve the above problem
Hi,
i need to send current case to lightning component and wrote below apex but seems i am not able to send current case record  id to lightning component,any solution
 
public static Case getCaseFromId(Id caseID) { 


    if(caseID == null) {
            return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
        }
    
     List<Case> cases = [ SELECT Id, Subject, Description, Status from CASE where ID = :caseID ];
        
        if(cases.size() == 0) {
            return [SELECT ID, Subject, Description, STATUS from Case LIMIT 1];
        } else {
            return cases[0];
        }        

}
cmp file
<aura:attribute name="record" type="case[]"/>

controller file
var action = component.get("c.getCaseFromId");
    action.setCallback(this, function(response){
        var state = response.getState();
        if (state === "SUCCESS") {
          
            var navEvent = $A.get("e.force:navigateToSObject");
             alert("hello there!"+ component.get("v.record",response.getReturnValue())); 
            navEvent.setParams({

               "recordId": component.get("v.record",response.getReturnValue())

            });
            navEvent.fire();

Problem is alert shows "undefined" in browser that means something is wrong,any suggestions

Fiona
trigger sendEmailToContactWhenfileIsCreated on ContentDocumentLink (after insert) {
   set<id> conDocId=new set<id>();
   for(contentDocumentLink cond:Trigger.new){
    if(cond.linkedEntityId!=null ){
        conDocId.add(cond.linkedEntityId);
   }
}
list<Messaging.SingleEmailMessage> emailList = new list<Messaging.SingleEmailMessage>();
    list<contact> conlist=[select id ,email from contact where id in:conDocId];
for(contentDocumentLink cond:Trigger.new){
    for(contact c:conlist){
        contentversion cv=[select title,versionData from contentversion where id=:cond.contentdocumentId ];
        Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        list<string> toaddress=new list<string>();
        toaddress.add(c.Email);
        semail.setToaddresses(toaddress);
        semail.setsubject('Email Attachment');
        semail.setPlaintextbody('This is first email attachment');
        semail.settargetobjectId(c.id);
        emailList.add(semail);
        Messaging.EmailFileAttachment efa=new Messaging.EmailFileAttachment();
        efa.setFilename(cv.Title[0]);
        efa.setbody(cv.versionData[0]);

        efa.setFileattachment(new  Messaging.EmailFileAttachment[]{efa});
    }
      }
      Messaging.sendEmail(emailList);
}
I am getting error in above bold line , how to setFilename &setbody  Help here Thank You.
Hi Developer Community,

I am currently working on a task and It requires LWC,
So my problem is , how can i write aura:handler method in LWC

for example:

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />

This above example need to be written in LWC,

Can u please help me with this problem

Thanks in Advance

 

 

Hi wonderful Community

I need help with a test class for a trigger, only at 47% !!

Here is the Trigger

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Trigger CreatingAutoRecords on Opportunity (After Insert, After Update)
{
    
    List<MRR__c> MRRRecordsFinalListToInsert = New List<MRR__c>();
    
    If(Trigger.IsInsert || Trigger.IsUpdate)
    {
        For(Opportunity opp : Trigger.New)
        {
            If(Opportunity.Contract_Period_Months__c != null)
            {
                List<MRR__c> fetchingAlreadyExixtsedRecords = [Select Id FROM MRR__c WHERE Opportunity__c =:opp.Id];
                
                If(fetchingAlreadyExixtsedRecords.IsEmpty())
                {
                    // We are only creating a records when there is no MRR__c records exixts.
                    For(Integer I = 1; I <= opp.Contract_Period_Months__c;I++)
                    
                        {
                        MRR__c crd = New MRR__c();
                        
                        crd.Opportunity__c = opp.Id;
                        crd.Name       = 'Month' + I;
                        crd.MRR_Amount__c = opp.MRR_Amount__c;
                        crd.MRR_Date__c = opp.Contract_Start_Date__c.addMonths(I);
                        
                        MRRRecordsFinalListToInsert.add(crd);
                    }
                }
                
            }
            
            try{
                If(!MRRRecordsFinalListToInsert.IsEmpty()){
                    insert MRRRecordsFinalListToInsert;
                }
            }
            Catch(Exception e){
                System.debug('The thrown exception for CreatingAutoRecords is:: ' + e.getMessage());
            }
        }
    }
    
    
}

And this is the Test Class

@isTest
private with sharing class CreatingAutoRecordsTest {

static testMethod void MyTestCreatingAutoRecords()
{
test.starttest(); 

    
    List<MRR__c> MRRRecordsFinalListToInsert = New List<MRR__c>();
    
    
    
    
      
   MRR__c crd = New MRR__c();
    crd.Opportunity__c =  '0062C00000AVFEwQAP';
    crd.Name = 'Testing';
    
    crd.MRR_Amount__c = 110;   
    
      MRRRecordsFinalListToInsert.add(crd);
                        
                        
     insert MRRRecordsFinalListToInsert;
    
    
    
    
    
     Database.SaveResult str = database.insert(crd , False);

        System.assertEquals(True, str.isSuccess());
     
   test.stoptest();  
    

}
}


Any help would he highly appreciated to get it to pass at least

 
I am trying to show stage picklist values of opportunity object through lwc but iit shows error unlnown exception when i deploy code to org

here is my code
<template>
    <div class="side-box">
        <template if:true={StageValues.data}>
           
            <lightning-combobox value={value} label="Opportunity Stage" onchange={handleChange} options={stageValues.data.values}
                name="progress"> </lightning-combobox>
            </template>
    </div>
    
</template>

import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity';
import { getPicklistValues } from 'lightning/uiObjectInfoapi';
import Stage from '@salesforce/schema/Opportunity.StageName';
import { getObjectInfo } from 'lightning/uiObjectInfoapi';
import { wire } from 'lwc';
export default class LwcPicklistOppor extends LightningElement {
    @wire(getObjectInfo, { objectApiName : Opportunity_OBJECT})
    opportunityinfo;
    @wire(getPicklistValues,
        {
            recordTypeId: '$opportunityinfo.data.defaultRecordTypeId',
            fieldApiName: Stage
        }
    )
    StageValues;
}
 
If a user doesn’t have Profile CRUD permissions, but given OWD public read/write. Does user will have the permissions on record? If not why.
How can I also cover the catch block?

TriggerHandlerClass with highlighted code(catch block) that is not covered by Test Class:
public class PaymentOrderTriggerHandler {  
    public static void updatePaymentContactInformation(List<Payment_Order__c> paymentOrderList){
        for(Payment_Order__c paymentOrder : paymentOrderList){
            if(paymentOrder.Account__c != Null){
                //Getting particular account id
                ID accountId = paymentOrder.Account__c;
                
                //Updating value to Payment Order from Account with above account id as reference
                try{
                    paymentOrder.Payee_Name__c = [SELECT Name FROM Account WHERE Id = :accountId].Name;
                    paymentOrder.Phone_No__c = [SELECT Phone FROM Account WHERE Id = :accountId].Phone;
                    paymentOrder.Address_Street_1__c = [SELECT BillingStreet FROM Account WHERE Id = :accountId].BillingStreet;
                    paymentOrder.Address_Street_2__c = [SELECT ShippingStreet FROM Account WHERE Id = :accountId].ShippingStreet;
                    paymentOrder.Zip__c = [SELECT ShippingPostalCode FROM Account WHERE Id = :accountId].ShippingPostalCode;
                    paymentOrder.State__c = [SELECT ShippingState FROM Account WHERE Id = :accountId].ShippingState;
                    paymentOrder.Country__c = [SELECT ShippingCountry FROM Account WHERE Id = :accountId].ShippingCountry;
                } catch(Exception error){
                    error.getMessage();
                }
                
            }
        }
    }
    
    public static void insertAccountContactInformation(List<Payment_Order__c> paymentOrderList){
        List<Account> accountList = new List<Account>();
        for(Payment_Order__c paymentOrder : paymentOrderList){
            if(paymentOrder.Account__c == null){
                //Creating new record in Account with field values from Payment Order
                Account newAccount = new Account(Name = paymentOrder.Payee_Name__c, Phone = paymentOrder.Phone_No__c,
                                                 BillingStreet = paymentOrder.Address_Street_1__c,
                                                 ShippingStreet = paymentOrder.Address_Street_2__c,
                                                 ShippingPostalCode = paymentOrder.Zip__c,
                                                 ShippingState = paymentOrder.State__c,
                                                 ShippingCountry = paymentOrder.Country__c);
                accountList.add(newAccount);
            }
        }
        //Inserting created account record
        try{
            insert accountList;
        }catch(Exception error){
            error.getMessage();
        }
        
        //Tagging created account with corresponding Payment Order
        for(Account account : accountList){
            for(Payment_Order__c paymentOrder : paymentOrderList){
                if(paymentOrder.Payee_Name__c == account.Name && paymentOrder.Phone_No__c == account.Phone &&
                                         paymentOrder.Address_Street_1__c == account.BillingStreet &&
                                         paymentOrder.Address_Street_2__c == account.ShippingStreet &&
                                         paymentOrder.Zip__c == account.ShippingPostalCode &&
                                         paymentOrder.State__c == account.ShippingState &&
                                         paymentOrder.Country__c == account.ShippingCountry)
                {
                    paymentOrder.Account__c = account.Id;
                }  
            }
        }
    }
    
    public static void searchAndCreateAccount(List<Payment_Order__c> paymentOrderList){
        boolean found = false;
        List<Account> accountList = new List<Account>();
        for(Payment_Order__c paymentOrder : paymentOrderList){
            for(Account account : [SELECT Name, Phone, BillingStreet, ShippingStreet,
                                   ShippingPostalCode, ShippingState, ShippingCountry FROM Account]){
                                       
                                       if(paymentOrder.Payee_Name__c == account.Name && paymentOrder.Phone_No__c == account.Phone &&
                                          paymentOrder.Address_Street_1__c == account.BillingStreet &&
                                          paymentOrder.Address_Street_2__c == account.ShippingStreet &&
                                          paymentOrder.Zip__c == account.ShippingPostalCode &&
                                          paymentOrder.State__c == account.ShippingState &&
                                          paymentOrder.Country__c == account.ShippingCountry)
                                       {
                                              found = true;
                                              paymentOrder.Account__c = account.id;
                                       }
            }
            if(!found){
                //Need to reuse - code available above
                Account newAccount = new Account(Name = paymentOrder.Payee_Name__c, Phone = paymentOrder.Phone_No__c,
                                             BillingStreet = paymentOrder.Address_Street_1__c,
                                             ShippingStreet = paymentOrder.Address_Street_2__c,
                                             ShippingPostalCode = paymentOrder.Zip__c,
                                             ShippingState = paymentOrder.State__c,
                                             ShippingCountry = paymentOrder.Country__c);
                accountList.add(newAccount);
            }
        }
        //Inserting created account record
        try{
            insert accountList;
        }catch(Exception error){
            error.getMessage();
        }
        
        //Tagging created account with corresponding Payment Order
        for(Account account : accountList){
            for(Payment_Order__c paymentOrder : paymentOrderList){
                if(paymentOrder.Payee_Name__c == account.Name && paymentOrder.Phone_No__c == account.Phone &&
                                         paymentOrder.Address_Street_1__c == account.BillingStreet &&
                                         paymentOrder.Address_Street_2__c == account.ShippingStreet &&
                                         paymentOrder.Zip__c == account.ShippingPostalCode &&
                                         paymentOrder.State__c == account.ShippingState &&
                                         paymentOrder.Country__c == account.ShippingCountry)
                {
                    paymentOrder.Account__c = account.Id;
                }  
            }
        }
    }
    
    public static void updateStatusAndOwner(List<Payment_Order__c> paymentOrderList){
        for(Payment_Order__c paymentOrder : paymentOrderList){
            if(paymentOrder.Payment_Amount__c > 2000){
                paymentOrder.Status__c = 'Pending Approval';
                ID queueId = [SELECT Queue.Id FROM queuesobject WHERE queue.name='Payment Order Pending Approval'].Queue.Id;
                paymentOrder.OwnerId = queueId;
            }
        }
    }
}

Test Class:
@isTest
public class PaymentOrderTriggerHandlerTest {
    @isTest public static void testUpdatePaymentContactInformationCheck(){
        //Creating account
        Account account = new Account(Name = 'Test Account', Phone = '1234567890', BillingStreet = 'Test Billing Street',
                                      ShippingStreet = 'Test Shipping Street', ShippingPostalCode = '625014', ShippingState = 'Test State',
                                      ShippingCountry = 'Test country');
        insert account;
        
        //Creating Payment Order with above account as lookup
        Payment_Order__c paymentOrder = new Payment_Order__c(Account__c = account.Id);
        insert paymentOrder;
        
        Test.startTest();
        //Getting all test data
        String paymentOrderName = [SELECT Payee_Name__c FROM Payment_Order__c WHERE Account__c = :account.Id].Payee_Name__c;
        String paymentOrderPhone = [SELECT Phone_No__c FROM Payment_Order__c WHERE Account__c = :account.Id].Phone_No__c;
        String paymentOrderStreet1 = [SELECT Address_Street_1__c FROM Payment_Order__c WHERE Account__c = :account.Id].Address_Street_1__c;
        String paymentOrderStreet2 = [SELECT Address_Street_2__c FROM Payment_Order__c WHERE Account__c = :account.Id].Address_Street_2__c;
        String paymentOrderZip = [SELECT Zip__c FROM Payment_Order__c WHERE Account__c = :account.Id].Zip__c;
        String paymentOrderState = [SELECT State__c FROM Payment_Order__c WHERE Account__c = :account.Id].State__c;
        String paymentOrderCountry = [SELECT Country__c FROM Payment_Order__c WHERE Account__c = :account.Id].Country__c;
        
        System.assertEquals(account.Name, paymentOrderName);
        System.assertEquals(account.Phone, paymentOrderPhone);
        System.assertEquals(account.BillingStreet, paymentOrderStreet1);
        System.assertEquals(account.ShippingStreet, paymentOrderStreet2);
        System.assertEquals(account.ShippingPostalCode, paymentOrderZip);
        System.assertEquals(account.ShippingState, paymentOrderState);
        System.assertEquals(account.ShippingCountry, paymentOrderCountry);
        Test.stopTest();
    }
    
    @isTest public static void testInsertAccountContactInformationCheck(){
        //Creating Payment Order without lookup account
        Payment_Order__c paymentOrder = new Payment_Order__c(Payee_Name__c = 'Test Payment Order', Phone_No__c = '9876543210', 
                                                             Address_Street_1__c = 'Test Street 1', Address_Street_2__c = 'Test Street 2',
                                                             Zip__c = '625014', State__c = 'Test State', Country__c = 'Test Country');
        insert paymentOrder;
        
        //Getting Id, all data of account created by trigger
        ID accountID = [SELECT Account__c FROM Payment_Order__c WHERE Id = :paymentOrder.Id].Account__c;
        String accountName = [SELECT Name FROM Account WHERE Id = :accountId].Name;
        String accountPhone = [SELECT Phone FROM Account WHERE Id = :accountId].Phone;
        String accountBillingStreet = [SELECT BillingStreet FROM Account WHERE Id = :accountId].BillingStreet;
        String accountShippingStreet = [SELECT ShippingStreet FROM Account WHERE Id = :accountId].ShippingStreet;
        String accountZip = [SELECT ShippingPostalCode FROM Account WHERE Id = :accountId].ShippingPostalCode;
        String accountState = [SELECT ShippingState FROM Account WHERE Id = :accountId].ShippingState;
        String accountCountry = [SELECT ShippingCountry FROM Account WHERE Id = :accountId].ShippingCountry;
        
        Test.startTest();
        System.assertEquals(paymentOrder.Payee_Name__c, accountName);
        System.assertEquals(paymentOrder.Phone_No__c, accountPhone);
        System.assertEquals(paymentOrder.Address_Street_1__c, accountBillingStreet);
        System.assertEquals(paymentOrder.Address_Street_2__c, accountShippingStreet);
        System.assertEquals(paymentOrder.Zip__c, accountZip);
        System.assertEquals(paymentOrder.State__c, accountState);
        System.assertEquals(paymentOrder.Country__c, accountCountry);
        Test.stopTest();
    }
    
    @isTest public static void testSearchAndCreateAccountCheck(){
        //Creating Account
        Account account = new Account(Name = 'Test Account', Phone = '1234567890', BillingStreet = 'Test Billing Street',
                                      ShippingStreet = 'Test Shipping Street', ShippingPostalCode = '625014', ShippingState = 'Test State',
                                      ShippingCountry = 'Test country');
        insert account;
        
        //creating Payment Order
        Payment_Order__c paymentOrder = new Payment_Order__c(Payee_Name__c = 'Test Payment Order', Phone_No__c = '9876543210', 
                                                             Address_Street_1__c = 'Test Street 1', Address_Street_2__c = 'Test Street 2',
                                                             Zip__c = '625014', State__c = 'Test State', Country__c = 'Test Country');
        insert paymentOrder;
        
        //updating payment order to match above account data
        paymentOrder.Payee_Name__c = 'Test Account';
        paymentOrder.Phone_No__c = '1234567890';
        paymentOrder.Address_Street_1__c = 'Test Billing Street';
        paymentOrder.Address_Street_2__c = 'Test Shipping Street';
        paymentOrder.Zip__c = '625014';
        paymentOrder.State__c = 'Test State';
        paymentOrder.Country__c = 'Test Country';
        update paymentOrder;
        
        //getting id of account associated with payment order
        ID paymentOrderAccountId = [SELECT Account__c FROM Payment_Order__c WHERE Id = :paymentOrder.Id].Account__c;
                
        Test.startTest();
        System.assertEquals(account.Id, paymentOrderAccountId);
        
        //updating payment order to not match above account data
        paymentOrder.Phone_No__c = '7777777777';
        update paymentOrder;
        
        //getting updated account lookup id
        paymentOrderAccountId = [SELECT Account__c FROM Payment_Order__c WHERE Id = :paymentOrder.Id].Account__c;
        
        System.assertNotEquals(account.Id, paymentOrderAccountId);
        Test.stopTest();
    }
    
    @isTest public static void testUpdateStatusAndOwnerCheck(){
        //Creating Payment Order with payment amount greater than 2000
        Payment_Order__c paymentOrder = new Payment_Order__c(Payment_Amount__c = 2001);
        insert paymentOrder;
        
        //Getting status of payment order
        String status = [SELECT Status__c FROM Payment_Order__c WHERE Id = :paymentOrder.Id].Status__c;
        
        //getting Queue Id
        ID queueId = [SELECT Queue.Id FROM queuesobject WHERE queue.name='Payment Order Pending Approval'].Queue.Id;
        ID paymentOrderOwnerId = [Select OwnerId FROM Payment_Order__c WHERE Id = :paymentOrder.Id].OwnerId;
        
        Test.startTest();
        System.assertEquals('Pending Approval', status);
        System.assertEquals(queueId, paymentOrderOwnerId);
        Test.stopTest();
    }
}

 
Hi All,

I am getting the following error when I try to delete the object. It was the Master object for a Master Detail relationship. I had converted it to a lookup and have deleted all the references from classes, triggers, and also erased the deleted lookup fields. Please share some input on how this can be resolved. Note: Profile of logged in user is Sys Admin as well.

"Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.
"
 

Hi all-

Beginning developer that has been running my head into the wall with this trigger for a while now.  I feel like I am missing something obvious but I don't know where it is.

I have reciently implemented Campaign Influence for my organization.  (for those of you who have not used Campaign Influence - it is related to the Opportunity and Contact Roles.  When a contact role is related to an opportunity, the Campaign influence will pull in the Campaigns related to the contact so they are automatically associated to the campaign.)

I have a requirement that all Campaigns related to a contact must be split equally.  I've tried various ways to pull the Query of related campaign influences, but have found that when I attempt to do a bulk upload, the trigger will combine campaigns two different opps, then divide by the total.

(ie. Opp 1 has 3 related campaign influence and opp 2 has 3 related campaign influence.  Instead of attributing 33% influence to each, I end up with 17%).

 

The below trigger works, but I understand that the trigger should not be in the loop and I would like to improve it.

Thank you!

trigger UpdateOppPrimaryCampaign on Opportunity (after update) {
    	
    	for(Opportunity o : trigger.new)  {
            List<String> oppListId = new List<String>();
        	system.debug('First for loop runs');
        	oppListId.add(o.Id);
			system.debug('oppListId = '+oppListId);
            List<CampaignInfluence> relatedCampaignInfuence = [SELECT Id, CampaignId, Influence, OpportunityId FROM CampaignInfluence WHERE OpportunityId IN :oppListId]; 
        	List<CampaignInfluence> campaignInfluenceListUpdate = new List<CampaignInfluence>();
        	    system.debug('relatedCampaignInfuence = '+relatedCampaignInfuence);
        	
            for(campaignInfluence c : relatedCampaignInfuence){        
            	Decimal numCampaign = relatedCampaignInfuence.size();
            		system.debug ('numCampaign = ' + numCampaign);
           		Decimal percentCampaign =  100 / numCampaign;
            		system.debug ('percentCampaign = '+ percentCampaign);
                 c.Influence = percentCampaign;
            	system.debug('c.Influence = '+ c.Influence);
           	     c.Influenced__c = percentCampaign;
            	campaignInfluenceListUpdate.add(c);
            	system.debug('campaignInfluenceListUpdate = ' + campaignInfluenceListUpdate);
                }
        system.debug('update campaignInfluenceListUpdate EXECUTES');
        Database.SaveResult[] results = Database.update(campaignInfluenceListUpdate, false);
            }

}
 

 

 

 

i merge below  fields,but not receive in email
Hii,{!Contact.Name}
Your Order has been proceed
Your order detail is below.
Product Name:{!Product2.Name}
Product Code:{!Product2.code}
Unit Price:{!OpportunityLineItem.UnitPrice}
List Price:{!OpportunityLineItem.ListPrice}
Discount:{!OpportunityLineItem.Discount}
Thanks
{!Contact.Name}


User-added image
I have added the user as Opportunity Team member. Does the user above the role hietarchy of that team member get the access to that Opportunity ? Please help.
Hi everyone,
I need to change background color of the row onclick on it in lightning datatable or HTML table. I am trying it in Lightning web component but I can't find any solution. 

public class TestTriggerss {
    
     for(Opportunity cp:[Select (Select Id from OpportunityContactRoles ), (SELECT product2.name from OpportunityLineItems) from Opportunity where id=0065g000006qGQZAA2])
     {
            System.debug(cp.ContactId);
            System.debug(cp.Pricebook2Id);
     }
}
 
Hi,
From process builder getting record id and pass that in to apex.

User-added image
Apex class to update the record:

public class BacktoQuantum
{
     @InvocableMethod(label='getdata' description='Get data from saltedge')
  public static void toquantum(List<String> ids)
    {
       BacktoQuantum.fromdata(ids);
       //System.debug('callback');
      
  }
   @future(callout=true)
    public static void fromdata(List<String> ids)
   {
         Http http = new Http();
            HttpRequest request = new HttpRequest();
            request.setEndpoint('http://ussd.apmuyea.software.com/CustomerAdd_SaltEdge_CallBack.aspx');
            request.setMethod('GET');
            //request.setHeader('Accept','application/json');
            request.setHeader('Content-Type', 'text/html; charset=utf-8');
            request.setBody('{"data": {Saltedge Data }}');
       
            HttpResponse responseg = http.send(request);  
            System.debug(responseg.getBody());
        String ac = responseg.getBody(); //Return JSON data
      List<Loan_Application__c> app =  [Select Amount__c,Rate__c,Term_Months__c from Loan_Application__c where Id=:ids];
       if(!app.isEmpty())
       {
                // app[0];
// To update the JSON data in the first record in the list
       }
        //Loan_Application__c app =  new Loan_Application__c();
       //app.SaltedgeData__c = ac;
       //System.debug('sample json' +app);
         } 
}

The above apex code return a JSON data, I need to store that JSON data in salesforce field called Saltedge__c.
I'm stuck in the update.

can anyone help to me update the record?

Thanks.
Hi Community,

Can someone help me resolve this issue?

My formula field throws error Error: Syntax error. Extra ',' for the following
IF(ISBLANK(ffpsai__BillingEvent__r.Company_ABN__c),'2414235y',ffpsai__BillingEvent__r.Company_ABN__c),IF(NOT(ISBLANK(ABN_Override__c)),ABN_Override__c,'123324')
Tried few parathsis things.  ABN override is a text field
By using  lwc, I am creating website, when i enter details and click on submit button it is saving results to the custom objects, when i click submit button multiple times it is saving record multiple times, how to prevent this i need only 1 time click on submit and record saved to org 
https://user-provisioning--mydev.my.salesforce.com/services/data/v49.0/query?jb =SELECT +Id+Name+End_Date__c+Is_JF_Active__c+Is_Chat_User__c+Is_CRM_Content_User__c+Is_Debug_Mode_Enabled__c+Is_Flow_User__c+Is_Knowledge_User__c+Is_Marketing_User__c+Is_Offline_User__c+Is_Sales_Anywhere_User__c+Is_Service_Cloud_User__c+Job_Function_Type__c+Profile__c+Profile_Id__c+Profile_UserType__c+Role__c+Role_Id__c+Salesforce_Licence_for_profile__c+Secondary_JobFunction__c+Secondary_Job_Function__c+Start_Date__c +FROM +Job_Function__c

I am getting   "message": "A query string has to be specified",
        "errorCode": "MALFORMED_QUERY"  this error, please help me to solve the above problem
We changed the list price of a product, and we don't want to enable sales people to still use the old price.
We dont allow changing the sales price (Profile permission) but this protects only creation of new opportunities.
If a user clones a previous record, the old prices remain.
How can I fix this?