• Krishnakumari
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
Hi,

I am facing a strange issue.
I am trying to create a record using lightning:frecordEditForm but not able to create a record.
I have a master detail relationship field "Account" on object "Book". When I have change the relation to lookup it is working. But for master detail relationship it is not working. Please help me.

Below is the code
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes">
     <aura:attribute name="recordId" type="Id"/>
     
    <lightning:recordEditForm  objectApiName="Book__c">
        <lightning:messages />
        <lightning:inputField fieldName="Name" />
        <lightning:inputField fieldName="Account__c"/>
        
        <lightning:button class="slds-m-top_small" type="submit" label="Create" />
    </lightning:recordEditForm>

</aura:component>

This is the error I am getting
User-added image
 
 
I am having a problem that really should not be this hard to figure out. I've created custom Actions for Log a Call on the Asset object and added them to the page layout and they show up as expected. I did the same thing for Cases and the Action is not visible. The only difference between Assets and Cases is that I'm using Record Types on the Case Object. I'm not sure that it's a permission issue since I'm testing with the System Administrator account.
User-added image
User-added image
Hi,

I am facing a strange issue.
I am trying to create a record using lightning:frecordEditForm but not able to create a record.
I have a master detail relationship field "Account" on object "Book". When I have change the relation to lookup it is working. But for master detail relationship it is not working. Please help me.

Below is the code
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes">
     <aura:attribute name="recordId" type="Id"/>
     
    <lightning:recordEditForm  objectApiName="Book__c">
        <lightning:messages />
        <lightning:inputField fieldName="Name" />
        <lightning:inputField fieldName="Account__c"/>
        
        <lightning:button class="slds-m-top_small" type="submit" label="Create" />
    </lightning:recordEditForm>

</aura:component>

This is the error I am getting
User-added image
 
 

Hi Everyone,

I've created a simpletrigger that creates a new record of custom object: Hosted_PBX_Deployment__c when a new Opportunity is created.
Now I need to set a value to a fiield: Rack_4_19_two_post_Qty__c in custom object that depends on a value of an Account field: All_Network_Devices_Qty__c
so if Account.All_Network_Devices_Qty__c <=11 then Rack_4_19_two_post_Qty__c =1 

what is the best way to reffer to an Account field from Hosted_PBX_Deployment__c trigger?

this is my trigger:

trigger AutoCreateHPBXdeployment on Opportunity (after insert) {


List<Hosted_PBX_Deployment__c> newHPBX = new List<Hosted_PBX_Deployment__c>();
  for (Opportunity opp : Trigger.new) {
      if(opp.Hosted_PBX__c=='Yes'){
    Hosted_PBX_Deployment__c hpbx = new Hosted_PBX_Deployment__c();
    hpbx.Opportunity__c  = opp.Id;
    hpbx.Opportunity_Account__c = opp.AccountId;
   
 
    newHPBX.add(hpbx);
      }
  }
  insert newHPBX;

}

Thank you!

I'm following the examples as given in the updated documentation.
 
<aura:component>
    <lightning:recordEditForm recordId="003XXXXXXXXXXXXXXX" objectApiName="Contact">
        <lightning:messages />
        <lightning:inputField fieldName="FirstName" />
        <lightning:inputField fieldName="LastName" />
        <lightning:inputField fieldName="Email" />
        <lightning:button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update" />
    </lightning:recordEditForm>
</aura:component>
Inserting a recordId in the above example results in the following error:
[Error in $A.getCallback() [Cannot read property 'value' of undefined]]
Even the second example, attempting to create a record, is throwing an error:
<aura:component>
    <lightning:recordEditForm aura:id="recordEditForm" 
                           objectApiName="Contact">
        <lightning:messages />
        <lightning:inputField fieldName="Name" />
        <lightning:button class="slds-m-top_small" type="submit" label="Create new" />
    </lightning:recordEditForm>
</aura:component>
In the above code, there are two separate errors happening:

1) I'm getting the error 'Cannot read property 'defaultRecordTypeId' of undefined' even though there are no record types associated with my Conatct object.  To get around this error, I have created a record type and I'm now passing in the recordTypeId.  Updated code looks like:
<aura:component>
    <lightning:recordEditForm aura:id="recordEditForm" 
                           objectApiName="Contact"
                           recordTypeId="XXXXXXXXXXXXX">
        <lightning:messages />
        <lightning:inputField fieldName="Name" />
        <lightning:button class="slds-m-top_small" type="submit" label="Create new" />
    </lightning:recordEditForm>
</aura:component>
2) Now that I'm past the recordTypeId error, I now receive this error:
cannot read property 'fields' of undefined

I understand that this new component is in Beta for the current release, but I wanted to understand if the documentation is incomplete, if I'm making some simple error that I cannot see, or if the feature is not fully functional yet.