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

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 13
    Replies
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. 

 
List<Contact> lstContact = [select id,firstName,LastName,accountId from contact where accountid in :stAccId ];

Map<String,List<Contact>> mapAccountWiseContact = new Map<String,List<Contact>>();

For(Contact cont : lstContact)
{
	if(mapAccountWiseContact.containsKey(cont.accountId))
	{
		List<Contact> lstCont = mapAccountWiseContact.get(cont.accountId);
		lstCont.add(cont);
	}
	else
	{
		List<Contact> lstCont = new List<Contact>();
		lstCont.add(cont);
		mapAccountWiseContact.put(cont.accountId,lstCont);
	}
}

What does if and else part does.
Hi,

I am converting the visualforce page into the Lightning Web Component.
How can I use the following bootstrap and Angular reference in LWC.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://www.google.com/recaptcha/api.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>

I am building the community page and I need this for the home page development.
I want to migrate the files from library of one sandbox to another.
library cointains the pdf files and images userd for developent of partner portal .
could any one guide me how can i migrate the library files.
Hi is there any possible way to provide  access for opportunity to the customer community user.
So that he can create and view his opportunity.
I have a map like this which cointain the all the value like id=userid and the values from account field (Account.abc__c
)and case field(Case.xyz__c).

map<Id,list<String>> UserwithCars = new map<Id,list<String>>();

Case.xyz__c (consider it as a brand)
Account.abc__c (consider it as sub-brand)


when user creates the case record  with the account 

I want to strore the userid of the user based on the Case.xyz__c value to the below 
ie is if the UserwithCars map cointains the value which is present in Case.xyz__c then it should add userid to the below list 

List<String> listUsersWithMatchingModel = new List<String>(); 
 
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 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 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.