• mukesh gupta
  • PRO
  • 2278 Points
  • Member since 2015
  • 7X Salesforce Certified

  • Chatter
    Feed
  • 64
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 119
    Questions
  • 651
    Replies
Hi, 
Could you please let me know if there is any simple way to bypass triggering emails on record update ?  Also what all do we need to check to see whether email is getting triggered   ( apex code, triggers, workflow rules etc .. )  ?? 

If there is no simple way to bypass triggering email on record update, would like to know what all need to be checked and how to bypass triggering email from WF rules etc ?

Wanted to bypass all emails when standard object Contact or User record is updated 
I have this method:
@AuraEnabled    
    public static String updateRecordReturned(Id recordId){
        if (bankaccRcd == null){
            bankaccRcd = [SELECT Id, Status__c, Observations__c FROM Bank_Account_Request__c WHere Id =: recordId];    
        }
        try {
            String stt = bankaccRcd.Status__c; // that's the value I'd like to get to the following method.
            bankaccRcd.Status__c = 'Devolvido';
            update bankaccRcd;    
            FeedItem post = new FeedItem();
            post.Body = 'Devolution: '+bankaccRcd.Observations__c;
            post.ParentId = bankaccRcd.Id;
            insert post;
            return 'Success';
        }catch (DmlException e){
            Return 'Error: '+e.getMessage();
        }
        
    }


I'd like to get the bold value above to another method:

@AuraEnabled    
    public static String updateRecordAfterReturned(Id recordId){
        if (bankaccRcd == null){
            bankaccRcd = [SELECT Id, Status__c, Observations__c FROM Bank_Account_Request__c WHere Id =: recordId];    
        }
        try {
            bankaccRcd.Status__c = stt; // here is where I'd like to get the value above.
            update bankaccRcd;    
            return 'Success';
        }catch (DmlException e){
            Return 'Error: '+e.getMessage();
        }
        
    }

Is it possible?
 
Hi , I need to add a field on mini page layout, but it's not on available items.... is there any other solution ? Please help. 

Hi everyone!

I am trying to run this LWC in my TP: https://www.forcetrails.com/2020/04/bar-chart-in-lightning-web-component-lwc-bar-chartjs.html

But I get this error: Error loading ChartJS

What can we do?

I have created an Apex batch to delete the files it working fine. Now I want to save the log files in one object. I am trying with the below code but it's not working.

global class IBNext_DownloadCleanupBatchJob implements Database.Batchable<sObject>{
    global List<sObject> start(Database.BatchableContext c)
    {   
    
        List<IDownload_Tracker__c> dbcList=[select  Request_Date__c,Content_Document__c,Content_Version__c,Download_Filename__c,Download_URL__c,Download_User__c,Subject__c,Recipient_Email_1__c from Download_Tracker__c where CreatedDate < TODAY];
       
        List<Id> cvID=new List<Id>();
        List<Id> cdid=new List<Id>(); 
        List<sObject> allobjects=new List<sObject> ();
      
        for(Download_Tracker__c edrtObject:dbcList){
               cvID.add(edrtObject.Content_Version__c);
               cdid.add(edrtObject.Content_Document__c);
        }
        allobjects.addAll([select Id from ContentDistribution where ContentVersionId IN: cvID]);
        allobjects.addAll([select Id from ContentDocument where Id IN: cdid]);
        allobjects.addAll((List<sObject> )(dbcList));
        system.debug('*********AllObjects**********'+allobjects);
        return allobjects;
    }
    //global void execute(Database.BatchableContext c, List<Download_Tracker__c> scope)
    global void execute(Database.BatchableContext c, List<sObject> scope)
    {
        try
        { 
        delete scope;
        }
        catch(Exception ex) 
        { Error_Log__c log = new Error_Log__c( Error_Message__c = 'Job Status: ' + ex.getMessage(),
                                              Apex_Class_Name__c = DownloadCleanupBatchJob');
          //insert log; 
          database.insert(log);
        }
    }         
    // Finish Method
    global void finish(Database.BatchableContext BC) {
    }
    }

Could you please help me for the same
How to store records with limitation? Like if a user wants to store multiple data  to a certain object but the object accepts 1 record only, how to do that? Thanks!
I have checked the alphabetically order and getting the below error.

Conflict Encountered During Save
You attempted to save changes that conflicted with the changes of another user. Please try again.

Click here to return to the previous page.Conflict Encountered During Save
You attempted to save changes that conflicted with the changes of another user. Please try again.

Click here to return to the previous page.

 
Created a new Custom object ,now i want to create this Custom Object as Tab in the App ,but when i create a "Lightning App",can't see the Custom object in Navigation Items,I checked in profiles as well ,i had full access to the custom object as i am salesforce admin

User-added image
Your help is highly appreciated

Fiona
SENARIO:

Employee is parent and emplayment is child both are custom and lookup r/s.

Now In child  there is a Amount field(Currency field ) is there now assume c1,c2,c3 amount field is 1000 of each,,,,the toal of amount should be reflect on parent field i.e Total(Currency field with default value 0). 

Now i want to rollup should work for all these actions     insert,update,delete,Undelete
Hi Folks,

 I have a problem where for Given an integer n, i want to return true if n has exactly three positive divisors. Otherwise, return false.

Example 1:

Input: n = 2
Output: false
Explantion: 2 has only two divisors: 1 and 2.

Example 2:

Input: n = 4
Output: true
Explantion: 4 has three divisors: 1, 2, and 4.

Tried to use List to achieve ,but no success,can any one solve the code below or it needs a Map?
public class ThreeDivisors {
    
    public static List<Integer> returnThreeDivisors(Integer input){
        
        List<Integer> inputList = new List<Integer>();
        Integer divisor = 0;
        
        for (Integer i=0; i<inputList.size(); i++) {
                    Integer var = inputList[i];
                    
                    if ( Math.mod(var,i) == 0)
                    {
                        divisor++;
                    }
                }
        
        return inputList;
    }

}

Regards,
Fiona
 
Hello,
Having an issue saving my class.  getting 
Compile Error: Invalid loop variable type expected SObject was Notice__c

I am passing the parameters from another Class and I am trying to update a field on the Notice__c object with teh vatQueVatValue value
If you see any other issues with the batch class please also advise.
public class UpdateNoticeFromAccountQueueableBatch implements Database.Batchable <sObject>, Database.Stateful{
    public List<Notice__c> noticeList = new List<Notice__c>();
    public String vatQueVatValue;
    public UpdateNoticeFromAccountQueueableBatch ( List<Notice__c> records ,String vatValueFromQue ) {
        noticeList = records;
        vatQueVatValue = vatValueFromQue;
        system.debug('noticeList value in batch' + noticeList );
        system.debug('vatQueVatValue value in batch' + vatQueVatValue );
    }
    public List<SObject> start(Database.BatchableContext bc){
        return noticeList;
    }
    public void execute(Database.BatchableContext bc, List<SObject> scope){
         List< notice>  NoticeToUpdateFromAccount = new List<Notice__c>();   
         system.debug('scope value ' + scope);
         system.debug('vatQueVatValue value batch' + vatQueVatValue);
         if(!scope.isEmpty()){
             For ( Notice__c noticess : scope){  ---- Compile Error: Invalid loop variable type expected SObject was notice Notice__c 
               noticess.Any_other_Lessor_Info_VAT_Number__c  = vatQueVatValue;
              system.debug('notices.Any_other_Lessor_Info_VAT_Number__c ' + notices.Any_other_Lessor_Info_VAT_Number__c);
             }
         }   
         Database.update(scope, false);
    }
    public void finish(Database.BatchableContext bc){
    }
}

Cheers,
P
 
hey guys plz help how to convert lead from mail .plz guide detail stepwise
Hi there! 

I'd like to test my data from my web-to-lead process (wix website). It creates a lead via WTL. 
Thanks in advance :)
I am not able insert a record in opprotunity object via lightnig components. I don't where i going wrong. 

Component: -
<aura:component controller="BookingController"  implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"  access="global">

    
<aura:attribute name="BookObj" type="String" default="{'sobjecttype' : 'Opportunity'}"/>
<aura:attribute name="StaffId" type="String"/>  
<aura:attribute name="Name" type="String" default=""/>
<aura:attribute name="BookingDate" type="Date" default=""/>
<aura:attribute name="Kilometer" type="String" default=""/>
<aura:attribute name="Pickup" type="String" default=""/>
<aura:attribute name="Drop" type="String" default=""/>
<aura:attribute name="Cab" type="String"/>
<aura:attribute name="SelectPayment" type="String[]" default=""/>
<aura:attribute name="AcctId" type="String" default="Account[]"/>
<aura:attribute name="DriverId" type="String" default="Employee_Information__c"/>
    <aura:attribute name="Stage" type="String" default="New"/>

<br/>
<div class="slds-page-header">
        <div class="slds-align_absolute-center">
            <div class="slds-text-heading_large">
                <div class="slds-m-top_xx-large">
                    Booking Cab
                </div>
            </div>
        </div>
    </div>
    
<br/>
<lightning:recordEditForm aura:id="recordEditForm" objectApiName="Opportunity">
    <lightning:messages/>
    <lightning:inputField fieldName="Name" type="String" value="{!v.Name}"/>
    <lightning:inputField fieldName="CloseDate" type="Date"  value="{!v.BookObj.BookingDate}"/>
    <lightning:inputField fieldName="Pickup_Location__c" type="String" value="{!v.BookObj.Pickup}"/>
    <lightning:inputField fieldName="Dropping_Location__c" type="String" value="{!v.BookObj.Drop}"/>
    <lightning:inputField fieldName="Kilometer__c" type="String" value="{!v.BookObj.Kilometer}"/>
    <lightning:inputField fieldName="Select_Option__c" type="String" value="{!v.BookObj.Cab}"/>
    <lightning:inputField fieldName="Select_Payment__c" type="String" value="{!v.BookObj.SelectPayment}"/>
    <lightning:inputField label="Customer id" fieldName="AccountId"  type="String" selectedRecord="{!v.BookObj.AccntId}"/>
    <lightning:inputField fieldName="Driver__c" selectedRecord="{!v.BookObj.AccntId}" type="String" required="true"/>
    <lightning:inputField fieldName="StageName"  value="{!v.BookObj.Stage}"/>
</lightning:recordEditForm>

<lightning:button label="Book" onclick="{!c.doBook}"></lightning:button>
</aura:component>

Controller: -

({
  doBook : function(component, event, helper) { 
    var action = component.get("c.SaveRecord");
    action.setParams({ 
        "Opp": component.get("v.BookObj")
    });
    action.setCallback(this, function(a) {
           var state = a.getState();
            if (state === "SUCCESS") {
                var name = a.getReturnValue();
               alert("hello from here"+Name);
            }
        });
    $A.enqueueAction(action)
}
})


Apex Class: -
public with sharing class BookingController {
    
    @AuraEnabled
    public static Opportunity SaveRecord(Opportunity oppObj){
         System.debug('opportunity::' +oppObj.Name);
        insert oppObj;
        return oppObj;
        
    }
}
Hi Team,

CAn you please give me some idea , why and when we need dynamic dashboard

Thanks
Hello,

trigger always runs in system mode.

https://salesforce.stackexchange.com/questions/172060/types-of-execution-system-mode-or-user-mode

But what if the trigger calls a method from a class which has "with sharing" or "without sharing defined"?

I did my own tests and it seems that if the method is called from a trigger, even the method executes in system mode, so it does not matter if it is "with" or "without sharing", once it is called from a trigger, it always runs in system mode.

Yes or no?
I have a validation rule on the 'Interested Modules' picklist that is working below....

text( Interested_Modules__c ) = "Leadr + HR"
&&
 isblank(text(Broker_Status__c) )

However the picklist has grown and I now need to add additional values that if those values are selected, they also fire the validtion rule to fill out Broker Status. I need to add 5 more values. 
Can we restrict an Support Agent from sending Email messages from the Salesforce FROM with his/her Nominal Address?

Support Agents are supposed to send Emails only FROM the predefined Organization-Wide Email Addresses or Email-to-Case addresses (but NOT from their nominal addresses).

In other words:
We want to avoid Agents from sending messages from addresses like john.smith@cognizant.com;

We want all Agents to send messages from predefined addresses such as contact@corporateDomain.com;

I do not think that is possible with point-and-click configuration in Salesforce (I am not finding anything usefule in the documentation).

I can think of a "Before Apex Trigger" to display a message but... it would not look good (the john.smith@cognizant.com address would still appear on the FROM drop-down list of addresses, even if we can stop the Agent from sending it with that "Before Apex Trigger).

Any idea of how I could restrict an Agent user from using his/her own address to send an outbound email mssge from objects like Leads, Contacts, Cases, etc. ?
Hi All,

I need to update Custom label from LWC. my Custom label is Hello {0} and {1}.

How to update by LWC,


Thanks
Hi Team,

I want to hide Liightning componet Close Button(Top right corner) or cross button.User-added image 
when i click on quick action then one of lightning component assosciated with it and open, but need to remove close button.

Please suggest

 
I am using a process buider:- 

if user cloned any opportunity then one of my process builder should not execute, after creation of this opportunity if user edit this opportunity then process builder should execute.

Please suggest
Hi Expert,

I have a custom field on Task object, and now i want to update task by API. i have tried to update by Postman, but facing error.
 
{
        "message": "insufficient access rights on object id",
        "errorCode": "INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY",
        "fields": []
    }

 Please suggest

Regards
Mukesh
Hi Expert,

I am using add error method, when criteria match then addError method call, but here script doenot stop and execute next loop.

i want to stop script when addError call. i have used break; return; but nothing happen

 
for (Opportunity currOpp: newOpportunities_1){
              System.debug('currOpp name '+currOpp.name);
            if (currOpp.RecordTypeId!=PMRecordTypeId.Id  ){
                currOpp.addError(Label.pmr);   
               
            }
          }

for (Opportunity currOpp: newOpportunities_2){
              System.debug('currOpp name '+currOpp.name);
         
          }

Thanks 
Mukesh

 
Hi Expert ,

I am creating dynamic check boxes that's crated perfect, change event is not working for created check boxes;

when i select any check box then get error
getting error :- Unable to find action 'handleSelectedOLI' on the controller 
 
for(var i = 0; i<5; i++){
 $A.createComponent(
            "ui:inputCheckbox",
            {
                "aura:id": "checkBoxOLI",
                "value":chekboxVal,
                "change": component.getReference("c.handleSelectedOLI")
            },
            function(newButton, status, errorMessage){
                //Add the new button to the body array
                if (status === "SUCCESS") {
                    var body = component.get("v.body");
                    //body.push(newButton);
                    component.set("v.body", newButton);
                }
                else if (status === "INCOMPLETE") {
                    console.log("No response from server or client is offline.")
                    // Show offline error
                }
                else if (status === "ERROR") {
                    console.log("Error: " + errorMessage);
                    // Show error message
                }
            }
        );  
		
handleSelectedOLI: function(component, event, helper) {
        alert('change ecevt ');
    
    },

Please suggest

Regards
Mukesh
Hi Expert,

I want to destroy selected check box when user try to select all and click on delete buttion.
 without destroy this is exist already and make extra check boxes that's was previously deleted so now i want to destroy selected items

Below code is creating check boxes:-

this is select All check box
<ui:inputCheckbox value = "{!v.isSelectAll}" change="{!c.handleSelectAllOLI}" aura:id="selectAll"/>

this is list of check boxes:-
<aura:iteration items="{!v.DEFProductInstance}" var="item" indexVar = "indx">
<ui:inputCheckbox aura:id="checkBox" />
 </aura:iteration>


Please suggest

Thanks
When manager reject opportunity then error message display from trigger, but i want to bypass addError message in apex trigger. for spicific condition user face addError message, but when opportuntiy reject by manager then i want to by pass this error message.

Please suggest

Regards
Mukesh 
Hi Expert,

I am using below code but not able to get maximum length  on keyUp event.

 
<ui:inputCurrency class="slds-input" aura:id="curr" format="##,##,###,##0.00" maxlength="6" updateOn="keyup" keyup = "{!c.changesValueInput}"/>

Please suggest
 
Hi Expert,

I am creating contact by 'e.force:createRecord', but now i want to created contact record Id. after this event. 

Can you please suggest.

Regards
Mukesh 
Hi Expert,

I am trying to create a lwc project in VS code, but when i try to create 
then facing error:

command 'sfdx.force.project.create' not foundUser-added imagePlease suggest.

I am using jdk1.8.0_231 for 64 bit
Hi expert,

I have multiple country picklist in lightning compont that's is iterating in Table TR
we i choose any picklist value 'UAS' and click on save button than this picklist should be disable.

but when i change of picklist then picklist disable on selection time. but i want to disable on save button.

Please suggest
<aura:iteration items="{!v.CountryDetails}" var="item" >
<tr> 
<td class="slds-cell-wrap">
                        <lightning:select name="statusFld" label="" value="{!item.Country__c}" disabled="{!item.Country__c == 'Closed Won')}">
                            <option value="--None--">--None--</option>
                            <aura:iteration items="{!v.listCountry}" var="val">
                                <option value="{!val.value}" selected="{!val.value==item.Country__c}">{!val.key}</option>
                            </aura:iteration>
                        </lightning:select>
                    </td>
</tr>
</aura:iteration>

 
Hi I am using visualforce page to open Lightninng component in new tab:-

on opportunity object -->> button & Link (Name:-AddProduct)

add URL parameter :- 

/apex/OppProduct_VFP?oppId={!Opportunity.Id}

when user click on 'AddProduct' button then below VF page open in new tab with lightnig component:-

OppProduct_VFP:-
<apex:page controller="TestController" tabStyle="Opportunity" lightningStylesheets="true">
    <apex:includeLightning />
    <div class="slds" style="margin-top:10px;margin-left:10px;"> 
        <div id="lightning" />
    </div>
   
    <script>
    

        $Lightning.use("c:AddProductApp", function() {
            $Lightning.createComponent(
                "c:AddProduct",
                {recordId : "{!OpportunityId}"},
                "lightning",
                function(cmp) {
                   
            });
        });
    </script>
</apex:page>

i have a close button in AddProductController to close this tab but not able to closed this tab getting UNDEFINED in console log. i am not able to get TabId by this code.

 
Close : function(component, event, helper){
        var workspaceAPI = component.find("workspace"); // mentioned in component 
          workspaceAPI.isConsoleNavigation().then(function(consoleResponse) {  
              console.log('consoleResponse-->>> '+consoleResponse) // return undefined
              workspaceAPI.getFocusedTabInfo().then(function(tabResponse) {
                  console.log('tabResponse-->> '+tabResponse)// return undefined
                   var isSubtab = tabResponse.isSubtab;
                  console.log('isSubtab-->> '+isSubtab);// return undefined
              });
        });
Please suggest and let me know where i am wrong
​​​​​​​
I am using a lightning componet, whrn i click on a button then this coponent open. on this component i have a close button. when i click on this closed button page redirect to previous page, but tab not closed.

i am using below code for tab close
closeFocusedTab : function(component, event, helper) {
         var workspaceAPI = component.find("workspace");
        //alert(workspaceAPI);
        workspaceAPI.getFocusedTabInfo().then(function(response) {
            //alert('aaaa -- '+response);
            var focusedTabId = response.tabId;
            workspaceAPI.closeTab({tabId: focusedTabId});
        })
        .catch(function(error) {
            console.log(error);
        });

    
    }

    Can you please suggest.

User-added image
Hi Expert,

I want to add attachment on record creation time in apex code, but in attachment custom code  we need record Id, but record is not created. so how achive this functionality,

Example: when we fill any exam from then we can attachemtn or document, and then save the record.

Thanks
 
Hi Expert,

i want to open a popup box that should be open when user logged In. when user  closed this then this will not reopen for this session. if user logged in again then popup should be open .

what i have done:

create a lightning component and added this on home page layout. but this popup open again and again when home page refresh. 

So can you please suggest what should i use sothat model popup should open once for current session.

Regards
Mukesh
Hi Expert,

I want to use Remote Objects in lightning component , below code is working in visualforce  pages, but now i need to implement this code in lightning component.

for example:- 
  <!-- Remote Objects definition to set accessible sObjects and fields -->
    <apex:remoteObjects >
        <apex:remoteObjectModel name="Warehouse__c" jsShorthand="Warehouse" 
            fields="Name,Id">
            <apex:remoteObjectField name="Phone__c" jsShorthand="Phone"/>
        </apex:remoteObjectModel>
    </apex:remoteObjects>

Thanks
Mukesh
Hi Expert,

In one class i have two soql:-
Example:- 
public class test(){

     List<Account> acc = [select id, name from Account Limit 40000];
     List<Contact> con = [seldect id, email from Contact Limit 15000];
}

//above queries will return limit excede error or not 

 
Hi Expert,

I want to reopen a case when any email comes from user. what i implemented:-

I creaed a workflow that execute on when agent close a case with email template taht's have a case thread id. but when customer reply this email then related case shouuld be reopen and this mail should be add in Email related list on that case.

Please suggest.

Regards
Mukesh​



  





 
Hi Expert,

How would sharing rule work in the below scenario

Suppose i create a new object called "XXXX". Now profile called "AAAA" doesn't have read, create, edit permission on it.

Q1: What would happen if I create a record of object "XXX" and share it with user which has profile "AAAA" and give him "Edit" permission on the record? Would user be able to see the record or edit the record? please qualify your answer.

Q2: Can anybody explain in what order access on record or object is granted in terms of OWD, Sharing rule, Role and profile?

Q3: If i set OWD setting as Public Read/Edit on Object "XXXX" but profile "AAAA" don't have read, create and edit permission on Object "XXXX" then the user who owns profile "AAAA" would be able to see and edit the records of object "XXXX"?

Q4: What would happen if profile "AAAA" has only Read permission on Object "XXXX" then user who owns profile "AAAA" would be able to see and edit ALL the records of object "XXXX"?

Q5: In order to work out OWD setting, at least profile must have Read permission on that particular object?

Q6: The user who is higher role in hierarchy would get owner permission on the records created by user who are lower in the roles means he can edit and delete the record as well. Is that correct?

Please share your best 

Regards
Mukesh
Hi Expert,

I want to create some demo on marketing cloud  journey builder. Can any one share about how to acces journey builder in markeing cloud.

Thanks
Mukesh
Hi Expert,

I need to create an application for me to send SMS directly from Salesforce. Please suggest.

User-added image
Hi Expert,

I am using a test class for coverage 75% code, but few things are not covered. Can any one suggest what is going wrong.

this my test Class: --
@isTest
public class TestProfessorSelectCourse {
    @isTest static void ProfessorCourse(){
       
        
        Professor__c prof = new Professor__c(Name ='JP',Email__c='jp@gmail.com');
        insert prof;
        
        Class__c cls = new Class__c(name='12G', Class_Teacher__c = prof.id);
        insert cls;
        
        Course__c cors = new Course__c(Professor__c=prof.id,Class__c =cls.id, name='Ruby', Start_Date__c= Date.today() , End_date__c= Date.newInstance(2017,03,20));
       	//Professor__c prof = new Professor__c(Name ='JP');
        //cors.Professor__c = prof.Name;
        insert cors;
    }
}

and below is my main class


User-added image

Thanks 
Mukesh
I am issues creating a test class:
 
Class:

public class quickcilverAPI {
    @future(callout=true)
    public static void callServer(String id){
        Opportunity opp =[Select Id, Account.FirstName,Account.ShippingAddress,Account.BillingAddress, Account.LastName,Email__c,DUP_Mobile__c,account.BillingStreet,account.BillingCity,account.BillingState,account.BillingCountry,account.BillingPostalCode,
                          account.ShippingStreet,account.ShippingCity,account.ShippingState,account.ShippingCountry,account.ShippingPostalCode from Opportunity where id=: id limit 1];
        
        OpportunityDataWrap oppdata = new OpportunityDataWrap();
        // A random number need to be appended to the refno to avoid duplicate refno api error
        // Generate a random number between 0 and 1000
        Integer randomNumber = Integer.valueof((Math.random() * 1000));

        String rno = 'DC-' + opp.Id + '-' + randomNumber;
        oppdata.refno = rno;
        oppdata.syncOnly = true;
        oppdata.deliveryMode = 'EMAIL';
        
        if(opp.Account.ShippingAddress !=null){
            ShippingAddressWrap cc = new ShippingAddressWrap();
            cc.firstname = opp.Account.LastName;
            cc.lastname = '';
            cc.email = opp.Email__c;
            cc.telephone = '+91'+opp.DUP_Mobile__c;
            cc.country = 'IN';
            cc.line1 = opp.Account.ShippingStreet;
            cc.line2 = '-';
            cc.city = opp.Account.ShippingCity;
            cc.postcode = opp.Account.ShippingPostalCode;
            cc.region = opp.Account.ShippingState;
            cc.billToThis = true;
            oppdata.address = cc;
        }
        
        if(opp.Account.BillingAddress !=null){
            BillingAddressWrap cb = new BillingAddressWrap();
            cb.firstname = opp.Account.lastname;
            cb.lastname = '';
            cb.email = opp.Email__c;
            cb.telephone = '+91'+opp.DUP_Mobile__c;
            cb.country = 'IN';
            cb.line1 = opp.Account.ShippingStreet;
            cb.line2 = '-';
            cb.city = opp.Account.ShippingCity;
            cb.postcode = opp.Account.ShippingPostalCode;
            cb.region = opp.Account.ShippingState; 
            oppdata.billing = cb;
        }
        List<paymentwrap> pw = new List<paymentwrap>();
        paymentwrap pwr = new paymentwrap();
        pwr.code = 'svc';
        pwr.amount = 100;
        pw.add(pwr);
        oppdata.payments = pw;
        
        List<productsWrap> prodwrap = new List<productsWrap>();
        productsWrap pdwr = new productsWrap();
        pdwr.sku = 'CNPIN'; // PROCESSINGSTS  DISABLEDSTS CNPIN testsuccess001 APITESTTIMFAIL 324
        pdwr.price = 100;
        pdwr.qty = 1;
        pdwr.currency_x =356;
        pdwr.giftMessage ='';
        pdwr.theme ='';
        prodwrap.add(pdwr);
        oppdata.products = prodwrap;
        System.debug('OppData:- '+oppdata);
        
        String jsbody = JSON.serialize(oppdata);
        String jsonBody = jsbody.replace('currency_x', 'currency'); 
        System.debug('JSON BODY: '+jsonBody);
        
        map<String,Object> result = (map<String,Object>)JSON.deserializeUntyped(jsonBody);
        System.debug('result: '+result);
        // Create signature for order api using A, C, D, E, F and G below.
        
        jsonBody = JSON.serialize(result);	// E
       
        String encodedReqBody = EncodingUtil.URLEncode(jsonBody,'UTF-8').replace('+','%20');	// F
        System.debug('encodedReqBody: '+encodedReqBody);
        System.debug('jsonBody: '+jsonBody);
        
        String absApiUrl = Label.WoohooAPI+'/orders';
        System.debug('absApiUrl: '+absApiUrl);
        
        quickcilver__c	qc = quickcilver__c.getvalues('quickcilver details');
        String secretKeyValue = qc.Consumer_secret__c;
        String bearerToken = qc.Bearer_Token__c;
        Date tokenDate = qc.Token_Date__c; 
        String reqMethod = 'POST';		// A - for order api
        
        String encodedAbsApiUrl = EncodingUtil.URLEncode(absApiUrl,'UTF-8').replace('+','%20');	// C

        System.debug('encodedAbsApiUrl: '+encodedAbsApiUrl);
        String endPoint = reqMethod + '&' + encodedAbsApiUrl;		// D = (A&C)
        String baseString = endPoint + '&' + encodedReqBody;		// G = (D&F)
        System.debug('endPoint: '+ endPoint);
        System.debug('baseString: '+ baseString);
        
        String signature;       
        // converting base string (G) to HMAC-SHA512 hash (secret)
        Blob hmacData = Crypto.generateMac('HmacSHA512', Blob.valueOf(baseString), Blob.valueOf(secretKeyValue));
        signature = encodingUtil.convertToHex(hmacData); // signature generated for order api
        System.debug('signature: '+signature);

        // Now create another signature for calling status api using A, C and D below.
        // New values required for these parameters. GET API without query parameter.
        String reqMethodStatusApi = 'GET';		// A 
        String absStatApiUrl = Label.WoohooAPI + '/order/' + rno + '/status'; // endpoint for status api
        System.debug('absStatApiUrl: ' + absStatApiUrl);
        String encodedAbsStatApiUrl = EncodingUtil.URLEncode(absStatApiUrl,'UTF-8').replace('+','%20');	// C
        String endPointStatusApi = reqMethodStatusApi + '&' + encodedAbsStatApiUrl;		// D = (A&C)

        String signatureStatusApi;       
        // converting base string (D) to HMAC-SHA512 hash (secret)
        Blob hmacDataStatApi = Crypto.generateMac('HmacSHA512', Blob.valueOf(endPointStatusApi), Blob.valueOf(secretKeyValue));
        signatureStatusApi = encodingUtil.convertToHex(hmacDataStatApi); // signature generated for status api
        System.debug('signatureStatusApi: ' + signatureStatusApi);
        
        String dateAtClient = datetime.now().formatGMT('yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'');
        System.debug('dateAtClient: ' +  dateAtClient);
        
        // Keep re-using previously generated token for 6 days
        Integer tokenElapsedDays = 0;
        if(tokenDate != null){
            // No. of days between two dates
            tokenElapsedDays = tokenDate.daysBetween(date.today());
            System.debug('No. of tokenElapsedDays : '+ tokenElapsedDays);
        }

        Boolean newTokenGenerated = false;
        if(tokenElapsedDays > 6 || bearerToken == null || tokenDate == null){
            bearerToken = quickcilverOauth.BearerToken(); // generate new token after 6 days
            newTokenGenerated = true; // set flag to save token and date
        } 

        System.debug('bearerToken: ' + bearerToken);
        String emailAlertBody = '';
        String emailAlertSub = '';
        Integer callOrderApi = 2; // total order api tries max 2, including 1 re-try if needed. 0 = stop.
        Boolean callStatusApi = true; 
        While(callOrderApi > 0 && callStatusApi == true) {
            callStatusApi = true; // reset for second iteration
            try {
                // send http request
                HttpRequest request = new HttpRequest();
                request.setEndpoint(absApiUrl);
                // waiting for 15 sections before timing out, default is 10 and you can use 10 to check
                // timeout and using SKU testsuccess001
                request.setTimeout(15000); 
                request.setMethod(reqMethod);
                request.setHeader('Content-Type', 'application/json');
                request.setHeader('Authorization', 'Bearer ' + bearerToken);
                request.setHeader('dateAtClient', dateAtClient);
                request.setHeader('signature', signature);
                request.setHeader('Accept', '*/*');
                request.setBody(jsonBody);
                Http http = new Http();
                HttpResponse response = http.send(request);
                System.debug('response body: ' + response.getBody());
                System.debug('response: ' + response); 
                System.debug('request: ' + request); 
                System.debug('Authorization: ' + request.getHeader('Authorization'));

                ResponseData rd = (ResponseData)JSON.deserialize(response.getBody(),ResponseData.class);

                if (response.getStatusCode() == 201) {   // Created success code, for POST request.
                    String responseStatus = (String)rd.status;
                    if (responseStatus == 'COMPLETE') { // if order successfully placed
                        callOrderApi = 0; // no need to re-try, stop the loop.
                        emailAlertSub = 'Woohoo Card creation SUCCESS';
                        emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                            rno + '\nWoohoo Card created Successfully. \nResponse Status: ' + responseStatus;
                        sendEmailAlert(emailAlertSub, emailAlertBody);
                    } 
                } else if (response.getStatusCode() == 400) { // Bad request body.
                    callOrderApi = 0; // no need to re-try, stop the loop.
                    String responseCode = (String)rd.code;
                    String responseCodeMsg = (String)rd.message;
                    if (responseCode == '5310'){ // SKU Disabled
                        emailAlertSub = 'Woohoo Card SKU DISABLED';
                        emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                            rno + '\nError: SKU is Disabled. \nResponse code: ' + responseCode +
                            '\nResponse message: ' + responseCodeMsg;
                        sendEmailAlert(emailAlertSub, emailAlertBody);
                    } else if (responseCode == '5313'){ // Duplicate ref. no.
                        emailAlertSub = 'Woohoo Card order FAILED';
                        emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                            rno + '\nError: DUPLICATE Reference No. \nResponse code: ' + responseCode +
                            '\nResponse message: ' + responseCodeMsg;
                        sendEmailAlert(emailAlertSub, emailAlertBody);
                    } else if (responseCode == '6050'){ // Black listed phone number.
                        emailAlertSub = 'Woohoo Card order FAILED';
                        emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                            rno + '\nError: Blacklisted Customer/Phone No. \nResponse code: ' + responseCode +
                            '\nResponse message: ' + responseCodeMsg;
                        sendEmailAlert(emailAlertSub, emailAlertBody);
                    } else { 
                        String responseCodeMsgs = (String)rd.messages[0]; // additional response messages
                        emailAlertSub = 'Woohoo Card order FAILED';
                        emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                            rno + '\nError: Bad request body. \nResponse code: ' + responseCode +
                            '\nResponse message: ' + responseCodeMsg +
                            '\nAdditonal response messages: ' + responseCodeMsgs;
                        sendEmailAlert(emailAlertSub, emailAlertBody);
                    }
                } else if (response.getStatusCode() == 401) { // Unauthorized
                    bearerToken = quickcilverOauth.BearerToken(); // generate new token if old is rejected
                    newTokenGenerated = true; // set flag to save token and date
                    callStatusApi = false;
                } else if (response.getStatusCode() == 503 ||
                    response.getStatusCode() == 500) { // Service temp. unavailable or Server error
                        emailAlertSub = 'Woohoo Card Server ERROR';
                        emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                            rno + '\nError: Server Error or Server Unavailable.';
                        sendEmailAlert(emailAlertSub, emailAlertBody);   
                        System.debug('Order API Server unavailable. Status Code: ' + response.getStatusCode());  
                } 
                // Update new token and generation date if a new token was generated
                if (newTokenGenerated) {
                    qc.Bearer_Token__c = bearerToken;
                    qc.Token_Date__c = date.today();
                    update qc;
                } 
            } catch (System.CalloutException eOrderApi) {
                // No response/time out from order api, before retrying calling order api, call status api
                // write error to debug log
                System.debug('Order API Error: ' + eOrderApi + ' - Order Ref.No: ' + rno);
                // No need to send email to admin here as we are checking status api below & sending mail there 
            } // end order api try catch

            if (callOrderApi > 0 && callStatusApi == true) {
                try {
                    // call status api
                    HttpRequest statApiReq = new HttpRequest();
                    statApiReq.setEndpoint(absStatApiUrl);
                    statApiReq.setTimeout(40000); // timeout 40 seconds
                    statApiReq.setMethod(reqMethodStatusApi);
                    statApiReq.setHeader('Content-Type', 'application/json');
                    statApiReq.setHeader('Authorization', 'Bearer ' + bearerToken);
                    statApiReq.setHeader('dateAtClient', dateAtClient);
                    statApiReq.setHeader('signature', signatureStatusApi);
                    statApiReq.setHeader('Accept', '*/*');
                    Http http = new Http();
                    HttpResponse statApiResp = http.send(statApiReq);
                    System.debug('statApiResp body: ' + statApiResp.getBody());
                    System.debug('statApiResp: ' + statApiResp); 
                    System.debug('statApiReq: ' + statApiReq); 
                    System.debug('statAuthorization: ' + statApiReq.getHeader('Authorization'));

                    ResponseData rdStatApi = (ResponseData)JSON.deserialize(statApiResp.getBody(),ResponseData.class);
                    String responseStatusApi = (String)rdStatApi.status;
                    // Check response statuses from status api
                    if (statApiResp.getStatusCode() == 200) {   // order success
                        if (responseStatusApi == 'COMPLETE') {
                            callOrderApi = 0; // no need to re-try order api, stop the loop
                            emailAlertSub = 'Woohoo Card Order Success. Status is: ' + responseStatusApi;
                            emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                                rno + '\nStatus API response is: ' + responseStatusApi;
                            sendEmailAlert(emailAlertSub, emailAlertBody); 
                        } else if (responseStatusApi == 'PENDING' || 
                                    responseStatusApi == 'CANCELED' ||
                                    responseStatusApi == 'PROCESSING') {
                            emailAlertSub = 'Woohoo Card Order Status: ' + responseStatusApi;
                            emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                                rno + '\nStatus API response is: ' + responseStatusApi;
                            sendEmailAlert(emailAlertSub, emailAlertBody); 
                            callOrderApi = 0; // no need to re-try order api, stop the loop
                        }
                    } else if (statApiResp.getStatusCode() == 400) {   // order not successful
                        if (responseStatusApi == '5320'){ // Order not available. Didn't get placed the first time
                            callOrderApi--; // decrement the re-try flag to call order api one more time and stop
                            // Generate new random # to create new unique ref.no.
                            // re-try order api second time
                            randomNumber = Integer.valueof((Math.random() * 1000));
                            rno = 'DC-' + opp.Id + '-' + randomNumber;
                        } else {
                            callOrderApi = 0; // no need to re-try order api, stop the loop 
                        }
                    } else {
                        emailAlertSub = 'Woohoo Card Order Status: ' + responseStatusApi;
                        emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                            rno + '\nStatus API response is: ' + responseStatusApi;
                        sendEmailAlert(emailAlertSub, emailAlertBody); 
                    }
                } catch (System.CalloutException eStatApi) {
                    // write error to debug log
                    System.debug('Status API Error: ' + eStatApi + ' - Order Ref.No: ' + rno); 
                    callOrderApi = 0; // no need to re-try, stop the loop
                    emailAlertSub = 'Woohoo Card Order Status Check ERROR';
                    emailAlertBody = 'For this Woohoo Card order with Reference No: ' + 
                        rno + '\nStatus API check Failed: ' + eStatApi;
                    sendEmailAlert(emailAlertSub, emailAlertBody);
                } // end status api try catch
            } // end callStatusApi
        } // end while loop

        // ResponseData rd = (ResponseData)JSON.deserialize(response.getBody(),ResponseData.class);
        //List<ResponseData> rd = (List<ResponseData>)JSON.deserialize(response.getBody(),List<ResponseData>.class);
        // System.debug('Response Data :' + rd);

     /* Opportunity oppty = new Opportunity();
        oppty.Id = opp.id;
      //oppty.Wohoo_Card__c = rd.cards[0].cardNumber;
      //oppty.Pin__c = rd.cards[0].cardPin;
        update oppty;*/

    } // end callServer


    public static void sendEmailAlert(String sub, String bdy){
        List<User> userList = new List<User>();
        userList = [SELECT Email FROM User WHERE Name = 'first last'];

        List<String> toAddresses = new List<String>();
        for (User u : userList) {           
            toAddresses.add(u.Email);
        }

        String messageSub = sub;
        String messageBody = bdy; 
        Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
        message.toAddresses = toAddresses;
        message.subject = messageSub;
        message.plainTextBody = messageBody;
        Messaging.SingleEmailMessage[] messages = 
            new List<Messaging.SingleEmailMessage> {message};
                Messaging.SendEmailResult[] results = Messaging.sendEmail(messages);
        if (results[0].success) {
            System.debug('The email was sent successfully.');
        } else {
            System.debug('The email failed to send: '
                + results[0].errors[0].message);
        }
    }

    public class ShippingAddressWrap{
        public String firstname{get;set;}
        public String lastname{get;set;} 
        public String email{get;set;} 
        public String telephone{get;set;} 
        public String line1{get;set;} 
        public String line2{get;set;} 
        public String city{get;set;} 
        public String region{get;set;} 
        public String country{get;set;} 
        public String postcode{get;set;} 
        public boolean billToThis{get;set;} 
    }
    
    public class BillingAddressWrap{
        public String firstname{get;set;}
        public String lastname{get;set;} 
        public String email{get;set;} 
        public String telephone{get;set;} 
        public String line1{get;set;} 
        public String line2{get;set;} 
        public String city{get;set;} 
        public String region{get;set;} 
        public String country{get;set;} 
        public String postcode{get;set;} 
    }

    public class paymentwrap{
        public String code{get;set;}
        public integer amount{get;set;}
    }

    public class productsWrap{
        public String sku{get;set;}
        public Integer price{get;set;}
        public integer qty{get;set;}
        public integer currency_x{get;set;}
        public String giftMessage{get;set;}
        public String theme{get;set;}
    }

    public class OpportunityDataWrap{    
        Public ShippingAddressWrap address{get;set;}
        Public BillingAddressWrap billing{get;set;}
        Public List<paymentwrap> payments{get;set;}
        public String refno{get;set;}
        public List<productsWrap> products{get;set;}
        public boolean syncOnly{get;set;}
        public String deliveryMode{get;set;} 
    }

    public class ResponseData {
        public String status;
        public String code;
        public String message;
        public List<String> messages;
        public List<cardwrap> cards;
    }

    public class cardwrap{
        public String cardNumber;
        public String cardPin;
    }
}



Test class:

@isTest
public class quickcilverAPI_Test {
    @isTest 
    public static void testCallServer() {
        User u = [SELECT Id, Name FROM user WHERE profile.Name = 'System Administrator' 
            AND IsActive = true LIMIT 1];
        System.runAs(u){
            Account acc = new Account();
            acc.FirstName = 'test opp';
            acc.LastName ='test opp';
            acc.PersonEmail ='test@test.com';
            acc.PersonMobilePhone ='9000009900';
            acc.ShippingStreet = '7th block kormangala';
            acc.ShippingCity ='Beng';
            acc.ShippingState = 'Karnataka';
            acc.ShippingPostalCode ='560096';
            acc.BillingCountry ='India';
            acc.BillingStreet = '7th block kormangala';
            acc.BillingCity ='Bengaluru';
            acc.BillingState = 'Karnataka';
            acc.BillingPostalCode ='560096';
            acc.BillingCountry ='India';
            insert acc;
            System.debug('Test Class Account: ' + acc);
        
            Opportunity opp = new Opportunity();
            opp.AccountId = acc.id;
            opp.Name = 'test opp';
            opp.StageName = 'Closed Won';
            opp.CloseDate = System.today();
            opp.Project_Name__c = 'Test opp';
            opp.Amount = 100;
            opp.Meeting_Type__c = 'EC';
            opp.Meeting_Venue__c = 'MGDC';
            opp.Update_Booking_Form__c = true; // has a validation rule
            insert opp;
            System.debug('Test Class Opportunity: ' + opp);





            quickcilver__c  cusSet1 = new quickcilver__c();
            cusSet1.Name = 'ff details';
            cusSet1.Bearer_Token__c = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.ff.9RvHRlS--EXp-f950oNlwesW3nc3g9SDBhlOr2LlNfM';
            cusSet1.url__c = 'https://sandbox.ff.in/oauth2/';
            cusSet1.Consumer_secret__c = '6935b3a44920a833def29070ff';
            insert cusSet1;

            String secretKeyValue = cusSet1.Consumer_secret__c;
            String absApiUrl = 'https://sandbox.ff.in/rest/v3/orders';
            String reqMethod = 'POST';		// A - for order api
            String encodedAbsApiUrl = EncodingUtil.URLEncode(absApiUrl,'UTF-8').replace('+','%20');	// C
            String endPoint = reqMethod + '&' + encodedAbsApiUrl;		// D = (A&C)
            String baseString = endPoint + '&' + encodedReqBody;		// G = (D&F)

            // Below custom setting data was needed becuase it was used in Class.DC_Webengageupdate.Callout and was being triggered
            DCWebengage__c  cusSet2 = new DCWebengage__c();
            cusSet2.Name = 'Dcwebeng';
            cusSet2.BearerToken__c = '097a1996-03d2-4870-8bbc-ff';
            cusSet2.url__c = 'https://api.ff.com/v1/accounts/aa131ca9/users';
            insert cusSet2; 

            Test.startTest();
            Test.setMock(HttpCalloutMock.class, new quickcilverAPI_Mockup());
            quickcilverAPI.callServer(opp.id);
            Test.stopTest();
        }
    }
}





Mock:

global class quickcilverAPI_Mockup  implements HttpCalloutMock{
    global HTTPResponse respond(HTTPRequest request) {
        quickcilverAPI.BillingAddressWrap billaddwrap = new quickcilverAPI.BillingAddressWrap();
        billaddwrap.city = 'Bengalurur';
        billaddwrap.country = 'IN';
        billaddwrap.email = 'test@test.com';
        billaddwrap.firstname = 'test';
        billaddwrap.lastname = 'test';
        billaddwrap.line1 = 'kormangala bengaluru';
        billaddwrap.line2 = '-';
        billaddwrap.postcode = '560067';
        billaddwrap.region = 'Bengaluru';
        billaddwrap.telephone = '+910000000000';
        
        quickcilverAPI.ShippingAddressWrap shipaddwrap = new quickcilverAPI.ShippingAddressWrap();
        shipaddwrap.billToThis = true;
        shipaddwrap.city = 'Bengaluru';
        shipaddwrap.country = 'IN';
        shipaddwrap.email = 'test@test.com';
        shipaddwrap.firstname = 'test';
        shipaddwrap.lastname = 'test';
        shipaddwrap.line1 = 'kormangala bengaluru';
        shipaddwrap.line2 = '-';
        shipaddwrap.postcode = '560067';
        shipaddwrap.region = 'Bengaluru';
        shipaddwrap.telephone = '+910000000000';
        
        list<quickcilverAPI.cardwrap> cwrap = new list<quickcilverAPI.cardwrap>();
        quickcilverAPI.cardwrap cw = new quickcilverAPI.cardwrap();
        cw.cardNumber = '1234';
        cw.cardPin = '1234';
        cwrap.add(cw);
        
        list<quickcilverAPI.paymentwrap> paywrap = new list<quickcilverAPI.paymentwrap>();
        quickcilverAPI.paymentwrap pw = new quickcilverAPI.paymentwrap();
        pw.amount = 100;
        pw.code = '356';
        paywrap.add(pw);
        
        list<quickcilverAPI.productsWrap> prodwrap = new list<quickcilverAPI.productsWrap>();
        quickcilverAPI.productsWrap pwrap = new quickcilverAPI.productsWrap();
        pwrap.currency_x = 0;
        pwrap.giftMessage = 'test';
        pwrap.price = 1234;
        pwrap.qty = 1;
        pwrap.sku ='EGVGBTNS001';
        pwrap.theme ='';
        prodwrap.add(pwrap);
        
        quickcilverAPI.OpportunityDataWrap oppdatawrap = new quickcilverAPI.OpportunityDataWrap();
        oppdatawrap.address = shipaddwrap;
        oppdatawrap.billing = billaddwrap;
        oppdatawrap.deliveryMode = 'EMAIL';
        oppdatawrap.refno = '';
        oppdatawrap.payments = paywrap;
        oppdatawrap.products = prodwrap;
        
        quickcilverAPI.ResponseData rd = new quickcilverAPI.ResponseData();
        rd.cards = cwrap;
        rd.status = 'success';
        
        HttpResponse response = new HttpResponse();
        response.setHeader('Content-Type', 'application/json');
        response.setBody(JSON.serialize(rd));
        response.setStatusCode(200);
        return response;
    }
}

 
How can I create a custom button in the Contract record page and on click of that button I need to navigate to an LWC (Lightning Web Component)
I get this error "Lightning Web Component quick actions are not supported for this entity" when trying to create new action of type LWC.

The meta.xml file below:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>52.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__RecordAction</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__RecordAction">
            <actionType>Action</actionType>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>

User-added image
Experts, 

I am a novice to Apex and having trouble to build a class wherein I want to fetch values from one list to another. 
 
List<User> UsersList = [select id,contactid,Gold_Partner_User__c,Customer_Portal_User__c FROM USER  WHERE isActive=TRUE AND Customer_Portal_User__c = TRUE];	
        
List<contact> ContactList =[Select id,Customer_Portal_Lic_assigned__c 
FROM contact WHERE ID IN : UsersList AND Customer_Portal_Lic_assigned__c=FALSE];
background: 

On USER object, Gold_Partner_User__c and Customer_Portal_User__c are formula fields which identify the type of license assigned. 

Our customers who do not have access to USER object, I have created Customer_Portal_Lic_assigned__c on contact object so that a contact list view / report could be created for them.
 
I want to build a scheduled apex job that identifies contacts where users who are mapped with a customer portal license are identified and the related contact object is updated with the checkbox. 

Kindly suggest how should be best done.
Hi,
I have two objects i.e; Invoice and Account. Invoice is a custom object, in invoice object, I have a master detail field called "customer name__c". I want to populate the customer name field with account name while creating a new record in invoice object. I have tried with process builder and flows to populate the account name but I can't update it.

So, Any suggestion how to update it through trigger?

Thanks,
Kezia
I need to reduce SOQL queries. I access the Organization record a lot and would like to do a query one time when my application starts and make the data available so I don't have to requery in other classes. I thought this would be a simple matter of declaring a variable as global in my home page controller, but it isn't visible from other classes. Am I misunderstanding the use of global variables, or is there a way to access Organization data without having to requery?
Hi there, I am trying to learn deployment but couldn't find outbound change sets.
Even tried to check mark "create and upload change sets" under administrative permissions in my profile but couldn't find that too :(


Thanks.
Hi, 
Could you please let me know if there is any simple way to bypass triggering emails on record update ?  Also what all do we need to check to see whether email is getting triggered   ( apex code, triggers, workflow rules etc .. )  ?? 

If there is no simple way to bypass triggering email on record update, would like to know what all need to be checked and how to bypass triggering email from WF rules etc ?

Wanted to bypass all emails when standard object Contact or User record is updated 
i'm doing the apex specialist superbadge
https://trailhead.salesforce.com/en/content/learn/superbadges/superbadge_apex

i'm not able to clear the challenge kindly someone help
WarehouseCalloutService:apxc:
public with sharing class WarehouseCalloutService implements Queueable {
    private static final String WAREHOUSE_URL = 'https://th-superbadge-apex.herokuapp.com/equipment';
    
    //class that makes a REST callout to an external warehouse system to get a list of equipment that needs to be updated.
    //The callout’s JSON response returns the equipment records that you upsert in Salesforce. 
    
    @future(callout=true)
    public static void runWarehouseEquipmentSync(){
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        
        request.setEndpoint(WAREHOUSE_URL);
        request.setMethod('GET');
        HttpResponse response = http.send(request);
        
        List<Product2> warehouseEq = new List<Product2>();
        
        if (response.getStatusCode() == 200){
            List<Object> jsonResponse = (List<Object>)JSON.deserializeUntyped(response.getBody());
            System.debug(response.getBody());
            
            //class maps the following fields: replacement part (always true), cost, current inventory, lifespan, maintenance cycle, and warehouse SKU
            //warehouse SKU will be external ID for identifying which equipment records to update within Salesforce
            for (Object eq : jsonResponse){
                Map<String,Object> mapJson = (Map<String,Object>)eq;
                Product2 myEq = new Product2();
                myEq.Replacement_Part__c = (Boolean) mapJson.get('replacement');
                myEq.Name = (String) mapJson.get('name');
                myEq.Maintenance_Cycle__c = (Integer) mapJson.get('maintenanceperiod');
                myEq.Lifespan_Months__c = (Integer) mapJson.get('lifespan');
                myEq.Cost__c = (Integer) mapJson.get('cost');
                myEq.Warehouse_SKU__c = (String) mapJson.get('sku');
                myEq.Current_Inventory__c = (Double) mapJson.get('quantity');
                myEq.ProductCode = (String) mapJson.get('_id');
                warehouseEq.add(myEq);
            }
            
            if (warehouseEq.size() > 0){
                upsert warehouseEq;
                System.debug('Your equipment was synced with the warehouse one');
            }
        }
    }
    
    public static void execute (QueueableContext context){
        runWarehouseEquipmentSync();
    }
    
}

anonymous window:
WarehouseCalloutService.runWarehouseEquipmentSync();
User-added imageUser-added image
 
I am 2010 graduate (Bachelor of computer application) and now i want to start my career in salesforce developer, Is this a good decision and after long gap my profile accpet by company as a Salesforce Developer.
What is the best for me to start as a Salesforce Admin OR Salesforce Developer.

Thanks,
Suraj Singh
I have this formula on case object but the field is not getting populated
TEXT(Source:LiveChatTranscript.Chat_status__c)

I have created a lookup field to Chat transcript oject.

Any suggestions why the field is not populating?

 I have 4 phone fields, I need the preferred phone field to be a required field when more than 1 phone number is entered. 
Preferred phone number - should be entered ONLY when 2 or more phone numbers are entered. Any help is appreciated. TIA
Hello, my client uses Jenkins for deployments.   I have a new LWC and created a Quick Action.  I added the Quick Action to the page layout.   The deployment fails and keep getting the message 

In field: QuickAction - no QuickAction named Roll_Year_Settings__c.Generate_Annual_Record found
Here is the complete message
 
=== Component Failures [3]
TYPE   FILE                                                                                                  NAME                                             PROBLEM
─────  ────────────────────────────────────────────────────────────────────────────────────────────────────  ───────────────────────────────────────────────  ───────────────────────────────────────────────────────────────────────────────────────────────────
Error  sdx_sourceDeploy_1631321403653/layouts/Roll_Year_Settings__c-Roll Year Settings Layout.layout         Roll_Year_Settings__c-Roll Year Settings Layout  In field: QuickAction - no QuickAction named Roll_Year_Settings__c.Generate_Annual_Record found
Error  sdx_sourceDeploy_1631321403653/quickActions/Roll_Year_Settings__c.Generate_Annual_Record.quickAction  Roll_Year_Settings__c.Generate_Annual_Record     Unable to retrieve lightning web component by namespace/developer name : org_Generate_Annual_Record
Error  sdx_sourceDeploy_1631321403653/quickActions/Roll_Year_Settings__c.Update_Annual_Record.quickAction    Roll_Year_Settings__c.Update_Annual_Record       Unable to retrieve lightning web component by namespace/developer name : org_Update_Annual_Record

[Pipeline] }
[Pipeline] // stage
[Pipeline] echo
Stage : 'Validate Code' | Status : FAILURE

I confirmed (many times) the LWC exists as well as the Quick Action but still get the error.
 
Any suggestions what is causing the error?
I have an issue where in my action.setCallBack is not being run.
When user closes the tab, the component call a function onTabClosed.
onTabClosed : function(component, event, helper) {
var aCaseId = component.get("v.recordId");
console.log('yep');
var action = component.get("c.hasCustomerInteractionOpenA");
action.setParams({aCaseId : aCaseId});
action.setCallback(this, function(response) {
console.log('callBack');
var state = response.getState();
var result = response.getReturnValue();
//console.log('BKO Picklist values ' +JSON.stringify(result));
if (state === "SUCCESS") {
console.log('test1');
component.set("v.checkTab",true); }
else{
console.log('test2');
component.set("v.checkTab",true);
} });
$A.enqueueAction(action);

console.log('yep1'); },


The console.log inside callBack is not being executed. Only the console.log(yep1) and (yep2).


Here is the Apex:
@AuraEnabled public static Boolean hasCustomerInteractionOpen(String aCaseId){

try{
Case lCase = [SELECT AttendanceProtocol__c, Id, Status, AttendanceProtocol__r.LastModifiedDate, AttendanceProtocol__r.vlocity_cmt__Status__c, OwnerId FROM Case WHERE Id =: aCaseId LIMIT 1];
if((String.isNotBlank(lCase.AttendanceProtocol__c)) && (lCase.AttendanceProtocol__r.vlocity_cmt__Status__c != 'Closed') && (lCase.OwnerId == (UserInfo.getUserId()))){

List<Case> lCaseCustomer = [SELECT Id,AttendanceProtocol__c, Status, ClosedDate FROM Case WHERE AttendanceProtocol__c =: lCase.AttendanceProtocol__c ORDER BY ClosedDate DESC];

if((lCaseCustomer[0].Id == lCase.Id) && ((lCase.AttendanceProtocol__r.LastModifiedDate) < (lCaseCustomer[0].ClosedDate))){

System.debug('true'); return true; }
} System.debug('false');
return false;
}catch(Exception e){ System.debug('The following exception has occurred: ' + e.getMessage()); return false; } }


The system.debug is returning in the debugging. So, the apex is being called, returning a value.
But the action.setCallBack is not accessing this value. I'm on it has two days, someone can help me? Really appreciate it.