• Rohith Kumar 98
  • NEWBIE
  • 40 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 11
    Replies
ERROR: [object Object]: The requested operation is not yet supported by this sObject storage type, contact salesforce.com support for more information.

Query: SELECT Id, DEAL_NUM__c,  Vehicle_Status__c, MDF_DATE__c, Status_Updated_Date__c from VEHICLE_SALE__x  WHERE DAY_ONLY(MDF_DATE__c) >= 2021-12-09

NOTE: MDF_DATE__c is DateTime field type.
User-added imageIn the above progress indicator, I need to add a label that is displayed always and displayed below each of the steps.

component code:
<lightning-progress-indicator current-step="1" type="base" has-error="false" variant="base">
    <lightning-progress-step label="Claim Information" value="1"></lightning-progress-step>
    <lightning-progress-step label="Job Details" value="2"></lightning-progress-step>
    <lightning-progress-step label="Review Claim" value="3"></lightning-progress-step>
    <lightning-progress-step label="Submit Claim" value="4"></lightning-progress-step>
</lightning-progress-indicator>

Expected visual:
User-added image​​​​​​​
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
I have a button named "Add Line Item" clicking on will create a new row in the table. 

When I add one row and change the value in the second column (PRODUCT NAME).
User-added image
After selecting the value and adding one more row, the values of the first row are copied to the second row also, when I change the value(lightning:select) in any row, It changes in all other rows.
User-added image

What is causing this and how can I solve the problem, I need different instances for each row.

Body of table component:
<tbody>
          <aura:iteration items="{!v.rowCount}" indexVar="count" >
            <tr>
              <td>{!count + 1}</td>
              <td><lightning:select variant="label-hidden" class="label-hidden" value="{!v.selectedItem}" onchange="{!c.getValue}">
                <option>--None--</option>
                <aura:iteration items="{!v.relatedItems}" var="item">
                  <option selected="{!item.selected}" value="{!item.UnitPrice__c}">{!item.Name}</option>
                </aura:iteration>
              </lightning:select></td>
              <td><lightning:input disabled="true" value="{!v.itemUnitPrice}" variant="label-hidden"/></td>
              <td><lightning:input type="number" variant="label-hidden" autocomplete="off"/><!--Quantity here--></td>
              <td>Price here</td>
              <td>Delete Icon Here</td>
            </tr>
          </aura:iteration>
</tbody>

 
I used lightning:select in table row but, it is not properly aligned(not centered vertically). How to align it vertically center like other column(PRICE and ACTION).

please zoom the image if it is too small.
User-added image
I have created a table and its expanding in same row of other element and expanding page horizontally. I want the table to be rendered in new row.

Table expands in wrong row
Table component is placed on parent component.
 
<aura:component>
    <table class="slds-table slds-table_cell-buffer slds-table_bordered" aria-labelledby="element-with-table-label other-element-with-table-label">
        <thead>
          <tr class="slds-line-height_reset">
            <th class="" scope="col">
              <div class="slds-truncate" title="count">#</div>
            </th>
            <th class="" scope="col">
              <div class="slds-truncate" title="Product Name">PRODUCT NAME</div>
            </th>
            <th class="" scope="col">
                <div class="slds-truncate" title="Item Cost">PER ITEM COST</div>
            </th>
            <th class="" scope="col">
                <div class="slds-truncate" title="Quantity">QUANTITY</div>
            </th>
            <th class="" scope="col">
                <div class="slds-truncate" title="Price">PRICE</div>
            </th>
            <th class="" scope="col">
                <div class="slds-truncate" title="Contracts">CONTRACTS</div>
            </th>
          </tr>
        </thead>
        <tbody>
            <aura:iteration items="{!v.tableItems}" var="tableItem">
                <tr>
                    <!--<td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>-->
                </tr>
            </aura:iteration>
        </tbody>
    </table>
</aura:component>

 
How to navigate to the record creation page(custom object) on click of lightning:button and return back to where I left after saving the record?
I have a lightning:select which is nothing but searching account names and selecting one, there is also a lightning:select which I want to display some value from the object which has an account as lookup (parent)

User-added image
Please help me. I want lightning:input to suggest a list of accounts that matches the text.
I want to render a particular pageBlockSection when a commandButton is clicked.

Command Button:
<apex:commandButton value="Add Labor" id="AddLabour" style="margin-left: 90%"/>

Page Block Section:
<apex:pageBlockSection title="Search Labours" collapsible="false" columns="3">
                <apex:outputLabel value="Component" for="SearchLaborKey"/>
                <apex:inputText id="SearchLaborKey" style="width: 100%"/>
                <apex:commandButton value="Find Labor Cost"
                style="margin-left: 70%; background:#0170b7; color:white"/>
            </apex:pageBlockSection>

Please help, thanks in advance.
how to attach this test class to the mocking framework? and what is its use?
@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();
    }
}

 
I have 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();
    }
}

What is mocking framework and how to attach above test class to mocking framework?
I have a custom object, I want to make this custom object to be accessed by particular profile... How I can do that, please provide steps.
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();
    }
}

 
There is a custom object named Payment Order with Account as the lookup field.
I created a trigger on this custom object so that when creating a new record and choosing any Account as lookup then the values from the Account are populated in some fields of the Payment Order custom object.

For the above trigger, I created a Test Class:
@isTest
public class TestPaymentOrderTriggerHandler {
    @isTest static void TestUpdatePaymentContactInformationCheck(){
        //Creating and Inserting new Account
        Account newAccount = new Account(Name = 'Test Account', Phone = '1234567890', BillingStreet = 'Test Billing Street',
                                      ShippingStreet = 'Test Shipping Street', ShippingPostalCode = '625014', ShippingState = 'Test State',
                                     ShippingCountry = 'Test country');
        insert newAccount;
        
        //Creating  and Inserting new Payment Order with created account as lookup
        Payment_Order__c paymentOrder = new Payment_Order__c(Account__c = newAccount.Id);
        insert paymentOrder;
        
        Test.startTest();
        System.assertEquals(newAccount.Name, paymentOrder.Payee_Name__c);
        Test.stopTest();
    }
}

but the actual value in System.assertEquals is null however expected value is the name of the account which is correct.

I tried the same code in execute anoynamous window, the created Account name and Payment Order's payee name is the same and not null like in the test method.

Trigger working fine, then why I am getting null value in the test class in System.assertEquals(newAccount.Name, paymentOrder.Payee_Name__c); for the highlited parameter.
There is a requirement like

If the payment amount >2000 USD, save the records with “Pending Approval” status and assign this to a queue “Payment Order Pending Approval”

How to do that in Apex?
 
if(paymentAmount > 2000 && status == 'Pending Approval'){
//What to do?
}

 
I created a custom object named Payment Order, and Account is parent to it with lookup relationship. When creating a new record in Payment Order and Account is not selected as lookup, I need to populate some fields from the custom object Payment Order(child) to Account and create that new Account. I did create an Account with fields but when I try to add the newly created Account as look up to the corresponding child I get an error that the record is read-only.

paymentOrder is a reference to each record from Trigger.new
account is a reference to newly created account
 
paymentOrder.Account__c = account.Id;

Here is the whole code
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 account = 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);
                paymentOrder.Account__c = account.Id;
                accountList.add(account);
            }
        }
        //Inserting created account record
        try{
            insert accountList;
        }catch(Exception error){
            error.getMessage();
        }
    }

 
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
I have created a table and its expanding in same row of other element and expanding page horizontally. I want the table to be rendered in new row.

Table expands in wrong row
Table component is placed on parent component.
 
<aura:component>
    <table class="slds-table slds-table_cell-buffer slds-table_bordered" aria-labelledby="element-with-table-label other-element-with-table-label">
        <thead>
          <tr class="slds-line-height_reset">
            <th class="" scope="col">
              <div class="slds-truncate" title="count">#</div>
            </th>
            <th class="" scope="col">
              <div class="slds-truncate" title="Product Name">PRODUCT NAME</div>
            </th>
            <th class="" scope="col">
                <div class="slds-truncate" title="Item Cost">PER ITEM COST</div>
            </th>
            <th class="" scope="col">
                <div class="slds-truncate" title="Quantity">QUANTITY</div>
            </th>
            <th class="" scope="col">
                <div class="slds-truncate" title="Price">PRICE</div>
            </th>
            <th class="" scope="col">
                <div class="slds-truncate" title="Contracts">CONTRACTS</div>
            </th>
          </tr>
        </thead>
        <tbody>
            <aura:iteration items="{!v.tableItems}" var="tableItem">
                <tr>
                    <!--<td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>-->
                </tr>
            </aura:iteration>
        </tbody>
    </table>
</aura:component>

 
I have a custom object, I want to make this custom object to be accessed by particular profile... How I can do that, please provide steps.
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();
    }
}

 
There is a requirement like

If the payment amount >2000 USD, save the records with “Pending Approval” status and assign this to a queue “Payment Order Pending Approval”

How to do that in Apex?
 
if(paymentAmount > 2000 && status == 'Pending Approval'){
//What to do?
}

 
I created a custom object named Payment Order, and Account is parent to it with lookup relationship. When creating a new record in Payment Order and Account is not selected as lookup, I need to populate some fields from the custom object Payment Order(child) to Account and create that new Account. I did create an Account with fields but when I try to add the newly created Account as look up to the corresponding child I get an error that the record is read-only.

paymentOrder is a reference to each record from Trigger.new
account is a reference to newly created account
 
paymentOrder.Account__c = account.Id;

Here is the whole code
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 account = 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);
                paymentOrder.Account__c = account.Id;
                accountList.add(account);
            }
        }
        //Inserting created account record
        try{
            insert accountList;
        }catch(Exception error){
            error.getMessage();
        }
    }

 
Challenge Not yet complete... here's what's wrong: 
Could not find an account named 'Blackbeards Grog Emporium' created from Workbench with the Description 'The finest grog in the seven seas.'

I have created it twice: (I have to use localhost/workbench MAMP due to my company security policy)
User-added image
User-added image
User-added image
User-added image