• MisbahTehseen Parathanalli 3
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
Hi All,
i have a requirement in which i am supposed to create a lightning component and use an image as a button which when clicked will redirect to another page. Can anybody help me with this please?



Thanks in advance.
 
Can anybody help me with a lookup field in a form to create a record in lightning component?
i am creating a record by taking input from a form using lightning which has one lookup to the user record, i want help with that field....help needed with the same field....
Thanks in advance
 
i am creating a record by taking input from a form which has few fields as picklists but when i am accessing the value in an attribute of the object it is failing to create the record, else it is working fine? 
this is part of the code where i am saving thr value in field:-
                        <lightning:select name="select1" label="License" aura:id="itemform" value="{!v.newUser.License__c}">
                           <option value="">-Select License Type-</option>
                            <option value="1">Chatter External</option>
                            <option value="2">Chatter Free</option>
                            <option value="3">Salesforce</option>
                            <option value="4">Salesforce Platform</option>
                        </lightning:select>


i have given the same options in the main field of the object as well. Please advice an alternative or a solution for this code.
I want to add related list of  "User object" to the custom object that i have created. but i am not finding the option of adding it in related lists of the page layout ? i have a lookup field to user object in the newly created custom object does that affect it or is it possible to add this related list?
creating a record in a custom object using the form approach in lightning component, but it is returning a null id.
following is the code of component:-
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId"
                access="global" controller="createUserRecord">
    <aura:attribute name="newUser" type="User_Request__c" default="{'sobjectType':'User_Request__c',
                                                                   'First_Name__c':'',
                                                                   'Last_Name__c    ':'',
                                                                   'Email__c':'',
                                                                   'X521_ID__c':'',
                                                                   'Company_Phone__c':'',
                                                                   'Model_User__c':'',
                                                                   'Requestor_s_521__c':'',
                                                                   'Username__c':'',
                                                                   'Manager_Email__c':'',
                                                                   'Manager__c':'false' ,
                                                                   'Country_Code__c':'',
                                                                   'Deactivation_Date__c':''}"  />

        <fieldset class="myBoxArea">
    <lightning:layout verticalAlign="end">
        <lightning:layoutItem >
            <div class="blue">                 
                envision CRM and Commercial Application Access Request ALCON 
            </div>
            <div class="white">
            </div>
        </lightning:layoutItem>
    </lightning:layout>
        <div class="slds-align_absolute-center slds-box lightblue" style="height: 5rem;">
            USER INFORMATION
        </div>  
        <lightning:layout class="slds-box">
            <lightning:layoutItem size="6" class="left-align">
                <div >
                    <form class="slds-form slds-form_horizontal">          
                        <lightning:input aura:id="itemform" label="First Name"
                                         name="itemname"
                                         type="input text"
                                         value="{!v.newUser.First_Name__c}"/> 
                        <lightning:input aura:id="itemform" label="Username"
                                         name="itemname"
                                         type="input text"
                                         value="{!v.newUser.Username__c}"/> 
                        <lightning:input aura:id="itemform" label="Manager's Email"
                                         name="itemname"
                                         type="email"
                                         value="{!v.newUser.Manager_Email__c}"/>
                        <lightning:input aura:id="itemform" label="Copy profile from"
                                         name="itemname"
                                         type="input text"
                                         value="{!v.newUser.Model_User__c}"/>
                        <lightning:input aura:id="itemform" label="Access End Date"
                                         name="itemname"
                                         type="date"
                                         value="{!v.newUser.Deactivation_Date__c}"/> 
                        <lightning:input type="toggle" label="Manager"
                                         name="option1"
                                         aura:id="itemform" 
                                         value="{!v.newUser.Manager__c}"/> 
                    </form>
                </div>
            </lightning:layoutItem>
            <lightning:layoutItem size="6" class="right-align">
                <div >
                    <form class="slds-form slds-form_horizontal">          
                        <lightning:input aura:id="itemform" label="Last Name"
                                         name="itemname"
                                         type="input text"
                                         value="{!v.newUser.Last_Name__c}"/> 
                        <lightning:input aura:id="itemform" label="Email Address"
                                         name="itemname"
                                         type="email"
                                         value="{!v.newUser.Email__c}"/>
                        <lightning:input aura:id="itemform" label="User 5-2-1"
                                         name="itemname"
                                         type="input text"
                                         value="{!v.newUser.X521_ID__c}"/>
                        <lightning:input aura:id="itemform" label="Company/Mobile Phone #"
                                         name="itemname"
                                         type="input text"
                                         value="{!v.newUser.Company_Phone__c}"/> 
                        <lightning:input aura:id="itemform" label="Requestor 5-2-1"
                                         name="itemname"
                                         type="input text"
                                         value="{!v.newUser.Requestor_s_521__c}"/> 
                        <lightning:input aura:id="itemform" label="Country"
                                         name="itemname"
                                         type="input text"
                                         required="true"
                                         value="{!v.newUser.Country_Code__c}"/>
                    </form>
                </div>
            </lightning:layoutItem>
        </lightning:layout>
        <lightning:layout>
            <lightning:layoutItem class="slds-align_absolute-center">        
                        <lightning:button label="Send for approval" 
                                          class="slds-m-top--medium"
                                          variant="brand"
                                          onclick="{!c.save}"/>
            </lightning:layoutItem>
        </lightning:layout>      
    </fieldset>
</aura:component>
apex class is:-
public class createUserRecord {
    @auraenabled
    public static id createUserRecordNew(User_Request__c UR){
     upsert UR;
    return UR.id;
}    }
controller i am using is:-
({
 save : function(component, event, helper) {     
     var action = component.get("c.createUserRecordNew");
            action.setParams({"UR":component.get("v.newUser")});
            action.setCallback(this,function(result){
            component.set("v.isShow",false);
            var userId = result.getReturnValue();
            alert('userId'+userId); 
        });
         $A.enqueueAction(action);
 }
})
app for execution:-
<aura:application extends="force:slds">
    <c:newTest/>    
</aura:application>
Can anybody help me with a lookup field in a form to create a record in lightning component?
i am creating a record by taking input from a form using lightning which has one lookup to the user record, i want help with that field....help needed with the same field....
Thanks in advance
 
i am creating a record by taking input from a form which has few fields as picklists but when i am accessing the value in an attribute of the object it is failing to create the record, else it is working fine? 
this is part of the code where i am saving thr value in field:-
                        <lightning:select name="select1" label="License" aura:id="itemform" value="{!v.newUser.License__c}">
                           <option value="">-Select License Type-</option>
                            <option value="1">Chatter External</option>
                            <option value="2">Chatter Free</option>
                            <option value="3">Salesforce</option>
                            <option value="4">Salesforce Platform</option>
                        </lightning:select>


i have given the same options in the main field of the object as well. Please advice an alternative or a solution for this code.