You need to sign in to do that
Don't have an account?

Closing the Modal using X on the top right still creates a Task - e.force:createRecord
I am using e.force:createRecord to create Task. When the Task window opens I do nothing - just close it using X on the top right corner of the modal. But still it creates a Task. Any way to rectrict that
lightning:button class="form-control" aura:id="btnTask" label="Create Task" onclick="{!c.createTask}"/>
createTask : function (component, event, helper) {
var task= $A.get("e.force:createRecord");
task.setParams({
"entityApiName": "Task",
"defaultFieldValues": {
'Subject' :' Test Task'
}
});
createRecordEvent.fire();
}
lightning:button class="form-control" aura:id="btnTask" label="Create Task" onclick="{!c.createTask}"/>
createTask : function (component, event, helper) {
var task= $A.get("e.force:createRecord");
task.setParams({
"entityApiName": "Task",
"defaultFieldValues": {
'Subject' :' Test Task'
}
});
createRecordEvent.fire();
}
This is all the code for my component and controller.
Regards
Sudipta
createRecordEvent.fire();
to
task.fire();
based on the code from the original post
lightning:button class="form-control" aura:id="btnTask" label="Create Task" onclick="{!c.createTask}"/>
createTask : function (component, event, helper) {
var task= $A.get("e.force:createRecord");
task.setParams({
"entityApiName": "Task",
"defaultFieldValues": {
'Subject' :' Test Task'
}
});
task.fire();
}