• Amrith Thandra
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 8
    Replies
hi everyone , i am having a requirement , i have a code in aura component , where there is record edit form , in that record edit form i am having onsubmit function , where there is code in .js for onsubmit function ,

i just want to know how to write this same code in lightning web component , i will share the code here

aura component record edit form :

<lightning:recordEditForm
                                  objectApiName="Feedback__c"
                                  onsubmit="{!c.handleSubmit}"
                                  onsuccess="{!c.save}"
                                  aura:id="recform"
                                  >
            <lightning:inputField aura:id="field" fieldName="Name" />
            <lightning:inputField aura:id="field" fieldName="Feedback__c" />
            <lightning:button class="slds-m-top_small" variant="brand" type="submit" name="Save" label="Submit" onclick="{!c.submit}"/>

        </lightning:recordEditForm>
       

.js file in aura component :

 handleSubmit: function(component, event, helper) {
       event.preventDefault();     
        var field = event.getParam("fields");
        console.log(field);
        var c=component.get("v.clist");

        field.Competing_Product__c =c.Competing_Product__c;
        field.Industry_Sector__c = c.Industry_Sector__c;
        field.Territory__c = c.Territory__c;
        field.Competition__c = component.get("v.recordId");
        field.Competitor__c = c.Competitor__c;
        field.Competitor_Campaign__c = c.Competitor_Campaign__c;
        field.Opportunity__c=c.Opportunity__c;
        component.find('recform').submit(field);

    },

anyone please transfer this code into lwc , as i dont know the javascript more , plz help
  
hi everyone , i just got an issue ,
 firstly i have 2 lightning component with 2 fields displaying values
lets say  comp1 and comp2

what i have done is , i just kept comp2 in comp1 component
in follweing way plz check down here
here is sample code  of comp1
<aura: component>
.
.
.{ complete code of comp1}
.
.
<c:comp2/>
</aura: component>

so i can able to see field data  in comp1 , but not able to see field data values in comp2 ,

im sharing pic ,
u can see there is no data on oppportunity and threats


User-added image
Hi Everyone,
i have a requirement
i am having two users with system administrator role , and having custom object with rating component , if user 1 is giving 5 rating and user 2 is giving 4 rating , then we need to take these two users value add them and show average of both
for example : user 1 rating = 5
                      user 2 rating = 4 

average rating =user1 rating + user 2 rating / 2 = 5+4/2

having rating__c(number) field & averagerating__c (text) field in custom object

different users with different records  on creating record need to show an average of  these ratings

for best example  , when we give rating for a movie in bookmyshow , we need to get rating average from different users and display the result

please let me know how to solve this
thanks in advance

please let me know if this is possible,
thanks in advance
Hi Everyone,
i have a requirement
i am having two users with system administrator role , and having custom object with rating component , if user 1 is giving 5 rating and user 2 is giving 4 rating , then we need to take these two users value add them and show average of both
for example : user 1 rating = 5
                      user 2 rating = 4 

average rating =user1 rating + user 2 rating / 2 = 5+4/2

having rating__c(number) field & averagerating__c (text) field in custom object

please let me know if this is possible,
thanks in advance
i am having two users with system administrator role , and having custom object with rating component , if user 1 is giving 5 rating and user 2 is giving 4 rating , then we need to take these two users value add them and show average of both

having rating__c(number) field & averagerating__c (text) field in custom object

please let me know if this is possible
thanks in advance
HI EVERONE ,
i have a requirement , in my custom object i have a two fields 1)rating and 2) average rating 
if i give rating as 5 , for the first it should display average aring as 5

for the next time when i give rating as 4 , it should take the previous value (5) and add to the present value and show average of both

i.e: 5+4/2 =4.5

pleaase let me know how to do this task as i am confused
Hi Everyone,
i have a requirement
i am having two users with system administrator role , and having custom object with rating component , if user 1 is giving 5 rating and user 2 is giving 4 rating , then we need to take these two users value add them and show average of both
for example : user 1 rating = 5
                      user 2 rating = 4 

average rating =user1 rating + user 2 rating / 2 = 5+4/2

having rating__c(number) field & averagerating__c (text) field in custom object

different users with different records  on creating record need to show an average of  these ratings

for best example  , when we give rating for a movie in bookmyshow , we need to get rating average from different users and display the result

please let me know how to solve this
thanks in advance

please let me know if this is possible,
thanks in advance
hi everyone , i am having a requirement , i have a code in aura component , where there is record edit form , in that record edit form i am having onsubmit function , where there is code in .js for onsubmit function ,

i just want to know how to write this same code in lightning web component , i will share the code here

aura component record edit form :

<lightning:recordEditForm
                                  objectApiName="Feedback__c"
                                  onsubmit="{!c.handleSubmit}"
                                  onsuccess="{!c.save}"
                                  aura:id="recform"
                                  >
            <lightning:inputField aura:id="field" fieldName="Name" />
            <lightning:inputField aura:id="field" fieldName="Feedback__c" />
            <lightning:button class="slds-m-top_small" variant="brand" type="submit" name="Save" label="Submit" onclick="{!c.submit}"/>

        </lightning:recordEditForm>
       

.js file in aura component :

 handleSubmit: function(component, event, helper) {
       event.preventDefault();     
        var field = event.getParam("fields");
        console.log(field);
        var c=component.get("v.clist");

        field.Competing_Product__c =c.Competing_Product__c;
        field.Industry_Sector__c = c.Industry_Sector__c;
        field.Territory__c = c.Territory__c;
        field.Competition__c = component.get("v.recordId");
        field.Competitor__c = c.Competitor__c;
        field.Competitor_Campaign__c = c.Competitor_Campaign__c;
        field.Opportunity__c=c.Opportunity__c;
        component.find('recform').submit(field);

    },

anyone please transfer this code into lwc , as i dont know the javascript more , plz help
  
Hi Everyone,
i have a requirement
i am having two users with system administrator role , and having custom object with rating component , if user 1 is giving 5 rating and user 2 is giving 4 rating , then we need to take these two users value add them and show average of both
for example : user 1 rating = 5
                      user 2 rating = 4 

average rating =user1 rating + user 2 rating / 2 = 5+4/2

having rating__c(number) field & averagerating__c (text) field in custom object

different users with different records  on creating record need to show an average of  these ratings

for best example  , when we give rating for a movie in bookmyshow , we need to get rating average from different users and display the result

please let me know how to solve this
thanks in advance

please let me know if this is possible,
thanks in advance
i am having two users with system administrator role , and having custom object with rating component , if user 1 is giving 5 rating and user 2 is giving 4 rating , then we need to take these two users value add them and show average of both

having rating__c(number) field & averagerating__c (text) field in custom object

please let me know if this is possible
thanks in advance
HI EVERONE ,
i have a requirement , in my custom object i have a two fields 1)rating and 2) average rating 
if i give rating as 5 , for the first it should display average aring as 5

for the next time when i give rating as 4 , it should take the previous value (5) and add to the present value and show average of both

i.e: 5+4/2 =4.5

pleaase let me know how to do this task as i am confused