1

I'm using "quick Action" on Task object in order to replace an old js button. I tried to replace some ajax toll queries with "recordData" and use the data in the controller. the result is always null.

I tried both - default and layoutType="FULL", same results null.

<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId,force:lightningQuickAction" controller="wsc_checkResponse">
    <aura:attribute name="record" type="Task" />

<force:recordData layoutType="FULL"
                  recordId="{!v.recordId}"
                  targetFields="{!v.record}"
                  recordUpdated="{!c.recordUpdate}" />
    <aura:attribute name="taskWhoId" type="id"/>

    <force:recordData aura:id="recordLoader"
    recordId="{!v.recordId}"
    fields="WhoId"
    targetFields="{!v.taskWhoId}"
    targetError="{!v.recordLoadError}"
    recordUpdated="{!c.onTaskLoadingCompleted}"
    />
    <div class="Record Details"> 
        <lightning:card iconName="standard:account"  >
            <div class="slds-p-horizontal--small">
                <p class="slds-text-heading--medium"><lightning:formattedPhone title="taskWhoId" value="{!v.record.Id}" /></p>
                <p class="slds-text-heading--medium"><lightning:formattedPhone title="taskWhoId" value="{!v.record.taskWhoId}" /></p>
            </div>
        </lightning:card>
    </div>
</aura:component>

ctrl.js

({
    recordUpdate: function(component, event, helper){
        console.log('record',component.get("v.record"));
    },
    onTaskLoadingCompleted : function(component, event, helper) {
    var taskWhoId = component.get("v.taskWhoId");
        console.log('taskWhoId',taskWhoId);

    }
})

task record or at last WhoId is expected but nada.

Herohtar
  • 5,347
  • 4
  • 31
  • 41
yuval boim
  • 15
  • 5

1 Answers1

0

Like other base Lightning components, including <lightning:recordEditForm>, <force:recordData> does not support the Task or Event objects.

The list of supported objects is here, in the Lightning Aura Components Developer Guide. The underlying limitation appears to come from the UI API, which doesn't support Task and Event.

David Reed
  • 2,522
  • 2
  • 16
  • 16
  • I think there is something else going on in the quick actions, as I am using opportunity and doesnt load, however when i use my lightning component inside a vf page it loads correctly – Manza Jun 24 '19 at 06:35