• Thomas D.
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
I want to use a child component for each record and iterate over it on the main component.  For some reason, the values don't show when I try to use this approach.

If I simply iterate and use the recordEditForm it works fine.  However, once I try to use the second component the values do not show.  Here is my iteration from the primary component:
 
<aura:iteration var="groupstructure" items="{!v.newGroupStructures}">
                  <c:GSCloneRecord groupstructure="{!groupstructure}"/>
            </aura:iteration>

Here is the GSCloneRecord Component.  I am unsure of  how to reference the values in teh groupstructure attribute.  I tried adding value= but that did not seem to work.  Any help would be greatly appreciated!!! thanks!!!!
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId,lightning:isUrlAddressable" controller="GSController">
    <aura:attribute name="groupstructure" type="Group_Structure__c" />
	<!-- Handle component initialization in a client-side controller -->
	<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

    <lightning:recordEditForm
             
            objectApiName="Group_Structure__c">
            <!-- the messages component is for error messages -->
            <lightning:messages />
  <lightning:layout multipleRows="true" verticalAlign="center" >
      <lightning:layoutItem size="1" padding="around-Small" >
 						<lightning:inputField aura:id="Name" fieldName="Name"   />
      				</lightning:layoutItem>

      
      
      <lightning:layoutItem size="1" padding="around-Small" >
 		<lightning:inputField fieldName="Status__c"/>
      </lightning:layoutItem>
      
     <lightning:layoutItem size="2" padding="around-Small">
        <lightning:inputField fieldName="Funding_Type__c"/>
     </lightning:layoutItem>
      <lightning:layoutItem size="1" padding="around-Small" class="customRequired">
    <lightning:inputField fieldName="Group_Number__c"/>
     </lightning:layoutItem>
    <lightning:layoutItem size="1" padding="around-Small" class="customRequired">
    <lightning:inputField fieldName="Section_Code__c"/>
     </lightning:layoutItem>
      <lightning:layoutItem size="1" padding="around-Small" class="customRequired">
       <div class="LSELabel">
        <lightning:inputField fieldName="Package_Code__c" />
      </div>
    </lightning:layoutItem>
    <lightning:layoutItem size="2" padding="around-Small" class="customDates">
        <lightning:inputField fieldName="Effective_Date__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="2" padding="around-Small" class="customDates">
        <lightning:inputField fieldName="End_Date__c"/>
    </lightning:layoutItem>
      <lightning:layoutItem size="1" padding="around-Small" class="customProds">
        <lightning:inputField fieldName="Health_Product__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size=".5" padding="around-Small" class="customProds">
        <lightning:inputField fieldName="Prescription__c" />
    </lightning:layoutItem>
    <lightning:layoutItem size=".5" padding="around-Small" class="customProds">
      <lightning:inputField fieldName="Dental__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size=".5" padding="around-Small" class="customProds">
      <lightning:inputField fieldName="Vision__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="1" padding="around-Small" class="customProds">
      <lightning:inputField fieldName="CDH_Status__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="1" padding="around-Small" class="customRating">
      <lightning:inputField fieldName="Rating_Category__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="3" padding="around-Small" class="customRating">
      <lightning:inputField fieldName="Coverage_Categories__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="1" padding="around-Small">
      <lightning:inputField fieldName="Prefix__c"/>
    </lightning:layoutItem>
      <lightning:layoutItem size="5" padding="around-Small">
        <lightning:inputField fieldName="Description__c"/>
    </lightning:layoutItem>
        </lightning:layout>
        </lightning:recordEditForm>

</aura:component>



 
  • November 20, 2018
  • Like
  • 0
Hey,

I'm developing a lightning:datatable which supports the inline editing and multiselect functionality, however this doesn't seem to work with date or datetime.

Example:
My Datatable:
<lightning:datatable aura:id="relatedDataTable" columns="{!v.FieldList}" data="{!v.RecordsPage}"
                    keyField="Id" draftValues="{!v.draftValues}" onsave="{!c.handleSave}" oncancel="{!c.handleCancel}"
                    oncellchange="{!c.handleEdit}" sortedBy="{!v.sortedBy}" sortedDirection="{!v.sortedDirection}"
                    defaultSortDirection="{!v.defaultSortDirection}" onsort="{!c.updateColumnSorting}" onrowaction="{!c.handleRowAction}"
                    onrowselection="{!c.updateSelectedRow}" rowNumberOffset="{!v.rowOffset}" showRowNumberColumn="true" />
Example date column:
{fieldName:'Date__c', type:'date-local', label:'Date', sortable:true, editable:true}
The following happens:
The moment you try to check the "Update 3 selected items", the popup disappears and you are unable to set a date. It doesn't matter which order you try it. If you try to first set a date then check the checkbox the box disappears without posting the changes to the datatable. I have a feeling this has something to do with the way "focus" works on the date input. Even if you click right next to the date input, as soon as the input field loses focus, the box closes. the image below shows the scenario.

Does anybody know a solution to this? If this is a bug with the lightning:datatable, how do i notify Salesforce of this issue.
Lightning:datatable date multi edit



 
We are using a lightning component as quick action on a record, with a flow embedded in it. Now when someone open this quick action it sometimes give an error. Any help is appreciated. 

.cmp
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
    <ltng:require styles="{!$Resource.modalCSS}" />
	<aura:handler name="init" value="{!this}" action="{!c.init}" />
    <lightning:flow aura:id="flowData" onstatuschange="{!c.handleStatusChange}" />
</aura:component>
controller
({
    init : function (component) {
        // Find the component whose aura:id is "flowData"
        var flow = component.find("flowData");
        // In that component, start your flow. Reference the flow's Unique Name.
        var inputVariables = [
            { name : "recordId", type : "String", value: component.get("v.recordId") }
        ];
		// Start flow
        flow.startFlow("Teamwear_Internal_Flow",inputVariables);
    },
    handleStatusChange : function (component, event) {
        //Check if flow is finished
        if(event.getParam("status") === "FINISHED") {
            //redirect to record to force refresh
            var sobjectEvent=$A.get("e.force:navigateToSObject");
            sobjectEvent.setParams({
                "recordId": component.get("v.recordId")
            });
            sobjectEvent.fire();
        }
    }
})
Error:
lightning component with flow error

 
I'm using a visualforce page and a custom controller to save some inputfields from inputfields in a repeater.. however the new inserted values are not being updated.

when i edit the inputcheck or inputfield and then press the command button to call my apex controller method. it doesn't pass the newly entered values and just updates again with the old values.

In case i didn't give enough code detail i can give more.

Page:
<apex:page controller="customController" >
    <apex:form>
        <apex:actionFunction action="{!closepopup}" name="closepopup" reRender="popup" oncomplete="restorescroll()">
        </apex:actionFunction>
    </apex:form>
    
    <apex:outputPanel id="popup">
        <apex:outputPanel id="outerpopup" styleClass="popupBackground" layout="block" rendered="{!displayPopUp}" onclick="closepopup()"/>
        <apex:outputPanel id="innerpopup" styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
            <div class="popupoverflow">
                <div class="popupcontent">
                    
                    {!fullcard.Name}<br/><br/><br/>
                    <apex:form >
                        <apex:repeat value="{!relatedworks}" var="rw">
                            <apex:inputCheckbox value="{!rw.Completed__c}"/>
                            <apex:inputField value="{!rw.name}">
                            </apex:inputField>
                            
                        </apex:repeat>
                        <apex:commandButton value="Hide Pop up" id="closebutton" action="{!closePopup}" rerender="popup"/>
                    </apex:form>
                    <chatter:follow entityId="{!cardId}"/>
                    <chatter:feed entityId="{!cardId}"/>
                </div>
            </div>
        </apex:outputPanel>
    </apex:outputPanel>
</apex:page>

Controller:
 
public list<VG_FR_Work__c> relatedworks {get;set;}
public string CardId {get;set;}
public boolean displayPopup {get; set;}

public void closePopup() {
        update relatedworks;
        displayPopup = false;
}

public void showPopup() {
        fullcard = [SELECT Id,Name,status__c,Long_description__c FROM VG_FeatureRequest__c WHERE Id =: cardId];
        relatedworks = [SELECT Id,Name,completed__c FROM VG_FR_Work__c WHERE VG_FeatureRequest__c =: cardId ];
        displayPopup = true;    
 }

 
Hey All,

I have a trigger which i thought was bulkified, however when mass updating records through gridbuddy i still get the to many soql queries error.

Any help is appreciated.

below is the code of the trigger.

the map query is where it errors: 
 
trigger Fill_OneOff_Lookups on VG_One_Off_Planning__c (before update, before insert) {
            
            system.debug('test1 in trigger');
    
            list<id> UserIDs = new list<id>();
    		list<User> CurrentUsers = new list<User>();
    
            for (VG_One_Off_Planning__c OneoffLine : trigger.new)
            {               
                system.debug('test2 in for ' + OneoffLine);
                
                if(OneoffLine.ContactID__c != null)
                {
                	OneoffLine.Contact__c = OneoffLine.ContactID__c;
                }
                                
                if(OneoffLine.Al_ID__C != null)
                {
                	OneoffLine.Account_Location__c = OneoffLine.AL_ID__c;
                }
                OneoffLine.Account__c = OneoffLine.Location_Account_ID__c;                 
                system.debug('test3 in trigger' + OneoffLine.User_Id__c);
                if(OneoffLine.User_ID__c != null)  
                {
                	boolean ExecuteCode = true;
                   	/* if(trigger.IsUpdate){
                    
                        VG_One_Off_Planning__c OldPlanningRecord = System.Trigger.oldMap.get(OneOffLine.Id);
                        system.debug('test3 in trigger update' + OldPlanningRecord);
                        if(OneoffLine.User_ID__c == OldPlanningRecord.User_ID__c){
                            ExecuteCode = false;
                        }
                    }*/
                	system.debug('test4 ' + ExecuteCode);                
                	//if(ExecuteCode == true){               
                	UserIDs.add(Id.valueOf(Oneoffline.User_ID__c)); 
                }
            }         
    
    		Map<Id,User> GetUsers = new map<Id,User>([SELECT Id, IsActive FROM User WHERE Id in :UserIDs]);
    		currentusers = GetUsers.values();
    
    
    		for (VG_One_off_Planning__c oneoff : trigger.new)
            {
               	for(integer index =0; index <  CurrentUsers.size(); index++)
                {
                	if(CurrentUsers[index].IsActive == true && oneoff.User_ID__c == CurrentUsers[index].Id )
                	{             
                		Oneoff.OwnerId = Oneoff.User_ID__c;
                	}
				}
			}
}

With kind regards,
Thomas
We are using a lightning component as quick action on a record, with a flow embedded in it. Now when someone open this quick action it sometimes give an error. Any help is appreciated. 

.cmp
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
    <ltng:require styles="{!$Resource.modalCSS}" />
	<aura:handler name="init" value="{!this}" action="{!c.init}" />
    <lightning:flow aura:id="flowData" onstatuschange="{!c.handleStatusChange}" />
</aura:component>
controller
({
    init : function (component) {
        // Find the component whose aura:id is "flowData"
        var flow = component.find("flowData");
        // In that component, start your flow. Reference the flow's Unique Name.
        var inputVariables = [
            { name : "recordId", type : "String", value: component.get("v.recordId") }
        ];
		// Start flow
        flow.startFlow("Teamwear_Internal_Flow",inputVariables);
    },
    handleStatusChange : function (component, event) {
        //Check if flow is finished
        if(event.getParam("status") === "FINISHED") {
            //redirect to record to force refresh
            var sobjectEvent=$A.get("e.force:navigateToSObject");
            sobjectEvent.setParams({
                "recordId": component.get("v.recordId")
            });
            sobjectEvent.fire();
        }
    }
})
Error:
lightning component with flow error

 
Hey,

I'm developing a lightning:datatable which supports the inline editing and multiselect functionality, however this doesn't seem to work with date or datetime.

Example:
My Datatable:
<lightning:datatable aura:id="relatedDataTable" columns="{!v.FieldList}" data="{!v.RecordsPage}"
                    keyField="Id" draftValues="{!v.draftValues}" onsave="{!c.handleSave}" oncancel="{!c.handleCancel}"
                    oncellchange="{!c.handleEdit}" sortedBy="{!v.sortedBy}" sortedDirection="{!v.sortedDirection}"
                    defaultSortDirection="{!v.defaultSortDirection}" onsort="{!c.updateColumnSorting}" onrowaction="{!c.handleRowAction}"
                    onrowselection="{!c.updateSelectedRow}" rowNumberOffset="{!v.rowOffset}" showRowNumberColumn="true" />
Example date column:
{fieldName:'Date__c', type:'date-local', label:'Date', sortable:true, editable:true}
The following happens:
The moment you try to check the "Update 3 selected items", the popup disappears and you are unable to set a date. It doesn't matter which order you try it. If you try to first set a date then check the checkbox the box disappears without posting the changes to the datatable. I have a feeling this has something to do with the way "focus" works on the date input. Even if you click right next to the date input, as soon as the input field loses focus, the box closes. the image below shows the scenario.

Does anybody know a solution to this? If this is a bug with the lightning:datatable, how do i notify Salesforce of this issue.
Lightning:datatable date multi edit



 
I want to use a child component for each record and iterate over it on the main component.  For some reason, the values don't show when I try to use this approach.

If I simply iterate and use the recordEditForm it works fine.  However, once I try to use the second component the values do not show.  Here is my iteration from the primary component:
 
<aura:iteration var="groupstructure" items="{!v.newGroupStructures}">
                  <c:GSCloneRecord groupstructure="{!groupstructure}"/>
            </aura:iteration>

Here is the GSCloneRecord Component.  I am unsure of  how to reference the values in teh groupstructure attribute.  I tried adding value= but that did not seem to work.  Any help would be greatly appreciated!!! thanks!!!!
 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId,lightning:isUrlAddressable" controller="GSController">
    <aura:attribute name="groupstructure" type="Group_Structure__c" />
	<!-- Handle component initialization in a client-side controller -->
	<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

    <lightning:recordEditForm
             
            objectApiName="Group_Structure__c">
            <!-- the messages component is for error messages -->
            <lightning:messages />
  <lightning:layout multipleRows="true" verticalAlign="center" >
      <lightning:layoutItem size="1" padding="around-Small" >
 						<lightning:inputField aura:id="Name" fieldName="Name"   />
      				</lightning:layoutItem>

      
      
      <lightning:layoutItem size="1" padding="around-Small" >
 		<lightning:inputField fieldName="Status__c"/>
      </lightning:layoutItem>
      
     <lightning:layoutItem size="2" padding="around-Small">
        <lightning:inputField fieldName="Funding_Type__c"/>
     </lightning:layoutItem>
      <lightning:layoutItem size="1" padding="around-Small" class="customRequired">
    <lightning:inputField fieldName="Group_Number__c"/>
     </lightning:layoutItem>
    <lightning:layoutItem size="1" padding="around-Small" class="customRequired">
    <lightning:inputField fieldName="Section_Code__c"/>
     </lightning:layoutItem>
      <lightning:layoutItem size="1" padding="around-Small" class="customRequired">
       <div class="LSELabel">
        <lightning:inputField fieldName="Package_Code__c" />
      </div>
    </lightning:layoutItem>
    <lightning:layoutItem size="2" padding="around-Small" class="customDates">
        <lightning:inputField fieldName="Effective_Date__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="2" padding="around-Small" class="customDates">
        <lightning:inputField fieldName="End_Date__c"/>
    </lightning:layoutItem>
      <lightning:layoutItem size="1" padding="around-Small" class="customProds">
        <lightning:inputField fieldName="Health_Product__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size=".5" padding="around-Small" class="customProds">
        <lightning:inputField fieldName="Prescription__c" />
    </lightning:layoutItem>
    <lightning:layoutItem size=".5" padding="around-Small" class="customProds">
      <lightning:inputField fieldName="Dental__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size=".5" padding="around-Small" class="customProds">
      <lightning:inputField fieldName="Vision__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="1" padding="around-Small" class="customProds">
      <lightning:inputField fieldName="CDH_Status__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="1" padding="around-Small" class="customRating">
      <lightning:inputField fieldName="Rating_Category__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="3" padding="around-Small" class="customRating">
      <lightning:inputField fieldName="Coverage_Categories__c"/>
    </lightning:layoutItem>
    <lightning:layoutItem size="1" padding="around-Small">
      <lightning:inputField fieldName="Prefix__c"/>
    </lightning:layoutItem>
      <lightning:layoutItem size="5" padding="around-Small">
        <lightning:inputField fieldName="Description__c"/>
    </lightning:layoutItem>
        </lightning:layout>
        </lightning:recordEditForm>

</aura:component>



 
  • November 20, 2018
  • Like
  • 0
We are using a lightning component as quick action on a record, with a flow embedded in it. Now when someone open this quick action it sometimes give an error. Any help is appreciated. 

.cmp
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
    <ltng:require styles="{!$Resource.modalCSS}" />
	<aura:handler name="init" value="{!this}" action="{!c.init}" />
    <lightning:flow aura:id="flowData" onstatuschange="{!c.handleStatusChange}" />
</aura:component>
controller
({
    init : function (component) {
        // Find the component whose aura:id is "flowData"
        var flow = component.find("flowData");
        // In that component, start your flow. Reference the flow's Unique Name.
        var inputVariables = [
            { name : "recordId", type : "String", value: component.get("v.recordId") }
        ];
		// Start flow
        flow.startFlow("Teamwear_Internal_Flow",inputVariables);
    },
    handleStatusChange : function (component, event) {
        //Check if flow is finished
        if(event.getParam("status") === "FINISHED") {
            //redirect to record to force refresh
            var sobjectEvent=$A.get("e.force:navigateToSObject");
            sobjectEvent.setParams({
                "recordId": component.get("v.recordId")
            });
            sobjectEvent.fire();
        }
    }
})
Error:
lightning component with flow error

 
I'm using a visualforce page and a custom controller to save some inputfields from inputfields in a repeater.. however the new inserted values are not being updated.

when i edit the inputcheck or inputfield and then press the command button to call my apex controller method. it doesn't pass the newly entered values and just updates again with the old values.

In case i didn't give enough code detail i can give more.

Page:
<apex:page controller="customController" >
    <apex:form>
        <apex:actionFunction action="{!closepopup}" name="closepopup" reRender="popup" oncomplete="restorescroll()">
        </apex:actionFunction>
    </apex:form>
    
    <apex:outputPanel id="popup">
        <apex:outputPanel id="outerpopup" styleClass="popupBackground" layout="block" rendered="{!displayPopUp}" onclick="closepopup()"/>
        <apex:outputPanel id="innerpopup" styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
            <div class="popupoverflow">
                <div class="popupcontent">
                    
                    {!fullcard.Name}<br/><br/><br/>
                    <apex:form >
                        <apex:repeat value="{!relatedworks}" var="rw">
                            <apex:inputCheckbox value="{!rw.Completed__c}"/>
                            <apex:inputField value="{!rw.name}">
                            </apex:inputField>
                            
                        </apex:repeat>
                        <apex:commandButton value="Hide Pop up" id="closebutton" action="{!closePopup}" rerender="popup"/>
                    </apex:form>
                    <chatter:follow entityId="{!cardId}"/>
                    <chatter:feed entityId="{!cardId}"/>
                </div>
            </div>
        </apex:outputPanel>
    </apex:outputPanel>
</apex:page>

Controller:
 
public list<VG_FR_Work__c> relatedworks {get;set;}
public string CardId {get;set;}
public boolean displayPopup {get; set;}

public void closePopup() {
        update relatedworks;
        displayPopup = false;
}

public void showPopup() {
        fullcard = [SELECT Id,Name,status__c,Long_description__c FROM VG_FeatureRequest__c WHERE Id =: cardId];
        relatedworks = [SELECT Id,Name,completed__c FROM VG_FR_Work__c WHERE VG_FeatureRequest__c =: cardId ];
        displayPopup = true;    
 }