• Priyesh Misquith 12
  • NEWBIE
  • 120 Points
  • Member since 2018

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 18
    Replies
how to see standard sobject created records. Please explain step by step
I have JSON in below format and passing to the apex class from QCP through JavaScript. I am getting following error JSON_PARSER_ERROR : JSON request body must be an object at [Line 1, column2]. I am not able to figure out what is going wrong here.
 
const PATH = "/services/apexrest/pricing/";
export function onAfterCalculate(quote, lines, conn) {
 var body='{
     "billingCountry":"United States",
     "accountType":"Executive Account",
     "salesPrice":100,
     "quotelines":[
                   {
                   "quoteNumber":"01233365564idf",
                   "lineType":"Initial",
                   "quantity":400,
                   "producttype":"support"
                   },
                   {
                   "quoteNumber":"1234365564idf",
                   "lineType":"Final",
                   "quantity":1500,
                   "producttype":"Hardware"
                    }
                   ]
      }'

      const baseUrl = conn.instanceUrl + PATH;
      const url = baseUrl.replace("--sbqq.visualforce", ".my.salesforce");
    
      console.log(`URL: ${url}`);
      console.log("Request Body: ");
      console.log(body);
    
      return conn
        .requestPost(url, body)
        .then(res => {
          // Parse the response
          const priceResponse = JSON.parse(res);
        })
        .catch(err => {
          // catch any errors
          console.log("External Pricing Error", err);
        });  
    
    }

I have the apex controller
 
@RestResource(urlMapping='/pricing/*')
global class calloutClass{

   global class jsonFields{
   global string billingCountry;
   global string accountType;
   global Decimal salesPrice;
   global list<lineClass> quotelines;
}
global class lineClass{

 global string quoteNumber;
 global string lineType;
 global integer quantity;
 global string producttype;
 }

@Httppost
global static string sendQuotedetails(List<jsonFields> quotebody){
 // callout done from here
}
    }

also tried with
@Httppost
global static string sendQuotedetails(String quotebody){
 // callout done from here
}
    }

Nothing has resolved the issue.
Hello,

How to send a mail to the group of user of the different region in their local language. I want the header and full email body to be in the local language.The mail will be sent from the batch apex.

Thanks.
How to Convert List<List<Cases> to List<Case>
 
@InvocableMethod
    public static void CaseAssign(List<List<Case>> lstCase) {
    List<Case> Cases=[select id from case where case.id in :lstCase];
    List<case> caseupdate = new List<case>();
      for(case cc : Cases){
          Database.DMLOptions dmo = new Database.DMLOptions();
    	 dmo.assignmentRuleHeader.useDefaultRule= true; 
         cc.setOptions(dmo);
         caseupdate.add(cc);
      }
    update caseupdate;
    }

 
I have a Object CPQ Quote. I want to set up the advance approval where the first approval should be sales manager . later there will be parallel approval like Finance , legal etc . under the finance, legal there are level upprovers which should be fired in the Serial.
the below diagram shows how the advance aproval should fire.

can anybody guide me how can this be build using advanced approvel.
Advanced approval flow
I have the Scenario  when the Opportunity(parent) is updated . i need to get the value of old price and new price of each line item (child).and conpare those values and perform the some task.

How can i get the old value of the line item(child) and new value(child) of line item price.

the trigget should run parent object
Hi,

I have a following map
map<String , Fruits__c> mapFruits = new map<String , Fruits__c>();
where Key is name of the fruit and  value is detail regarding fruit like color , taste etc.

Now i want to query on a different object called Tree__c based on key and values of this map mapFruits
List <tree__c> trees = [select region, name of the trees where fruitName = Should be the Key of the map and fruitTaste = field taste from the values of map and fruitColour ='field color from the values of map']

I am trying to avoid query inside the for loop.
There should be Button on the Opportunity detail page.
On click of the Button a custom modal should be Open and should display a details from the custom_Object_c using query from apex controller.

 
I have the list of line item from Opportuntiy
List<products__c> allProducts = [select id, name, quantity__c, price__c ,totalPrice__c from products  where id:= parentOppIdid];

In the above list i am having  multiple  product with same name and  
i want to combine the similar product as one ie combinig the similar product and adding the quantity__c ,totalPrice__c for productlineitem.

suppose list has
name=apple, quantity__c=2 , price__c= 20 , totalPrice__c = 40
name = watermelon , quantity__c=1 , price__c = 10 , totalPrice__c = 10
name = apple , quantity__c=3 , price__c = 20 , totalPrice__c = 60

I need a single list like

name = apple , quantity__c = 5 , price__c = 20 ,totalPrice__c = 100
name = watermelon , quantity__c=1 , price__c = 10 , totalPrice__c = 10

 
I have the secnario where there are multiple visualforce component.

<apex: page renderAs='pdf'>
<c:componentA />
<c:componentB />
<c:componentC />
</apex: page >

when the field value in Opportunity  field__c = Apple
i want to download the pdf containing the details of   componentA and ComponentB on the click of the button
when the field value in Opportunity  field__c = Ball
i want to download the pdf containing the details of   componentA and ComponentC on the click of the button
when the field value in Opportunity  field__c = Cat
i want to download the pdf containing the details of   componentB and ComponentC on the click of the button

please let me know how can it be achived.
Hi how can i pass wrapper class data from vf page to component and show it in the data table or pageblock table
I have the following code which creates the wrapper object.
public class yourcontroller 
{
    public class dataWrapper
    {
        public string attn {get;set;}
        public string Product{get;set;}
        .....
        //other fields in the table
    }

    public List<dataWrapper> dataContent {get;set;}  //this one will be used on VF page for displaying content in datatable


    public void PopulateData()
    {
        dataContent = new List<dataWrapper>();

        List<cc_ST_OrderConfigData__c > custom1List =[select id,Attn__c,Forwarder__c,Branch_address__c,Currency__c,AB_CODE__c,IBAN__c,Shipper__c,Country__c,Swiftcode__c,Item__r.id from cc_ST_OrderConfigData__c ];
        List<ccrz__E_OrderItem__c];> custom2List = [Select id,Order__r.id,Product__r.id, Product__r.SKU__c,Product_Name__c,Quantity__c,Total_Price_c, Price__c,ItemTotal__c FROM ccrz__E_OrderItem__c];

        Map<String,cc_ST_OrderConfigData__c> custom1Map = new Map<String,cc_ST_OrderConfigData__c>();
        for (cc_ST_OrderConfigData__c c : custom1List)
        {
            if (!custom1Map.contansKey(c.Item__r.id))
            {
                custom1Map.put(c.Item__r.Id,c);
            }
        }

		for (ccrz__E_OrderItem__c&nbsp;c : custom1List)
        {
            if (custom1Map.containsKey(c.Product__r.id))
            {
                dataWrapper data = new dataWrapper();
                cc_ST_OrderConfigData__c cust1 = custom1Map.get(c.Product__r.Id);
                data.attn = cust1.attn__c;
                data.product = c.product__r.id;
                .......
                //populate other fields
                
                dataContent.add(data);
            }
        }

    }
  
}

I need to pass this  data from vf page to vf component
<apex:page standardController="Account" title="Order-Line Items" tabStyle="ccrz__E_Order__c" renderAs="pdf" extensions="yourcontroller"  showHeader="false">
    <c:MyComponent  DataTable="{!dataContent}" />
</apex:page>

<!---- below is the component -->

​​​​​​​<apex:component>
    <apex:attribute name="DataTable" description="wrapper class of two table" type="List" />
    {!DataTable[0].product} <!-- I am getting value here -->
<apex:pageBlock >
  <apex:pageBlockTable id="tbl" value="{!DataTable}" var="Odr" border="1px"  width="100%" align="centre">
            <apex:column headerValue="attn"  value="{!Odr.attn}"/> 
            <apex:column headerValue="product" value="{!Odr.product}"/>
    </apex:pageBlockTable> 
    </apex:pageBlock>
    </apex:component>

I am getting following error on developer console
Unknown property 'Object.attn' 
Unknown property 'Object.product' for page block table
 
 I want to Create a wrapper class and combine both list and populate in the table .

CustomObject1__c custom1 =[select id,Attn__c,Forwarder__c,Branch_address__c,Currency__c,AB_CODE__c,IBAN__c,Shipper__c,Country__c,Swiftcode__c,Item__r.id from cc_ST_OrderConfigData__c ];
CustomObject2__c custom2 = [Select id,Order__r.id,Product__r.id, Product__r.SKU__c,Product_Name__c,Quantity__c,Total_Price_c, Price__c,ItemTotal__c FROM ccrz__E_OrderItem__c];


Here field Item__r.id and Product__r.id contains same id.

I want to create a table and display in following format in vf page
Table
I need help on the following scenario
I have map Map<Id , list<sObject>> getMymap()

which returns data in followig format.
 
{a71w0000000bnoJAAY=(CustomObject1__c:{Id=aGY3L00000000UOWAY, field1__c=Hurray, Field2__c=Hello, Field3__c=a71w0000000bnoJAAY, CurrencyIsoCode=USD}, CustomObject2__c:{Id=a6W3L0000006CFlUAM, Field4__c=a6a3L000000008xQAA, Field5__c=a71w0000000bnoJAAY, Field6__c=Salesforce, Field7__c=2, Field8__c=59.00, Field9__c=118.00, Field10__c=EUR}),
 a71w0000000bnoMAAY=(CustomObject1__c:{Id=aGY3L00000000GsWAI, field1__c=Hurray, Field2__c=Hello, Field3__c=a71w0000000bnoMAAY, CurrencyIsoCode=USD}, CustomObject2__c:{Id=a6W3L0000005CFkUAM, Field4__c=a6a3L000000008xQAA, Field5__c=a71w0000000bnoMAAY, Field6__c=Visualforce, Field8__c=2, ccrz__Price__c=95.00, Field9__c=190.00, Field10__c=EUR})}

I have the apex page.
<apex:page controller="Account" extensions="otherclass1">
< c:someComponent />
</apex:page>
 
 I want to pass this data to visualforce component and populate the populate in the table.
 (this Key does not belong to account but these are the common id  in CustomObject1__r.a71w0000000bnoJAAY and CustomObject2__r.Field5__c)
<id,Sobject> map1 = <id, Sobject>();
<id,Sobject> map2 = <id, Sobject>();

if map1 and map2 contain same key with different values.
how to add map2 values to map1 without deleting map1 values.
I am getting null as value after desearlise of the callout response
 
List<Map<String, Object>> myMaps = new List<Map<String, Object>>();
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://priyesh01.github.io/SampleJson/JsonDummy.json');
request.setMethod('GET');
HttpResponse response = http.send(request);
System.debug('$$Response'+response.getBody());
// If the request is successful, parse the JSON response.
if (response.getStatusCode() == 200) {
   System.debug('I am able to hit end point');
   Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
       		myMaps = new List<Map<String, Object>>();
      List<Object> draftAlarmsRequest = (List<Object>) results.get('draftAlarmsRequest');
  system.debug('$$ draftAlarmsRequest '+draftAlarmsRequest);
}
I am geeting null in the draftAlarmsRequest.

 
Hi
i need help on the following scenario.
Currently i am working on integration and i dont have end point url.
I need help on crearting a dummy endpoint through apex class where it cointain the json on the of my format.
and i need to able to call that class and get the response.

Thanks
Hi ,

I have a scenario where
  • I have a Text field in Opportunity named List Invoce Number's.This field will should populate the vaule from the child Object Opportunity Product Number field "Invoice Number"
  • I want to populate all the Invoice Number field values of child object in a single field List Invoce Number's on Parent Opportunity Object. By Concatinating the values in the field .
  • If there is duplicate Invovice number in the child object then it should add only one value in the List Invoce Number's.  The single Opportunity can contain the duplicate Opportunity Product with similar "Invoice Number".
Please let me know if it is possible to achive through the configuration like formula field ,process builder etc.
Or we need to write the trigger for this scenario)
I need to Query a user in Apex class.
Consider the user having permission set Permission1, Permission2 , Permission3

The permission1 has all the fields in Object ABC readonly but has Modify All access since user need access for notes and Attachment.(By modify all user also get Delete Access)

Need to Ristrict the user from the deleting Object if Only Permission1 assigned.
Pemission2 and Permission3 gives modify access to the ABC and when assigned to user along with permission1 the error should not be thrown.
each permission set have different purpose but i need to restrict user from deleting the record only when Permission1  is assigned.

could you help me how can i filter this user using Query on permissionset Object using permission set name.

 
I have the following code which based on the url parameter contact id and the unSubsEmail(which is subscibe and unsubscribe) value true or false when user click on subscribe or unsubscrib in mail
as per the current scenario on click of subscribe or Unsubscribe the directly the action is called and the message is displayed directly.
now my requirement is to put the confirmation message for unsubscribe scenario like "are you sure ? " displayed and when user clicks on OK button the message "Congratulations, You have Successfully {!subscriptionText}" should be displayed
for subscibe directly the message need to be displayed "Congratulations, You have Successfully {!subscriptionText}" there will be no  confirmation message.

Please let me know how this can be achived.
 
<apex:page sidebar="false" showHeader="false" controller="SubscribeUnsubscription" action="{!SubUnSub}" >
  <body style="margin:0px; padding:0px; background-color:#f1f1f1;">
<div id="SubUnSub" style="display:{!if(unsubscribeemail,"block","none")};">
    <p style="font-family: Open Sans, sans-serif !important; margin-left: 20% !important; margin-top: 5% !important; font-size: large;">
        <br/>
            Congratulations, You have Successfully {!subscriptionText} <br/><br/>
    </p>
</div></body>
</apex:page>



global Class SubscribeUnsubscription
{  
    global Boolean      unsubscribeemail {get; set;}
    global String       	ConEmail {get; set;} 
    global String       subscriptionText {get; set;}
    global String       ConId {get; set;}
    
 
    global SubscribeUnsubscription()
    { 
                  
    }
    
 
    global void SubUnSub()
    {
        ConId = ApexPages.currentPage().getParameters().get('ConId');
        

        if(String.isBlank(ApexPages.currentPage().getParameters().get('unSubsEmail')))
        {
            unsubscribeemail = false;
        }
        else
        {
            unsubscribeemail = Boolean.valueOf(ApexPages.currentPage().getParameters().get('unSubsEmail')); 
        }

        if(!String.isEmpty(ConId))
        {
            contact con = [ SELECT  Id, Email, Unsubscribe__c FROM  Contact WHERE  Id = :ConId ];

            if(unsubscribeemail && !con.Unsubscribe__c)
            {   
                con.Unsubscribe__c = true;
                update con;
                subscriptionText = 'Unsubscribed';
            }
            else if(!unsubscribeemail && con.Unsubscribe__c)
            {          
                con.Unsubscribe__c = false;
                update con;
                subscriptionText = 'Subscribed';
                unsubscribeemail = true;
            }
            else if(!unsubscribeemail && !con.Unsubscribe__c)
            {          
                subscriptionText = 'Subscribed';
                unsubscribeemail = true;
            }
            else if(unsubscribeemail && con.Unsubscribe__c)
            {          
                subscriptionText = 'Unsubscribed';
                
            }
            
        }

    }
}

 
This is for custom VF page

I have a custom object with field custom field
CCObject__r.CCfield__c which is Long text field.
I have created a custom label Example  which cointain some value

Now i want to pre populate the Label value in field when user try to create a new record  also he can change the value from the field and save the record.(this is for record creation scenario).

 
How can i pass the following value from apex  and display in VF page.

I have an object array  
 Object[] ObjArray = new Object[] {}; 
and the values are stored in the following format 
({wrapoffering:[URL=null, childTitle=({wrapchildOffering:[childImageUrl=null, childTitle=ABC, childURL=https://google.com]}), imageUrl=https://google.com,parTitle=Website], 
wrapoffering:[URL=null, childTitle=({wrapchildOffering:[childImageUrl=null, childTitle=DEF, childURL=https://google.com]}), imageUrl=https://google.com, parTitle=Website], wrapoffering:[URL=null, childTitle=({wrapchildOffering:[childImageUrl=null, childTitle=GHI, childURL=https://google.com]}), imageUrl=https://google.com, parTitle=Website]})

Now i want to display these values in the VF page.

Please suggest me how can i display this values. 

 
Hi
I am trying to query some fields of Account in query editor. 
select id,Alternate_Number_1__c,
            Alternate_Number_2__c,
            Alternate_Number_3__c,
            Phone,Student_Phone_Number__c
            from 
            Account 
I cross checked  in object manager and all these fields are there in account object. but I am getting this error.
select id,Alternate_Number_1__c,
          ^
ERROR at Row:1:Column:11
No such column 'Alternate_Number_1__c' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

FYI  all these fields are there in Person Account records.
how to see standard sobject created records. Please explain step by step
I have a Object CPQ Quote. I want to set up the advance approval where the first approval should be sales manager . later there will be parallel approval like Finance , legal etc . under the finance, legal there are level upprovers which should be fired in the Serial.
the below diagram shows how the advance aproval should fire.

can anybody guide me how can this be build using advanced approvel.
Advanced approval flow
I am trying to write a test class that uses the LastLoginDate field but since it is read only I'm not sure as to go about creating data for it. I will share my batch class and what I currently have as a test class...




global class DeactivateUsers implements Database.Batchable<SObject>
{
       dateTime dt = date.today().addDays(-60);
    String pro1 = 'System Administrator';
    public String query = 'SELECT Name, LastLoginDate, Id, user.profile.name From User WHERE IsActive = true AND LastLoginDate <: dt AND user.profile.name <>: pro1 ';

    global Database.querylocator start(Database.BatchableContext bc)
    {
       return Database.getQueryLocator(query);
    }

    global void execute(Database.BatchableContext bc,List<User> records)
    {
        List<User> userList = new List<User>();
        
        for(User r : records)
        {
            User u = (user)r;
            userList.add(u);
        }
        
        if(userList.size() > 0)
        { 
            for(User usr : userList) { usr.isActive = false; }
        }
        update userList;
    }

    global void finish(Database.BatchableContext bc){}
}








@isTest
private class DeactivateUsersTest {
     @testSetup
     static void setup() {
         Profile p = [SELECT Id
                        FROM Profile
                       WHERE Name = 'Standard User'];

         List<User> users = new List<User>();

         for(Integer i = 0; i < 10; i++){
             users.add(new User(Alias = 'Elvis' + i,
                                Email = 'Elvis' + i + '@testorg.com ',
                                EmailEncodingKey = 'UTF-8',
                                LastName = 'Presley',
                                LanguageLocaleKey = 'en_US',
                                LocaleSidKey = 'en_US',
                                ProfileId = p.Id,
                                TimeZoneSidKey = 'America/Los_Angeles',
                                UserName = 'ElvisPresley000' + i + '@testorg.com'));
         }
         insert users;
     }

     static testmethod void testBatch(){
         Test.startTest();
         DeactivateUsers d = new DeactivateUsers();
         Database.executeBatch(d);
         Test.stopTest();
     }
    
    static testmethod void testScheduler(){
        String cronExpr = '0 0 0 15 3 ? 2022';
        
        DeactivateUsersScheduler das = new DeactivateUsersScheduler();
        String jobId = System.schedule('jobTestName', cronExpr, das);
        das.execute(null);
    }
}
I have the list of line item from Opportuntiy
List<products__c> allProducts = [select id, name, quantity__c, price__c ,totalPrice__c from products  where id:= parentOppIdid];

In the above list i am having  multiple  product with same name and  
i want to combine the similar product as one ie combinig the similar product and adding the quantity__c ,totalPrice__c for productlineitem.

suppose list has
name=apple, quantity__c=2 , price__c= 20 , totalPrice__c = 40
name = watermelon , quantity__c=1 , price__c = 10 , totalPrice__c = 10
name = apple , quantity__c=3 , price__c = 20 , totalPrice__c = 60

I need a single list like

name = apple , quantity__c = 5 , price__c = 20 ,totalPrice__c = 100
name = watermelon , quantity__c=1 , price__c = 10 , totalPrice__c = 10

 
I have the secnario where there are multiple visualforce component.

<apex: page renderAs='pdf'>
<c:componentA />
<c:componentB />
<c:componentC />
</apex: page >

when the field value in Opportunity  field__c = Apple
i want to download the pdf containing the details of   componentA and ComponentB on the click of the button
when the field value in Opportunity  field__c = Ball
i want to download the pdf containing the details of   componentA and ComponentC on the click of the button
when the field value in Opportunity  field__c = Cat
i want to download the pdf containing the details of   componentB and ComponentC on the click of the button

please let me know how can it be achived.
Hi how can i pass wrapper class data from vf page to component and show it in the data table or pageblock table
I have the following code which creates the wrapper object.
public class yourcontroller 
{
    public class dataWrapper
    {
        public string attn {get;set;}
        public string Product{get;set;}
        .....
        //other fields in the table
    }

    public List<dataWrapper> dataContent {get;set;}  //this one will be used on VF page for displaying content in datatable


    public void PopulateData()
    {
        dataContent = new List<dataWrapper>();

        List<cc_ST_OrderConfigData__c > custom1List =[select id,Attn__c,Forwarder__c,Branch_address__c,Currency__c,AB_CODE__c,IBAN__c,Shipper__c,Country__c,Swiftcode__c,Item__r.id from cc_ST_OrderConfigData__c ];
        List<ccrz__E_OrderItem__c];> custom2List = [Select id,Order__r.id,Product__r.id, Product__r.SKU__c,Product_Name__c,Quantity__c,Total_Price_c, Price__c,ItemTotal__c FROM ccrz__E_OrderItem__c];

        Map<String,cc_ST_OrderConfigData__c> custom1Map = new Map<String,cc_ST_OrderConfigData__c>();
        for (cc_ST_OrderConfigData__c c : custom1List)
        {
            if (!custom1Map.contansKey(c.Item__r.id))
            {
                custom1Map.put(c.Item__r.Id,c);
            }
        }

		for (ccrz__E_OrderItem__c&nbsp;c : custom1List)
        {
            if (custom1Map.containsKey(c.Product__r.id))
            {
                dataWrapper data = new dataWrapper();
                cc_ST_OrderConfigData__c cust1 = custom1Map.get(c.Product__r.Id);
                data.attn = cust1.attn__c;
                data.product = c.product__r.id;
                .......
                //populate other fields
                
                dataContent.add(data);
            }
        }

    }
  
}

I need to pass this  data from vf page to vf component
<apex:page standardController="Account" title="Order-Line Items" tabStyle="ccrz__E_Order__c" renderAs="pdf" extensions="yourcontroller"  showHeader="false">
    <c:MyComponent  DataTable="{!dataContent}" />
</apex:page>

<!---- below is the component -->

​​​​​​​<apex:component>
    <apex:attribute name="DataTable" description="wrapper class of two table" type="List" />
    {!DataTable[0].product} <!-- I am getting value here -->
<apex:pageBlock >
  <apex:pageBlockTable id="tbl" value="{!DataTable}" var="Odr" border="1px"  width="100%" align="centre">
            <apex:column headerValue="attn"  value="{!Odr.attn}"/> 
            <apex:column headerValue="product" value="{!Odr.product}"/>
    </apex:pageBlockTable> 
    </apex:pageBlock>
    </apex:component>

I am getting following error on developer console
Unknown property 'Object.attn' 
Unknown property 'Object.product' for page block table
 
 I want to Create a wrapper class and combine both list and populate in the table .

CustomObject1__c custom1 =[select id,Attn__c,Forwarder__c,Branch_address__c,Currency__c,AB_CODE__c,IBAN__c,Shipper__c,Country__c,Swiftcode__c,Item__r.id from cc_ST_OrderConfigData__c ];
CustomObject2__c custom2 = [Select id,Order__r.id,Product__r.id, Product__r.SKU__c,Product_Name__c,Quantity__c,Total_Price_c, Price__c,ItemTotal__c FROM ccrz__E_OrderItem__c];


Here field Item__r.id and Product__r.id contains same id.

I want to create a table and display in following format in vf page
Table
I need help on the following scenario
I have map Map<Id , list<sObject>> getMymap()

which returns data in followig format.
 
{a71w0000000bnoJAAY=(CustomObject1__c:{Id=aGY3L00000000UOWAY, field1__c=Hurray, Field2__c=Hello, Field3__c=a71w0000000bnoJAAY, CurrencyIsoCode=USD}, CustomObject2__c:{Id=a6W3L0000006CFlUAM, Field4__c=a6a3L000000008xQAA, Field5__c=a71w0000000bnoJAAY, Field6__c=Salesforce, Field7__c=2, Field8__c=59.00, Field9__c=118.00, Field10__c=EUR}),
 a71w0000000bnoMAAY=(CustomObject1__c:{Id=aGY3L00000000GsWAI, field1__c=Hurray, Field2__c=Hello, Field3__c=a71w0000000bnoMAAY, CurrencyIsoCode=USD}, CustomObject2__c:{Id=a6W3L0000005CFkUAM, Field4__c=a6a3L000000008xQAA, Field5__c=a71w0000000bnoMAAY, Field6__c=Visualforce, Field8__c=2, ccrz__Price__c=95.00, Field9__c=190.00, Field10__c=EUR})}

I have the apex page.
<apex:page controller="Account" extensions="otherclass1">
< c:someComponent />
</apex:page>
 
 I want to pass this data to visualforce component and populate the populate in the table.
 (this Key does not belong to account but these are the common id  in CustomObject1__r.a71w0000000bnoJAAY and CustomObject2__r.Field5__c)
<id,Sobject> map1 = <id, Sobject>();
<id,Sobject> map2 = <id, Sobject>();

if map1 and map2 contain same key with different values.
how to add map2 values to map1 without deleting map1 values.
I need to help to pass account id from the CreateContactreateController.js to the createContact.apxc 

CreateContactreate.cmp
<aura:component controller="CreateContact" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" >
    <aura:attribute name="AccountId" type="String" />
    <aura:attribute name="CreateContact" type="Contact" default="{
                                                                 sObject : 'contact',
                                                                 LastName:'',
                                                                 AccountId:'',
                                                                 Email: '',
                                                                 Phone:''
                                                                 }" />
    <div class="slds-p-bottom_large slds-p-left_large" style="width:500px">
    <lightning:recordEditForm aura:id="recordEditForm"
                              recordId="{!v.recordId}"
                              objectApiName="Contact">
                    <lightning:inputField fieldName="LastName" aura:id="LastName" value="{!v.CreateContact.LastName}" />
                    <lightning:inputField fieldName="AccountId" aura:id="AccountId" value="{!v.CreateContact.AccountId}"/>
                    <lightning:inputField fieldName="Email" aura:id="Email" AccountIdvalue="{!v.CreateContact.Email}"/>
                    <lightning:inputField fieldName="Phone" aura:id="Phone" value="{!v.CreateContact.Phone}"/>
            <lightning:button aura:id="submit" type="submit" label="Save record" onclick="{!c.doSave}" class="slds-m-top_medium" />
        </lightning:recordEditForm>
    </div>
</aura:component>

CreateContactreateController.js
 
({
    doSave : function(component, event, helper) {
        var action = component.get('c.createContact');
        var contc = component.get('v.CreateContact').AccountId;
        console.log('AccountId '+ contc)
        action.setParams({
            con : component.get('v.CreateContact'),
            AccountId : contc
        })
        action.setCallback(this,function(response){
            var state = response.getState();
            alert(state);
            if(state === 'SUCCESS'|| state ==='DRAFT'){
                var responseValue = response.getReturnValue();
            }else if(state ==='INCOMPLETE'){
                
            }else if(state ==='ERROR'){
                var errors = response.getError();
                console.log('Error',errors)
                if(errors|| errors[0].message){
                    
                }
            }
            
        },'ALL');
        $A.enqueueAction(action);
	}
    
})

createContact.apxc
 
public class CreateContact {
    @AuraEnabled
    public static contact createContact(contact con,String AccountId) {
        system.debug('$$contact '+con+' $$Account Id'+AccountId);
        if (AccountId != null){
            //con.AccountId = AccountId;
            insert con;
          system.debug(' CON '+con);
        }
          return con;
    }
    
}

I am getting AccountId as null in apex controller and in console log i am getting following error. "Value provided is invalid for action parameter 'AccountId' of type 'String'"

Thanks in advnace  
I am writing a scheduled class for sending emails for user who have not logged in to salesforce for 30 days, Code is working fine but now I am confused how to write test classes for that, Because all of my conditions are based on Last Login Date which is Un-Editable. Can I take data from a existing user? If i take in such a way will it effect when i move my code to other sandbox/Production? If so how to solve this.

!! Please Help !!

Thanks & Regards
Harsha.
I need a help to write a trigger
can  any one help me how can i auto send a email to the Case Owner  whenever the case status is updated to closed through the trigger insted of process builder.

Thanks in advance.