• Priya Mishra
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 34
    Questions
  • 31
    Replies
Hi All,

Any Developer who can help me for the some bugs to be fixed for my development i have stucked in some of the develoment bugs. 

Please ping me anyone can help i will explain the issues which i am facing in my development.
please reply to this i can connect to discuss futher

Thanx in Advance.
Hi All,

I have lightning button and my requrement is to create the invoice on click of that button there are already logics are written on that button so i am facing some challenges to create the invoice and invoice line item pls help me to achieve this functionality. 
thanks in advance.
Hi All,

I want to display the subject in the Html email Template with the merge field.
This is below added in the subject part 
Escalation: Work Order- {!MedConnect__Work_Order__c.Name} is awaiting acceptance.
Now my requirement is before Escalation verbaige i want to display priority field value with the lable.
If value is not present in the field field label and value should not display.
pls help me to complete this
Thanks in Advance.
Hi All,

For the below Visualforce email template there is a priority field which needs to populate from the field value and the condition is if the value in the priority field is present then it has to popualte in template if value in the field is blank then priority should not display.  pls guide me how to acheive this. 
Thanks in advance.

<messaging:emailTemplate subject="Priority: {!relatedto.Wo_Priority_MDSR__c}  Action Required: You have been assigned to Work Order '{!relatedTo.name}'" recipientType="User" relatedToType="MedConnect__Work_Order__c">
<messaging:htmlEmailBody >
Hi All,

I am facing cylomatic complexcity for the below code pls help me to resolve this it is urgent pls. Thanx In advance


Public static void createOrderandOrderlintiem(List<MedConnect__Repair_Installation_History__c> rAIHList)
{
 
 List<string> repairid = new List<string>();
 Integer count = 0;
 List<string> assiID= new List<string>();
 List<MedConnect__Inventory_Request_Order__c> orderList = new List<MedConnect__Inventory_Request_Order__c>();
 List<String> WOIDList = new List<String>();
 List<MedConnect__Inventory_Request_Order__c> insertorder= new List<MedConnect__Inventory_Request_Order__c>();
 List<MedConnect__Inventory_Order_Line_Item__c> insertorderLineItem= new List<MedConnect__Inventory_Order_Line_Item__c>();
 Map< Integer,MedConnect__Repair_Installation_History__c> repairMap =new Map< Integer,MedConnect__Repair_Installation_History__c>();
 for(MedConnect__Repair_Installation_History__c rh:[select id,Destination_Account__c,Serialized_Part__c,Destination_Inventory__c,Lot_Number_MDSR__r.name,Condition__c,MedConnect__Source_Inventory__c,Lot_Number_MDSR__c,Product_Description_MDSR__c,MedConnect__Operation__c,Return_Flag_MDSR__c,MedConnect__Install_Uninstall__c,MedConnect__Repair_Analysis_And_Parts_Used__r.MedConnect__Work_Order__c,MedConnect__Asset__c,MedConnect__Asset__r.MedConnect__Product__c,Serialized_Part__r.MedConnect__Product__c from MedConnect__Repair_Installation_History__c where id in :rAIHList]){
   if(rh.MedConnect__Operation__c =='Uninstall' && rh.Return_Flag_MDSR__c ==true)
   {
       count++;
     repairid.add(rh.MedConnect__Repair_Analysis_And_Parts_Used__c);
     repairMap.put(count,rh);
     WOIDList.add(rh.MedConnect__Repair_Analysis_And_Parts_Used__r.MedConnect__Work_Order__c);
     
   }
 }
    if(!repairid.isEmpty()){
    List<MedConnect__Inventory_Request_Order__c> InvRequestOrder = [SELECT Id,MedConnect__Account__c, Is_Bulk_Uninstall_from_UI__c,MedConnect__Work_Order__r.MedConnect__Account__c,MedConnect__Work_Order__c FROM MedConnect__Inventory_Request_Order__c
                                                                   WHERE MedConnect__Work_Order__c IN :WOIDList AND Is_Bulk_Uninstall_from_UI__c=true];
    if(!InvRequestOrder.isEmpty()){
        orderList.add(InvRequestOrder.get(0));
    }
    else{
        for(MedConnect__Work_Order__c WO : [SELECT id,MedConnect__Account__c FROM MedConnect__Work_Order__c WHERE ID IN :WOIDList]){
             MedConnect__Inventory_Request_Order__c order = new MedConnect__Inventory_Request_Order__c();
            order.MedConnect__Work_Order__c = WO.Id;
            order.MedConnect__Account__c= WO.MedConnect__Account__c;
            order.Is_Bulk_Uninstall_from_UI__c = true;
            insertorder.add(order);
            orderList.add(order);
        }
         if(insertorder.size()>0){
            Database.SaveResult[] results = Database.insert(insertorder, false);
             for(Database.SaveResult res : results){
                 if(res.isSuccess()){
                 }
             }
    }
    }
 
      //Inserting order line item
        while(count>0){
         MedConnect__Inventory_Order_Line_Item__c oli = new MedConnect__Inventory_Order_Line_Item__c();
          oli.MedConnect__Order_Line_Type__c='Exchange In';
         // oli.MedConnect__Inventory_Request_Order__c=insertorder[0].Id;
          oli.MedConnect__Asset__c=repairMap.get(count).Serialized_Part__c;
          oli.MedConnect__Inventory_Request_Order__c = orderList.get(0).Id;
          oli.MedConnect__Product__c = repairMap.get(count).Serialized_Part__r.MedConnect__Product__c;
          oli.Lot_Batch_MDSR__c = repairMap.get(count).Lot_Number_MDSR__r.name;
          oli.MedConnect__Source_Inventory__c = repairMap.get(count).Destination_Inventory__c;
          oli.MedConnect__Source_Account__c = repairMap.get(count).Destination_Account__c;
           oli.MedConnect__Condition_Source__c = repairMap.get(count).Condition__c;
           
            insertorderLineItem.add(oli);
           count--;
        }
     
      if(insertorderLineItem.size()>0){
     try{
      Database.SaveResult[] results = Database.insert(insertorderLineItem, false);
             for(Database.SaveResult res : results){
                 if(res.isSuccess()){
                 }
             }
        }  
        catch(DMLException e){
       
      }
      }
    }
}
 
Hi All,

I Have a requirment to  auto create the record when when meeting certain condtion with specified values.

1. Create new order with the order line item type='exchange In'  condtion is there is a retun required field is is true.
2.In created order fileds should populate are Account (coming from thre work order object), Work Order from word order object.
3. Created Order Line Item with some fields like product from Asset 
Asset from Repair history object.

How we can acheive this is that flow will work here or coding we have to do or is there other way to do this. pls guide me its an urgent work.

Thanks in advance.
Hi All,

I have to display the fields based on the piclist selected value using lightning component.
example:" Patient envolvment" (picklist) is selected as yes it has to display the some fields like date, Additional contact Name and so on and when  " Patient envolvment" is no fields should hide. and once data is filled in the fields record should be created.
pls guide me how we can create in the lightning component.
this is bit urgent.
Thanks in advance.
Hi All,

Can you please tell me how can i write a condtion on this rule.

Condition: If Work order object's field which is product object's field Operation company is having perticular value or not. if it is having perticualr value then only validation needs to run otherwise no.

Rule :AND(ISNEW(), ISBLANK( TEXT( Patient_Involvement1_MDSR__c) ),ISBLANK(  TEXT(System_Malfunction_Deficiency1_MDSR__c ) ) )

needs to add the condition in this rule itself.
This is urgent pls.

Thnaks in advance.
I have a requirement  To develop timesheet application theses are the below sample screen which i have to develop this in lightning.

I have 3 objects contact,Timesheet,Absence.

when click on submit timesheet button quick action should display like below image.

User-added image

ejactly same UI should be and this data should fetch dynamically from contact record.
Hello all,

Need help to complete the test  class for the below class it has completed 52% now covering the create case but it is not covering.
please help me to complete this. 

Thanks in advance

Apex class:



public class CallDetailsController_LWCApex {
    
    @AuraEnabled(cacheable = true)
    public static Contact findContacts(String contactId) {
        return [SELECT FirstName,LastName,UserName__c,BusinessName__c,EIN__c,MobilePhone,Phone,Country__c,State__c,
               Email,Caller_Name__c,Caller_Phone__c FROM contact WHERE id =: contactId LIMIT 1];
    }
    
    @AuraEnabled
    public static void saveRequest(Call_Log__c Call,String contactId) {
        if(Call != NULL) {
            Contact newCon;
            if(Call.Select_User_Type__c == 'New User') {   
                 newCon = new Contact();
                newCon.FirstName = Call.First_Name__c;
                newCon.LastName = Call.Last_Name__c;
                newCon.UserName__c = Call.UserNameNew__c;
                newCon.BusinessName__c = Call.BusinessName__c;
                newCon.EIN__c = Call.EIN__c;
                newCon.MobilePhone = Call.CellPhone__c;
                newCon.Phone = Call.Phone_number__c;
                newCon.Email=Call.Email__c;
                newCon.Caller_Name__c=Call.Caller_Name_new__c;
                newCon.Caller_Phone__c=Call.Caller_Phone_new__c;
                newCon.Country__c = Call.Country__c;
                newCon.State__c = Call.State__c;
                try {
                     insert newCon;
                    
                }Catch(Exception e){
                     throw new AuraHandledException(e.getMessage());
                }      
            }
            
            //Create Call log;
            String callRecordTypeId  = Schema.getGlobalDescribe().get('Call_Log__c').getDescribe().getRecordTypeInfosByName().get(Call.Call_Type__c).getRecordTypeId();
            Call.RecordTypeId = callRecordTypeId;
            Call.Status__c ='New'; 
            
           /* if(String.isNotBlank(contactId) && Call.Select_User_Type__c != 'New User'){
                Call.Id = [SELECT Id FROM Call_Log__c WHERE Caller_Phone__c =:contactId LIMIT 1].Id;
            }
            else*/ if(newCon != NULL && newCon.Id != NULL) {
                 Call.Caller_Phone__c = newCon.Id;                
            }      
            try {
                insert Call;
            }Catch(Exception e){
                throw new AuraHandledException(e.getMessage());
            } 
            //Create Case
            Case newCase = new Case();        
            if(Call.Is_Follow_up_Required__c  == 'Yes') 
            {
                newCase.Status    = 'New';
                newCase.Subject = 'A new Inbound Case has been created';
                
                if(Call.Call_Type__c == 'Inbound')
                {
                    newCase.Subject = 'A new Inbound Case has been created';
                }
                else if (Call.Call_Type__c == 'Outbound')
                {
                    newCase.Subject = 'A new Outbound Case has been created';
                }
                
                else if (Call.Call_Type__c == 'Bulk Followup Upload')
                {
                    newCase.Subject = 'A new Followup Case has been created';
                }           
                else
                {
                    newCase.Subject = 'A new Follow Up Case has been created';
                }
            }        
            else{            
                newCase.Status = 'closed';
                newCase.Subject = 'A Case has been created';
            }        
            newCase.Assign_too__c= Call.Assign_too__c;
            newCase.Form_Type__c = Call.Form_Type__c;
            newCase.Purpose_of_the_Call__c = Call.Purpose_of_the_Call__c;
            newCase.Call_Deposition__c = Call.Call_Deposition__c;
            newCase.Remark_Comment__c = Call.Remark_Comment__c;
            newCase.Tax_Products__c = Call.Id;
            newCase.Created_By__c = Call.CreatedById;
            newCase.UserId__c = Call.UserNameNew__c;
            newCase.Phone__c =Call.Phone_number__c;
            if(newCon != NULL && newCon.Id != NULL)
                newCase.ContactId = newCon.Id;
            //   newCase.Ticket_Number__c = Call.Ticket_Number__c;
            try {
                insert newCase;
            }Catch(Exception e){
                throw new AuraHandledException(e.getMessage());
            } 
        }
    }
}.
Hello All,

I am having a apex class which is uploading the data to a custom object via csv file through vf page. 

I am checking a column into the csv file if it is valid only it has to insert the data but since it is coming into the for loop i am facing 101 error. please suggest me how to correct the code so that we this error can be avoid.

My code:

public class importDataFromCSVController {

public transient Blob csvFileBody{get;set;}
public string csvAsString{get;set;}
public String[] csvFileLines{get;set;}
public transient List<Call_Log__c> acclist{get;set;}
List<String> failedLines;
Public Call_Log__c Call{get;set;}
public Integer totalunsuccessrec { get; set; }
public Integer totalsuccessrec { get; set; }
public string upload_err_msg{get; set;}
List<String> rows;
public String usernamelable {get;set;}
public integer totalrecords { get; set; }
public String fileName { get; set; }

   public importDataFromCSVController(){
    upload_err_msg='';
    csvFileLines = new String[]{};
    acclist = New List<Call_Log__c>(); 
    usernamelable = apexpages.currentpage().getparameters().get('att');
  }
  
  
 /**This function checks the validations in the vf page for the csv file. **/ 
  public PageReference importCSVFile(){
  
  
   acclist= new list<Call_Log__c >();
        failedlines = new list<string>();
        rows = new list<string>();  
        
        totalrecords =0;
        totalsuccessrec = 0;
        totalunsuccessrec = 0;
        
        try
        {
       
        if(csvFileBody!=null)
        {
            fileName = csvAsString;
           // csvAsString= csvAsString.toString();
            System.debug('csvAsString'+csvAsString);
                      
          //Convert the uploaded file which is in BLOB format into a string
            csvAsString = blobToString( csvFileBody,'ISO-8859-1');
           
          //Now sepatate every row of the csv file   
            csvFileLines = csvAsString.split('\n'); 
            
        }
                
        else{

            ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.ERROR, 'Please choose a file to upload !'));
            return null;
        }

            acclist= uploadprocess();

        System.debug('aftrlist'+acclist);
            
        }
        
        Catch(Exception e)
        {     
            System.debug('e.getCause'+e.getCause());
            System.debug('e.getLinenumber'+e.getLinenumber());
            System.debug('e.getMessage'+e.getMessage());
            
            ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.Error,'The data in the file you have attempted to upload is not in the correct format and therefore did not upload successfully.'+'Cause:'+ e.getCause()+ 'Line:' +e.getLinenumber()+'  '+ 'Error Message:'+ '   ' + e.getMessage() );
            ApexPages.addMessage(errormsg);    
        }  
        
        System.debug('befsrlist'+acclist);
        Database.SaveResult[] srList ;                  
        if(acclist!=Null) {
        totalrecords = acclist.size(); 
        srList   = Database.insert(acclist, false);
        
        System.debug('srList'+srList);
        }
        
        if(srList!=Null){
        for(Database.SaveResult sr: srList)
        {
            if(!sr.IsSuccess())
            {    
                for(Database.Error err : sr.getErrors())
                {
                     ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.Error,'An error has occured while importing data Please make sure input csv file is correct.');
                     ApexPages.addMessage(errorMessage);      
                }
            }
        }           
       } 
        return null;  
    }
   
   
   
 /**This function reads the CSV file and inserts records into the calllog object. **/     
     public list<Call_Log__c > uploadprocess()
    {
    
     Integer counter = 1; 
        
    
              for(Integer i=1;i<csvFileLines.size();i++){
           
              Call_Log__c accObj = new Call_Log__c() ;
               
               accObj.Is_Bulk_Follow_up_Upload__c=true;
               accObj.Uploaded_By__c = usernamelable;
               accObj.Status__c='New';
               
               accObj.recordtypeid=label.Followuprecordtyopype;
               string[] csvRecordData = csvFileLines[i].split(',');
               
               
           //Mapping the Csv header with the fields.     
           
         //   List<Login__c> loginlist=[select Id,UserName__c from Login__c where UserName__c=:csvRecordData[23]];
           
          //  System.debug('Records on List are '+loginlist);
               
         //  if(loginlist.size()>0)
           
         //  {
               
               accObj.UserNameNew__c=csvRecordData[0];
               accObj.BusinessName__c=csvRecordData[1];
               accObj.EIN__c= csvRecordData[2];
               accObj.Phone_number__c= csvRecordData[3];
               accObj.CellPhone__c= csvRecordData[4];
               accObj.SA_Name__c= csvRecordData[5];
               accObj.First_Name__c= csvRecordData[6] ; 
               accObj.Last_Name__c= csvRecordData[7];  
               accObj.Email__c= csvRecordData[8];        
               accObj.Return_ID__c=csvRecordData[9];
               accObj.SKU__c=csvRecordData[10];
               accObj.Form_Type__c=csvRecordData[11];
               Datetime myDateTime = DateTime.valueof(csvRecordData[12]);
               String dtConverted = myDateTime.format('yyyy-MM-dd hh:mm:ss');
               accObj.Paid_Date__c= Datetime.valueof(dtConverted);
               accObj.Paid_Amount__c=csvRecordData[13];      
               Datetime myDateTim = DateTime.valueof(csvRecordData[14]);
               String dtConverte = myDateTim.format('yyyy-MM-dd hh:mm:ss');
               accObj.Registered_Date__c= Datetime.valueof(dtConverte);    
               accObj.Address__c=csvRecordData[15];
               accObj.City__c= csvRecordData[16]; 
               accObj.State__c = csvRecordData[17];
               accObj.Zip__c= csvRecordData[18];
               accObj.Country__c= csvRecordData[19];
               accObj.Time_Zone__c=(csvRecordData[20]);
               accObj.Others__c= csvRecordData[21];
               accObj.followup_type__c=csvRecordData[22];
                accObj.Assign__c= csvRecordData[23];
              
             
                                                                                       
               acclist.add(accObj);
               
              //}
               
               
               //else {
               // accObj.addError('Usename is not available Please provide the Correct Username');
               
              // }
             totalsuccessrec++;
              totalunsuccessrec++;
             
           }
            

            //Finally, insert the collected records
          //Database.insert(acclist,false);
          
             insert acclist;
             
                
       counter++; 
     System.debug('this has ' + acclist.size() + ' records total.');
     
     return null;
    
      } 
      
   
  
   /**
         This function convers the input CSV file in BLOB format into a string
        @param input    Blob data representing correct string in @inCharset encoding
        @param inCharset    encoding of the Blob data (for example 'ISO 8859-1')
     */
  
  public static String blobToString(Blob input, String inCharset){
        String hex = EncodingUtil.convertToHex(input);
        System.assertEquals(0, hex.length() & 1);
        final Integer bytesCount = hex.length() >> 1;
        String[] bytes = new String[bytesCount];
        for(Integer i = 0; i < bytesCount; ++i)
        bytes[i] =  hex.mid(i << 1, 2);
        return EncodingUtil.urlDecode('%' + String.join(bytes, '%'), inCharset);
    }
 
 
 
   public PageReference getViewrequest() 
    {
        pagereference ref4 = new pagereference('/apex/View_Request_Admin?att='+usernamelable);
        return ref4;
    }


    public String getFollowups() {
        return null;
    }


    public PageReference getReport() 
    {
     pagereference ref= new pagereference('/apex/TaxReport?att='+usernamelable ); 
     return ref;
        
    }


    public PageReference getCalllog() 
    {
         pagereference ref1= new pagereference('/apex/CallDetailsDashboard?att='+usernamelable);
        return ref1;
    }


    public PageReference getAddmembaer() 
    {
        pagereference ref3= new pagereference('/apex/Add_Member_Page?att='+usernamelable);
        return ref3;
    }


    public PageReference getProfile() 
    {
        pagereference ref2= new pagereference('/apex/Tax_Admin_Profile?att='+usernamelable);
        return ref2; 
    }

    public PageReference getUsers() 
    {
        pagereference ref5= new pagereference('/apex/Tax_View_Users_Admin?att='+usernamelable);
        return ref5; 
    }
    
    public PageReference getTicket() 
    {
         pagereference ref6= new pagereference('/apex/Tickets_Tax_Admin?att='+usernamelable);
        return ref6; 
    }

}User-added imagesee the image where i am facing the problem. this is the below code where i ma facing.


 //   List<Login__c> loginlist=[select Id,UserName__c from Login__c where UserName__c=:csvRecordData[23]];
           
          //  System.debug('Records on List are '+loginlist);
               
         //  if(loginlist.size()>0)
           


 
I have two obejct call log and login when i am inserting the data into the call log object using the csv upload i have a field called username we are inserting this field data from the csv file but before insertion this
username field data has to be validated if this username is matched with the login data it has to insert the record otherwise error to be display.

i have written a validation on the username field like below but this is giving the error for the condtion if username is correct also it is showing error.

Assign__c <> $ObjectType.Login__c.Fields.UserName__c

Assign__c  = field to be validate in the call log obejct
UserName__c  = field in the login obejct.

please help me here.

thanks in advance.
 
Hi All,

This is very urgent help.

I Have to insert the record from the visualforce page from a csv file  to the custom object called call_log and check all the valid calidations like if csv file is empty or not having the valid columns and after upload if any error is there need to export the error in the excel file. how to do this please help me witht the sample apex logic for this requirement.

Regards,
Priya Mishra
Hi All,

My requirement is to Uplaod the csv file through the vf page to custom object and the file header should be read the value which are saved in a custom object. like dynamic uplaod via vf page. please help me with the sample code.

Thanks in advance.
priya
I Have field call EIN(number type) it has to accept the 12-1234567  formate only means beginning 2 digit dash seven digit only. 

how to write the logic in apex to show the error on the vf page itself please help me out.

thanks in advance.
Hello All,

I need to insert the record in the custom object based on the record type selected in the vf page. please help me with sample code.

thanks in advance.
Hello Everyone,

I have to create  the record in a custom object and case and contact object based on the value selected in vf page.
find the screen shotUser-added image
when we select new user it has to create the record for the custom object and at the same time in the case and contact object. please help me out for this requirement.
please help me out with the sample code.
thanks in advance.

 
Hi All,

While autherise the org in Visual studio code i am faicng this error can you pleae help me to resolve this error.

i have insatalled CLI and set the envirnment variable.
insatlled salesforce extension pack as well but still not able to autherise with the below error.

error:


{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'login.salesforce.com/services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=9e27549e3106^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=REjVPthgj4hOKjTa7-qA4rKI7FnBThJ4cC26UdmoYI4' ] }
Hello Everyone,

In My org a user is facing a issue like below:
 please look into why I no longer receive KA expiration notifications? I own several KAs with expiration dates in March and April, and have not received any expiration notifications since February.

I am trying to check why the user is not reciving the email can anyone suggest me how can i check why this user is not receiving the email.
suggestions will be helpful to find the root cause.

Thanks.  
Please help me out to insert the data in perticular record type of an object using workbench. 

Thanks in advance.
Hi All,

Any Developer who can help me for the some bugs to be fixed for my development i have stucked in some of the develoment bugs. 

Please ping me anyone can help i will explain the issues which i am facing in my development.
please reply to this i can connect to discuss futher

Thanx in Advance.
Hi All,

For the below Visualforce email template there is a priority field which needs to populate from the field value and the condition is if the value in the priority field is present then it has to popualte in template if value in the field is blank then priority should not display.  pls guide me how to acheive this. 
Thanks in advance.

<messaging:emailTemplate subject="Priority: {!relatedto.Wo_Priority_MDSR__c}  Action Required: You have been assigned to Work Order '{!relatedTo.name}'" recipientType="User" relatedToType="MedConnect__Work_Order__c">
<messaging:htmlEmailBody >
Hi All,

I am facing cylomatic complexcity for the below code pls help me to resolve this it is urgent pls. Thanx In advance


Public static void createOrderandOrderlintiem(List<MedConnect__Repair_Installation_History__c> rAIHList)
{
 
 List<string> repairid = new List<string>();
 Integer count = 0;
 List<string> assiID= new List<string>();
 List<MedConnect__Inventory_Request_Order__c> orderList = new List<MedConnect__Inventory_Request_Order__c>();
 List<String> WOIDList = new List<String>();
 List<MedConnect__Inventory_Request_Order__c> insertorder= new List<MedConnect__Inventory_Request_Order__c>();
 List<MedConnect__Inventory_Order_Line_Item__c> insertorderLineItem= new List<MedConnect__Inventory_Order_Line_Item__c>();
 Map< Integer,MedConnect__Repair_Installation_History__c> repairMap =new Map< Integer,MedConnect__Repair_Installation_History__c>();
 for(MedConnect__Repair_Installation_History__c rh:[select id,Destination_Account__c,Serialized_Part__c,Destination_Inventory__c,Lot_Number_MDSR__r.name,Condition__c,MedConnect__Source_Inventory__c,Lot_Number_MDSR__c,Product_Description_MDSR__c,MedConnect__Operation__c,Return_Flag_MDSR__c,MedConnect__Install_Uninstall__c,MedConnect__Repair_Analysis_And_Parts_Used__r.MedConnect__Work_Order__c,MedConnect__Asset__c,MedConnect__Asset__r.MedConnect__Product__c,Serialized_Part__r.MedConnect__Product__c from MedConnect__Repair_Installation_History__c where id in :rAIHList]){
   if(rh.MedConnect__Operation__c =='Uninstall' && rh.Return_Flag_MDSR__c ==true)
   {
       count++;
     repairid.add(rh.MedConnect__Repair_Analysis_And_Parts_Used__c);
     repairMap.put(count,rh);
     WOIDList.add(rh.MedConnect__Repair_Analysis_And_Parts_Used__r.MedConnect__Work_Order__c);
     
   }
 }
    if(!repairid.isEmpty()){
    List<MedConnect__Inventory_Request_Order__c> InvRequestOrder = [SELECT Id,MedConnect__Account__c, Is_Bulk_Uninstall_from_UI__c,MedConnect__Work_Order__r.MedConnect__Account__c,MedConnect__Work_Order__c FROM MedConnect__Inventory_Request_Order__c
                                                                   WHERE MedConnect__Work_Order__c IN :WOIDList AND Is_Bulk_Uninstall_from_UI__c=true];
    if(!InvRequestOrder.isEmpty()){
        orderList.add(InvRequestOrder.get(0));
    }
    else{
        for(MedConnect__Work_Order__c WO : [SELECT id,MedConnect__Account__c FROM MedConnect__Work_Order__c WHERE ID IN :WOIDList]){
             MedConnect__Inventory_Request_Order__c order = new MedConnect__Inventory_Request_Order__c();
            order.MedConnect__Work_Order__c = WO.Id;
            order.MedConnect__Account__c= WO.MedConnect__Account__c;
            order.Is_Bulk_Uninstall_from_UI__c = true;
            insertorder.add(order);
            orderList.add(order);
        }
         if(insertorder.size()>0){
            Database.SaveResult[] results = Database.insert(insertorder, false);
             for(Database.SaveResult res : results){
                 if(res.isSuccess()){
                 }
             }
    }
    }
 
      //Inserting order line item
        while(count>0){
         MedConnect__Inventory_Order_Line_Item__c oli = new MedConnect__Inventory_Order_Line_Item__c();
          oli.MedConnect__Order_Line_Type__c='Exchange In';
         // oli.MedConnect__Inventory_Request_Order__c=insertorder[0].Id;
          oli.MedConnect__Asset__c=repairMap.get(count).Serialized_Part__c;
          oli.MedConnect__Inventory_Request_Order__c = orderList.get(0).Id;
          oli.MedConnect__Product__c = repairMap.get(count).Serialized_Part__r.MedConnect__Product__c;
          oli.Lot_Batch_MDSR__c = repairMap.get(count).Lot_Number_MDSR__r.name;
          oli.MedConnect__Source_Inventory__c = repairMap.get(count).Destination_Inventory__c;
          oli.MedConnect__Source_Account__c = repairMap.get(count).Destination_Account__c;
           oli.MedConnect__Condition_Source__c = repairMap.get(count).Condition__c;
           
            insertorderLineItem.add(oli);
           count--;
        }
     
      if(insertorderLineItem.size()>0){
     try{
      Database.SaveResult[] results = Database.insert(insertorderLineItem, false);
             for(Database.SaveResult res : results){
                 if(res.isSuccess()){
                 }
             }
        }  
        catch(DMLException e){
       
      }
      }
    }
}
 
Hi All,

Can you please tell me how can i write a condtion on this rule.

Condition: If Work order object's field which is product object's field Operation company is having perticular value or not. if it is having perticualr value then only validation needs to run otherwise no.

Rule :AND(ISNEW(), ISBLANK( TEXT( Patient_Involvement1_MDSR__c) ),ISBLANK(  TEXT(System_Malfunction_Deficiency1_MDSR__c ) ) )

needs to add the condition in this rule itself.
This is urgent pls.

Thnaks in advance.
Hello all,

Need help to complete the test  class for the below class it has completed 52% now covering the create case but it is not covering.
please help me to complete this. 

Thanks in advance

Apex class:



public class CallDetailsController_LWCApex {
    
    @AuraEnabled(cacheable = true)
    public static Contact findContacts(String contactId) {
        return [SELECT FirstName,LastName,UserName__c,BusinessName__c,EIN__c,MobilePhone,Phone,Country__c,State__c,
               Email,Caller_Name__c,Caller_Phone__c FROM contact WHERE id =: contactId LIMIT 1];
    }
    
    @AuraEnabled
    public static void saveRequest(Call_Log__c Call,String contactId) {
        if(Call != NULL) {
            Contact newCon;
            if(Call.Select_User_Type__c == 'New User') {   
                 newCon = new Contact();
                newCon.FirstName = Call.First_Name__c;
                newCon.LastName = Call.Last_Name__c;
                newCon.UserName__c = Call.UserNameNew__c;
                newCon.BusinessName__c = Call.BusinessName__c;
                newCon.EIN__c = Call.EIN__c;
                newCon.MobilePhone = Call.CellPhone__c;
                newCon.Phone = Call.Phone_number__c;
                newCon.Email=Call.Email__c;
                newCon.Caller_Name__c=Call.Caller_Name_new__c;
                newCon.Caller_Phone__c=Call.Caller_Phone_new__c;
                newCon.Country__c = Call.Country__c;
                newCon.State__c = Call.State__c;
                try {
                     insert newCon;
                    
                }Catch(Exception e){
                     throw new AuraHandledException(e.getMessage());
                }      
            }
            
            //Create Call log;
            String callRecordTypeId  = Schema.getGlobalDescribe().get('Call_Log__c').getDescribe().getRecordTypeInfosByName().get(Call.Call_Type__c).getRecordTypeId();
            Call.RecordTypeId = callRecordTypeId;
            Call.Status__c ='New'; 
            
           /* if(String.isNotBlank(contactId) && Call.Select_User_Type__c != 'New User'){
                Call.Id = [SELECT Id FROM Call_Log__c WHERE Caller_Phone__c =:contactId LIMIT 1].Id;
            }
            else*/ if(newCon != NULL && newCon.Id != NULL) {
                 Call.Caller_Phone__c = newCon.Id;                
            }      
            try {
                insert Call;
            }Catch(Exception e){
                throw new AuraHandledException(e.getMessage());
            } 
            //Create Case
            Case newCase = new Case();        
            if(Call.Is_Follow_up_Required__c  == 'Yes') 
            {
                newCase.Status    = 'New';
                newCase.Subject = 'A new Inbound Case has been created';
                
                if(Call.Call_Type__c == 'Inbound')
                {
                    newCase.Subject = 'A new Inbound Case has been created';
                }
                else if (Call.Call_Type__c == 'Outbound')
                {
                    newCase.Subject = 'A new Outbound Case has been created';
                }
                
                else if (Call.Call_Type__c == 'Bulk Followup Upload')
                {
                    newCase.Subject = 'A new Followup Case has been created';
                }           
                else
                {
                    newCase.Subject = 'A new Follow Up Case has been created';
                }
            }        
            else{            
                newCase.Status = 'closed';
                newCase.Subject = 'A Case has been created';
            }        
            newCase.Assign_too__c= Call.Assign_too__c;
            newCase.Form_Type__c = Call.Form_Type__c;
            newCase.Purpose_of_the_Call__c = Call.Purpose_of_the_Call__c;
            newCase.Call_Deposition__c = Call.Call_Deposition__c;
            newCase.Remark_Comment__c = Call.Remark_Comment__c;
            newCase.Tax_Products__c = Call.Id;
            newCase.Created_By__c = Call.CreatedById;
            newCase.UserId__c = Call.UserNameNew__c;
            newCase.Phone__c =Call.Phone_number__c;
            if(newCon != NULL && newCon.Id != NULL)
                newCase.ContactId = newCon.Id;
            //   newCase.Ticket_Number__c = Call.Ticket_Number__c;
            try {
                insert newCase;
            }Catch(Exception e){
                throw new AuraHandledException(e.getMessage());
            } 
        }
    }
}.
Hi All,

This is very urgent help.

I Have to insert the record from the visualforce page from a csv file  to the custom object called call_log and check all the valid calidations like if csv file is empty or not having the valid columns and after upload if any error is there need to export the error in the excel file. how to do this please help me witht the sample apex logic for this requirement.

Regards,
Priya Mishra
Hi All,

My requirement is to Uplaod the csv file through the vf page to custom object and the file header should be read the value which are saved in a custom object. like dynamic uplaod via vf page. please help me with the sample code.

Thanks in advance.
priya
Hi All,

While autherise the org in Visual studio code i am faicng this error can you pleae help me to resolve this error.

i have insatalled CLI and set the envirnment variable.
insatlled salesforce extension pack as well but still not able to autherise with the below error.

error:


{ Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs:
   [ '/c',
     'start',
     '""',
     '/b',
     'login.salesforce.com/services/oauth2/authorize?response_type=code^&client_id=PlatformCLI^&redirect_uri=http%3A%2F%2Flocalhost%3A1717%2FOauthRedirect^&state=9e27549e3106^&prompt=login^&scope=refresh_token%20api%20web^&code_challenge=REjVPthgj4hOKjTa7-qA4rKI7FnBThJ4cC26UdmoYI4' ] }
Hello Everyone,

In My org a user is facing a issue like below:
 please look into why I no longer receive KA expiration notifications? I own several KAs with expiration dates in March and April, and have not received any expiration notifications since February.

I am trying to check why the user is not reciving the email can anyone suggest me how can i check why this user is not receiving the email.
suggestions will be helpful to find the root cause.

Thanks.  
Hi All,

I have a date input field called 'Passport Issuance Date' and the formate for the date is mm/dd/yy so i want to show the error on the vf page itself if the  date entered in the field is in the formate of dd/mm/yy.

Thanks in advance.
Hi All,
 
I am working in salesfroce past 3.5 years in this time period i have changed two companies 
 because in my first company they hired for salesforce developer but they have just assinged 
 some salesforce admin related tasks and excel related work and for 1.5 years i was working with the 
 company but i have seen that no learning no proper work so i decieded to 
 leave the company and search for the good work on salesforce itself fortunatily 
 i have got job also in a company. in this company i thought i will get good exposer 
 and work and learning as well but bad luck again the same kind of data realted work in salesforce
 no live developemnet project experience and no growth. now aagin i am trying for the 
 another job where i can have live project developemnet experience but now when i attaned the interview 
 with 3+ years experience they ask everything related to developemnet coding and live project realted questions 
 so because of lack of real time project experience i am getting stuck in interview.
 please suggest me how i can move on to my carier and inhance my technical experience to get the job in MNCs. Duw to some personal problem i have to get the job ASAP.

In Account object we have a field called opportunity status and in opportunity object we have a field called 
Stage so when stage value will change the new value should display in the 
Account object field called opportunity status using trigger.
I have an inputFile field that the user can upload a file into (in this case, we are only using CSV files)
<apex:inputFile id="csvfield" value="" />

In the Javascript, I try to reference the uploaded CSV:
var csvfile = document.getElementById('{!$Component.csvform:out:csvfield}').value;
However, I'm not able to work with it because I'm not getting a Blob, but a String. 

How can I make csvfile be the Blob uploaded?

I currently have an Email Alert setup as the output from a Workflow when a new record is created. This is all working fine.

 

However, I would like to be able to change the 'from' email address.

 

When I edit the Email Alert, the only option I have is 'Current User's Email Address'

 

This results in the from email being...

no-reply@salesforce.com on behalf of MyName [ my_email_address ]

 

Ideally I would like this to be 'no-reply@my_company_domain'