• Suraj Tripathi 47
  • ALL STAR
  • 8266 Points
  • Member since 2020
  • Salesforce Application Architect
  • Cloud Analogy


  • Chatter
    Feed
  • 253
    Best Answers
  • 0
    Likes Received
  • 9
    Likes Given
  • 0
    Questions
  • 2017
    Replies
writing test class for the below code

Handler class

public class WorkOredrTriggerHelper {
    public static void helperMethod(list<SVMXC__Service_Order__c> WorkOrders){
        
        Map<Id,List<SVMXC__Service_Order_Line__c>> mapLine = new Map<Id,List<SVMXC__Service_Order_Line__c>>();
        List<SVMXC__Service_Order_Line__c> lineItems = new List<SVMXC__Service_Order_Line__c>();
        List<SVMXC__Service_Order_Line__c> lineItemsToUpdate = new List<SVMXC__Service_Order_Line__c>();
        
        lineItems = [select id, Status__c, SVMXC__Service_Order__c from  SVMXC__Service_Order_Line__c where SVMXC__Service_Order__c in :WorkOrders];
        
        
        for(SVMXC__Service_Order_Line__c asd : lineItems) {
            if(mapLine.containsKey(asd.SVMXC__Service_Order__c)){
                mapLine.get(asd.SVMXC__Service_Order__c).add(asd);
                continue;
            }
            mapLine.put(asd.SVMXC__Service_Order__c,new List<SVMXC__Service_Order_Line__c>{asd});
        }
        
        for(SVMXC__Service_Order__c wo : WorkOrders){
            if(wo.SVMXC__Order_Status__c == 'Closed' || wo.SVMXC__Order_Status__c == 'Completed'){
                if(mapLine.get(wo.Id) != null) {
                   boolean flag = false;
                   for(SVMXC__Service_Order_Line__c wd : mapLine.get(wo.Id)){
                        if(wd.Status__c=='open'){
                            flag = true;
                        }
                    }
                   if(flag == true) {
                       System.debug('222The work order cannot be closed since there are no associated work detail lines or the related work detail lines are open.');
                       wo.addError('The work order cannot be closed since there are no associated work detail lines or the related work detail lines are open.');
                   }
                }
                else {
                    System.debug('No items');
                       wo.addError('No line items');
                }
                    
               
            }
        }

    }
    
    public static void updateRelatedLines(list<SVMXC__Service_Order__c> WorkOrdersNew, Map<Id,SVMXC__Service_Order__c> WorkOrdersOld) {
        
        Map<Id,List<SVMXC__Service_Order_Line__c>> mapLine = new Map<Id,List<SVMXC__Service_Order_Line__c>>();
        List<SVMXC__Service_Order_Line__c> lineItems = new List<SVMXC__Service_Order_Line__c>();
        List<SVMXC__Service_Order_Line__c> lineItemsToUpdate = new List<SVMXC__Service_Order_Line__c>();
        List<SVMXC__Service_Order__c> workOrdersToUpdate = new List<SVMXC__Service_Order__c>();
        String closureStatus = '';
        Integer countLineItems;
        Map<Id,String> closureStatusMap = new Map<Id,String>();
        
        lineItems = [select id, Status__c, SVMXC__Service_Order__c, Work_order_status__c, SVMXC__Start_Date_and_Time__c, SVMXC__End_Date_and_Time__c  from  SVMXC__Service_Order_Line__c where SVMXC__Service_Order__c in :WorkOrdersNew];
                
        for(SVMXC__Service_Order_Line__c asd : lineItems) {
            if(mapLine.containsKey(asd.SVMXC__Service_Order__c)){
                mapLine.get(asd.SVMXC__Service_Order__c).add(asd);
                continue;
            }
            mapLine.put(asd.SVMXC__Service_Order__c,new List<SVMXC__Service_Order_Line__c>{asd});
        }
        
        for(SVMXC__Service_Order__c wo : WorkOrdersNew){
            closureStatus = '';
            countLineItems = 0;
            if(wo.SVMXC__Order_Status__c != WorkOrdersOld.get(wo.Id).SVMXC__Order_Status__c && wo.SVMXC__Order_Status__c == 'Closed'){
                for(SVMXC__Service_Order_Line__c wd : mapLine.get(wo.Id)){
                    countLineItems = countLineItems + 1;
                    SVMXC__Service_Order_Line__c newLineItem = new SVMXC__Service_Order_Line__c();
                    newLineItem.Id = wd.Id;
                    newLineItem.Work_order_status__c = 'Work Order is Closed';
                    lineItemsToUpdate.add(newLineItem);
                    closureStatus += 'Start time of WDL'+ countLineItems + ' : ' + wd.SVMXC__Start_Date_and_Time__c+'\n';
                    closureStatus += 'End Date time of WDL'+ countLineItems + ' : ' + wd.SVMXC__End_Date_and_Time__c+'\n'+'\n';
                }
                closureStatusMap.put(wo.Id, closureStatus);
                
            }
        }
        
        List<SVMXC__Service_Order__c> workOrders = [SELECT Id, closure_status__c from SVMXC__Service_Order__c where Id in :WorkOrdersNew];
        for(SVMXC__Service_Order__c workOrder : workOrders){
            workOrder.closure_status__c = closureStatusMap.get(workorder.Id);
            workOrdersToUpdate.add(workOrder);
        }
        
        if(lineItemsToUpdate != null && lineItemsToUpdate.size() > 0){
            update lineItemsToUpdate;
        }
        
        if(lineItemsToUpdate != null && lineItemsToUpdate.size() > 0){
            update workOrdersToUpdate;
        }
    }    
}

Trigger

trigger woTriggerrr on SVMXC__Service_Order__c (before insert, before update, after update, after insert) {
    if(trigger.isBefore && trigger.isupdate){
        system.debug('Inside new trigger'+ Trigger.new);
        WorkOredrTriggerHelper.helperMethod(trigger.new);
    }
    
    if(trigger.isAfter && trigger.isupdate){
        system.debug('Inside new trigger after update'+ Trigger.new);
        WorkOredrTriggerHelper.updateRelatedLines(trigger.new, trigger.oldMap);
    }
}
Getting error like...
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The work order cannot be closed since there are no associated work detail lines or the related work detail lines are open.: []    AND

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, The work order cannot be closed since there are no associated work detail lines or the related work detail lines are open.: []



TEST CLASS
@isTest
public class WorkOredrTriggerHelperTest {
    @isTest static void helperMethod(){
        
        SVMXC__Service_Order__c serviceOrderObj = new SVMXC__Service_Order__c();
        serviceOrderObj.closure_status__c= 'test';
        serviceOrderObj.SVMXC__Order_Status__c = 'Closed';
        insert serviceOrderObj;
        
        SVMXC__Service_Order_Line__c lineObj = new SVMXC__Service_Order_Line__c();
        lineObj.Status__c = 'open';
        lineObj.SVMXC__Service_Order__c = serviceOrderObj.ID ; 
        insert lineObj;
        Test.startTest();
        update serviceOrderObj;
        System.assertNotEquals('closed', serviceOrderObj.SVMXC__Order_Status__c);
        Test.stopTest();
        
    }
    
    @isTest static void helperMethodSecond(){
        
        SVMXC__Service_Order__c serviceOrderObj = new SVMXC__Service_Order__c();
        serviceOrderObj.closure_status__c= 'test';
        serviceOrderObj.SVMXC__Order_Status__c = 'Closed';
        insert serviceOrderObj;
        
        
        SVMXC__Service_Order_Line__c lineObj = new SVMXC__Service_Order_Line__c();
        lineObj.Status__c = 'open';
        lineObj.SVMXC__Service_Order__c = serviceOrderObj.ID ; 
        insert lineObj;
        Test.startTest();
        serviceOrderObj.SVMXC__Order_Status__c = 'Closed';
        update serviceOrderObj;
        System.assertNotEquals('closed', serviceOrderObj.SVMXC__Order_Status__c);
        Test.stopTest();
        
        
    }
}
Vf code page 1
<apex:page controller="age">
<apex:form >
<apex:outputLabel >Enter Min Age</apex:outputLabel>
<apex:inputText value="{!p}"/>
<apex:commandButton value="Click me" action="{!ageBut}"/>
</apex:form>
</apex:page>

Apex code Page 1
public class age {

    public PageReference ageBut() {
        PageReference pr = new PageReference ('https://93com4-dev-ed--c.visualforce.com/apex/Max_Age?abc='+p);
        return pr;
    }
    public String p { get; set; }
}

Vf code page 2
<apex:page controller="Max_Age">
<apex:form >
    {!z.name}
    {!z.Age__c}
</apex:form>
</apex:page>

Apex code page 2
public class Max_Age {

    public Student__c z { set; get; }
    
    public Max_Age(){
        string k = ApexPages.currentPage().getParameters().get('abc');
        
     z = [SELECT Name, Student_Id__c, Age__c FROM Student__c WHERE Student_Id__c=:k];
    }
}

The above image was getting error in codes
Error
Hi there,
I am stuck in my program, Actually I want to use String expression into the IF statement condition.
eg:
String expression1 = 'Annual_Rev__c != 0 && Status__c == "Closed"';
if(expression1 ){
System.debug('It Worked...!');
}

Is there any solution for this, Please let me know your thoughts on this.

Thanks,
Rahul​​​​​​​

if user enter min age, max age . fetch all the students in btwn that min and max age

in above example try to load students in ascending order based on age

result can be shown in another page when clicked search button
How to fetch user details with user "(username,email)and opportunity(id,stagename) object fields based on username by using JSON 
trigger deleteUserTrigger1 on Task (before delete) {
    Id profileid=Userinfo.getProfileId();  
    profile profilname=[select Name from Profile where id=:profileid];
    for(Task accountDuplicate:Trigger.old){
        if(profilname.Name!='System Administrator'){
            accountDuplicate.addError('No Access for Deletion');                                    
        }    
    }
}*/
I tried this code but not working. Can any one help me on this?

trigger Contactduplicaterecord on Contact (before insert, before update) 
{
  set<string> EmaPho=new set<string>();
    
    for(Contact Con:trigger.new)
    {
        EmaPho.add(Con.Phone);
        EmaPho.add(Con.Email);
     }
    if(EmaPho.size()>0 )
    {
    List<Contact> lstContact=[Select Phone,Email from Contact where Phone in:EmaPho or Email in:EmaPho];
    Map<string, Contact> MapEmaPhowisecontact=new Map<string, Contact>();
    
    for(Contact Con:lstContact)
    {
        MapEmaPhowisecontact.put(Con.Phone, Con);
        MapEmaPhowisecontact.put(Con.Email, Con);
    }
    for(Contact Con:trigger.new)
    {
        if(MapEmaPhowisecontact.containsKey(Con.Phone))
        {
            Con.Phone.addError('Phone Number already Exist');
        }
        if(MapEmaPhowisecontact.containsKey(Con.Email))
        {
            Con.Email.addError('Email already Exist');
        }
    }
    }
}
trigger NumberOfChild on Case (After Insert,After Update,After Delete) {
   List<Account> accList=new List<Account>();

    Set<Id> setAccIds = new Set<Id>();
    if(Trigger.isInsert){
         if(trigger.isAfter){
        for(Case con : Trigger.new){
            if(con.AccountId != null){
            setAccIds.add(con.AccountId);
                }
            }
        }
    } 
    system.debug('setAccIds ==> '+setAccIds);
    if(Trigger.isUpdate){
         if(trigger.isAfter){
        for(Case con : Trigger.new){ 
            if(con.AccountId!=Trigger.oldMap.get(con.Id).AccountId){
                   setAccIds.add(con.AccountId);
                setAccIds.add(Trigger.oldMap.get(con.Id).AccountId);
                }
          
            }        
        }
    }
    if(Trigger.isDelete){
        if(trigger.isAfter){
        for(Case con : Trigger.old) { 
            if(con.AccountId != null){
            setAccIds.add(con.AccountId);
                }
            }
        }
    }    
    for(Account acc :[Select id,Summary__c ,(Select id,Description from Cases) from Account where Id in : setAccIds]){
      String s ='';
        for(Case Con :acc.Cases){
            s+=Con.Description +',';
        }
        acc.Summary__c =  s.removeEnd(',');
        acclist.add(acc);
    }
    if(acclist.size()>0){
        update accList;     
    }
}
My requirement: write a utility class, class name: XYZ, which fetch the data of ABC__c for case by using caseid, case is lookup with C_ABC__c, return some fields of ABC__c, return the list

program:
public class XYZ{
   public static  Map<String,Integer> CC(List<case> CaseIDs){
           Map<String,Integer> yup = new Map<String,Integer>();
           Map<Id, case> caseKeys = new Map<Id, case> (CaseIDs);
           List<Case> cList = [Select Id (Select ABC__c From C_ABC__r) From Case Where Id IN: caseIds];

       for(Case res :cList){         
            List<ABC__c> list = res.Customer_Vehicle__r; //Child Relationship Name
                   for(ABC__c a : vehlist){
                  
                  List<ABC__c> pqr = [SELECT NAME__c,LName__c FIELDS(STANDARD) FROM ABC__c];      
    }
          
   }
 } 
}

My questions:
i fetch case id correctly ?, use for loop or not, i want to return fields i do it correctly? please review and help me
Hello friends, I have a task datatable component and added the Who.Name as a column. the problem is, that now I do get error messages whenever there is a task where Who.Name is empty. Could you give me a solution for it?

User-added image
My code:

APEX
@AuraEnabled
public static List<Task> loadTasks3(Id recordId){
    string userId = UserInfo.getUserId();
    return[SELECT Subject, Who.Name, ActivityDate, Status FROM Task WHERE ActivityDate = TOMORROW AND OwnerId=:userId AND Status !='Completed'];
}



JS
component.set('v.mycolumns', [
            {label: 'Thema', fieldName: 'SubjectName', type: 'url',
            typeAttributes: {label: { fieldName: 'Subject' }, target: '_blank'}},
                 {label: 'Name', fieldName: 'whoName', type: 'text',
            typeAttributes: {label: { fieldName: 'Who.Name' }, target: '_blank'}},
        ]);
        var action = component.get("c.loadTasks");
            action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var records =response.getReturnValue();
                records.forEach(function(record){
                   
                    record.SubjectName = '/'+record.Id;
                    record.whoName = record.Who.Name
                });
                component.set("v.tasks", records);
            }
        });
        $A.enqueueAction(action);

 
Hi, can any one help me with trigger on Account , when an account insert , automatically account billing address should populate into the account shipping address.

I wrote this but not working
trigger AddressUpdate on Account (before insert) 
{
  for(Account Acc:trigger.new)
  {
      Acc.BillingStreet=Acc.ShippingStreet;
      Acc.BillingCity=Acc.ShippingCity;
      Acc.BillingCountry=Acc.ShippingCountry;
      Acc.BillingState=Acc.ShippingState;
      Acc.BillingPostalCode=Acc.ShippingPostalCode;
  }
}
@istest
public class Accountupdatetest {
    @testsetup
    static void Fieldvalues()
    {
        Account accountList=new Account(name='bargavi',BillingPostalCode='56789');
         insert accountList ;
        Address__c adds=new Address__c(zip_code__c='56789',State_City__c='karntaka',Country__c='india',Street__c='dangal');
         insert adds;
    }
    @istest
   static void test1()
    {
         Account acc2=[select name,BillingPostalCode,BillingCity,BillingCountry,BillingStreet from Account ];
       // Address__C adds1=[select Street__c,Zip_code__c,State_City__c,Country__c from Address__C];

         test.startTest(); 
          acc2.BillingPostalCode='56789';
        try{
         update acc2; 
        }
        catch(DmlException exp)
        {
            system.assert(exp.getMessage().contains('no address zipcode matched to the billing postal code'));
        }
    
       test.stopTest(); 
    }
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
public class Accountupdate {
public static void Mymethod(List<Account> acc)
          {
//List<Account> addition=new List<Account>();
           set<String> Collectstring=new set<String>();
                 for(Account collectzipcode:acc)
                     {
                           Collectstring.add(collectzipcode.BillingPostalCode);
                           system.debug(' collect All the Zip code ids'+Collectstring);
                      }
            List<Address__c> fetch=[select Street__c,Zip_code__c,State_City__c,Country__c  from Address__c where Zip_code__c in:Collectstring];
             system.debug(+fetch);
            Map<String,Address__c> maping=new Map<String,Address__c>();
                for(Address__c edit:fetch)
                    {
                       maping.put(edit.Zip_code__c,edit);
                        system.debug('maping'+maping);
                     }
                      for(Account acc1:acc)
                             {
                                 List<Address__c> lstAdd=new List<Address__c>();
                               Address__c lastoutput=maping.get(acc1.BillingPostalCode);
                                 lstadd.add(lastoutput);
                                 system.debug('lastoutput'+lastoutput);
                                        if(lstadd.size()<>null)
                                          {
                                              acc1.BillingCity=lastoutput.State_City__c;
                                               acc1.BillingCountry=lastoutput.Country__c;
                                               acc1.BillingStreet=lastoutput.Street__c;
                                           }
                           else
                           {
                                     acc1.adderror('no address zipcode matched to the billing postal code');
                           }

                              }
            }
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
error
//////////////////////
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, addressontrigger: execution of BeforeInsert

caused by: System.NullPointerException: Attempt to de-reference a null object

Class.Accountupdate.Mymethod: line 27, column 1
Trigger.addressontrigger: line 3, column 1: []
public class WorkOredrTriggerHelper {
    public static void helperMethod(list<SVMXC__Service_Order__c> WorkOrders){
        
        Map<Id,List<SVMXC__Service_Order_Line__c>> mapLine = new Map<Id,List<SVMXC__Service_Order_Line__c>>();
        List<SVMXC__Service_Order_Line__c> lineItems = new List<SVMXC__Service_Order_Line__c>();
        List<SVMXC__Service_Order_Line__c> lineItemsToUpdate = new List<SVMXC__Service_Order_Line__c>();
        
        lineItems = [select id, Status__c, SVMXC__Service_Order__c from  SVMXC__Service_Order_Line__c where SVMXC__Service_Order__c in :WorkOrders];
        
        
        for(SVMXC__Service_Order_Line__c asd : lineItems) {
            if(mapLine.containsKey(asd.SVMXC__Service_Order__c)){
                mapLine.get(asd.SVMXC__Service_Order__c).add(asd);
                continue;
            }
            mapLine.put(asd.SVMXC__Service_Order__c,new List<SVMXC__Service_Order_Line__c>{asd});
        }
        
        for(SVMXC__Service_Order__c wo : WorkOrders){
            if(wo.SVMXC__Order_Status__c == 'Closed' || wo.SVMXC__Order_Status__c == 'Completed'){
                if(mapLine.get(wo.Id) != null) {
                   boolean flag = false;
                   for(SVMXC__Service_Order_Line__c wd : mapLine.get(wo.Id)){
                        if(wd.Status__c=='open'){
                            flag = true;
                        }
                    }
                   if(flag == true) {
                       System.debug('222The work order cannot be closed since there are no associated work detail lines or the related work detail lines are open.');
                       wo.addError('The work order cannot be closed since there are no associated work detail lines or the related work detail lines are open.');
                   }
                }
                else {
                    System.debug('No items');
                       wo.addError('No line items');
                }
                    
               
            }
        }

    }
    
    public static void updateRelatedLines(list<SVMXC__Service_Order__c> WorkOrdersNew, Map<Id,SVMXC__Service_Order__c> WorkOrdersOld) {
        
        Map<Id,List<SVMXC__Service_Order_Line__c>> mapLine = new Map<Id,List<SVMXC__Service_Order_Line__c>>();
        List<SVMXC__Service_Order_Line__c> lineItems = new List<SVMXC__Service_Order_Line__c>();
        List<SVMXC__Service_Order_Line__c> lineItemsToUpdate = new List<SVMXC__Service_Order_Line__c>();
        List<SVMXC__Service_Order__c> workOrdersToUpdate = new List<SVMXC__Service_Order__c>();
        String closureStatus = '';
        Integer countLineItems;
        Map<Id,String> closureStatusMap = new Map<Id,String>();
        
        lineItems = [select id, Status__c, SVMXC__Service_Order__c, Work_order_status__c, SVMXC__Start_Date_and_Time__c, SVMXC__End_Date_and_Time__c  from  SVMXC__Service_Order_Line__c where SVMXC__Service_Order__c in :WorkOrdersNew];
                
        for(SVMXC__Service_Order_Line__c asd : lineItems) {
            if(mapLine.containsKey(asd.SVMXC__Service_Order__c)){
                mapLine.get(asd.SVMXC__Service_Order__c).add(asd);
                continue;
            }
            mapLine.put(asd.SVMXC__Service_Order__c,new List<SVMXC__Service_Order_Line__c>{asd});
        }
        
        for(SVMXC__Service_Order__c wo : WorkOrdersNew){
            closureStatus = '';
            countLineItems = 0;
            if(wo.SVMXC__Order_Status__c != WorkOrdersOld.get(wo.Id).SVMXC__Order_Status__c && wo.SVMXC__Order_Status__c == 'Closed'){
                for(SVMXC__Service_Order_Line__c wd : mapLine.get(wo.Id)){
                    countLineItems = countLineItems + 1;
                    SVMXC__Service_Order_Line__c newLineItem = new SVMXC__Service_Order_Line__c();
                    newLineItem.Id = wd.Id;
                    newLineItem.Work_order_status__c = 'Work Order is Closed';
                    lineItemsToUpdate.add(newLineItem);
                    closureStatus += 'Start time of WDL'+ countLineItems + ' : ' + wd.SVMXC__Start_Date_and_Time__c+'\n';
                    closureStatus += 'End Date time of WDL'+ countLineItems + ' : ' + wd.SVMXC__End_Date_and_Time__c+'\n'+'\n';
                }
                closureStatusMap.put(wo.Id, closureStatus);
                
            }
        }
        
        List<SVMXC__Service_Order__c> workOrders = [SELECT Id, closure_status__c from SVMXC__Service_Order__c where Id in :WorkOrdersNew];
        for(SVMXC__Service_Order__c workOrder : workOrders){
            workOrder.closure_status__c = closureStatusMap.get(workorder.Id);
            workOrdersToUpdate.add(workOrder);
        }
        
        if(lineItemsToUpdate != null && lineItemsToUpdate.size() > 0){
            update lineItemsToUpdate;
        }
        
        if(lineItemsToUpdate != null && lineItemsToUpdate.size() > 0){
            update workOrdersToUpdate;
        }
    }
    
    
    
    
}


trigger

trigger woTriggerrr on SVMXC__Service_Order__c (before insert, before update, after update, after insert) {
    if(trigger.isBefore && trigger.isupdate){
        system.debug('Inside new trigger'+ Trigger.new);
        WorkOredrTriggerHelper.helperMethod(trigger.new);
    }
    
    if(trigger.isAfter && trigger.isupdate){
        system.debug('Inside new trigger after update'+ Trigger.new);
        WorkOredrTriggerHelper.updateRelatedLines(trigger.new, trigger.oldMap);
    }
}
*Controller Class

public class ConOpptyRelatedToAccount 
{
     public ConOpptyRelatedToAccount(ApexPages.StandardController controller)
        {
        }
     public List<Contact> getContacts() 
    {
        
        List<Contact> con = [SELECT Id, FirstName, LastName, Title, Email FROM Contact WHERE AccountId=:apexpages.currentpage().getparameters().get('id')];
        return con;
    }
    
    public List<Opportunity> getOpportunities() 
    {
        
        List<Opportunity> Oppty = [SELECT Id, CloseDate, Amount, StageName, Name FROM Opportunity WHERE AccountId=:apexpages.currentpage().getparameters().get('id')];
        return Oppty;
    }
    
    public pagereference downLoad(){
        pagereference p = new pagereference('/apex/PDFofRelatedList');
        return p;
    }
  
}

******************************************************************************
*Vf page
<apex:page standardController="Account"  extensions="ConOpptyRelatedToAccount"  >
    <apex:form >
        
        <apex:pageBlock title="Contacts List" >
            
            <apex:pageBlockTable value="{!contacts }" var="Con">
                <apex:column value="{!Con.FirstName }"/>
                <apex:column value="{!Con.LastName }"/>
                <apex:column value="{!Con.Title }"/>
                <apex:column value="{!Con.Email }"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
        
        <apex:pageBlock title="Opportunity List" >
            <apex:pageBlockTable value="{!opportunities }" var="op">
                <apex:column value="{!op.Name }"/>
                <apex:column value="{!op.CloseDate }"/>
                <apex:column value="{!op.StageName }"/>
                <apex:column value="{!op.Amount }"/>
            </apex:pageBlockTable>
            
            <apex:pageBlockButtons location="Bottom">
                <apex:commandButton value="Download Pdf" action="{!downLoad}" />
            </apex:pageBlockButtons>
            
        </apex:pageBlock>
    </apex:form>
</apex:page>

I'm creating a custom lightning-datatable component. As part of it I can edit a field of type "Time". When I do though and click save, I get the following error: "alue for field 'Start_Time__c' is not in ISO 8601 format, Value: 1970-01-01T15:00:00.000Z, Runtime class: java.lang.String"

My save handler looks like this:

const fields = {};
         fields[ID_FIELD.fieldApiName] = event.detail.draftValues[0].Id;
         fields[START_TIME.fieldApiName] = event.detail.draftValues[0].Start_Time__c;

         const recordInput = {fields};
         
          updateRecord(recordInput).then(() => {
            this.dispatchEvent(
                new ShowToastEvent({
                    title: 'Success',
                    message: 'Contact updated',
                    variant: 'success'
                })
            );

            // Display fresh data in the datatable
            return refreshApex(this.agendaItems).then(() => {
                // Clear all draft values in the datatable
                this.draftValues = [];
            });
          }).catch(error => {
            this.dispatchEvent(
                new ShowToastEvent({
                    title: 'Error updating or reloading record',
                    message: error.body.message,
                    variant: 'error'
                })
            );
          });
This seems like it should be so simple, but I can't get it to work.

What should I be doing to the value I get from event.detail.draftValues[0].<Time field that was updated> when adding it to the list of fields to update?

How to put text over image in visualforce (contentType = "application) I'm with a vfp and generating it as .doc, but I'm not getting the image to be under a table, as if it were the table's background, whoever can give me any suggestions thanks, this was my last try
<style type="text/css" >
                @page Section1 {
                size:8.3in 11.7in;
                mso-title-page:yes;
                mso-footer:f1;
                mso-header:h1;
                mso-first-header: fh1;
                mso-first-footer: ff1;
                margin:0.0in 0.6in 0.0in 0.6in;
                mso-header-margin:0.3in;
                mso-footer-margin:0.3in;
                }
                div.Section1{ 
                page:Section1;
                }
                .capa{
                z-index: 0;
                background-image: 
                }
                .textcapa{
                z-index: 1;
                float: right;
                }
</style>
<apex:form >
<body>

 <div class="section1" >
                    <br/><br/>
                    <div>
                        <apex:image url="{!DocumentCapa}" width="650" height="550" styleClass="capa"/> 
                    </div>   
                </div>
                <table cellspacing="0" cellpadding="0" align="left" width="100%" border="0" class="textcapa">
                    <tr><td>Caxias do Sul, 
                        
                        <apex:outputText value="{0, date, d-MM-yyyy}">
                            <apex:param value="{!quoteObj.CreatedDate}"/>
                        </apex:outputText>
                        </td></tr>
                        </table>

the result I want looks like this:
the result I want looks like this:
I cannot get push notifications to fire in the console when a new Case is created.  It works for updated cases and create on other objects.