On the Lightning for Outlook, I do have a record creation button component. Clicking on it gets the custom record type selection. Based on what we choose(radio button), force:createRecord event fires.


<aura:iteration items="{!v.RTypeList}" var="rType"> 
   <span class="slds-radio">
        <input type="radio" aura:id = "radioId"  id="{!rType}" name="options" value="{!rType}" />
        <label class="slds-radio__label" for="{!rType}">
           <span class="slds-radio--faux"></span>
           <span class="slds-form-element__label">{!rType}</span>

NOTE: RTypeList contains all the record type labels(using controller class).


var rTypeLabel= document.querySelector('input[name="options"]:checked').value;
    var action = component.get("c.getRTypeId");

        "rTypeLabel": rTypeLabel

    action.setCallback(this, function(response) {
    var state = response.getState();
    if (state === "SUCCESS") {
            var createRecordEvent = $A.get("e.force:createRecord");
            var RTID  = response.getReturnValue();
                "entityApiName": 'Account',
                "recordTypeId": RTID  

        } else if (state === "ERROR") {
           alert("ERROR! Please contact support!");


public static Id getRTypeId(String rTypeLabel){
    System.debug('From Class: ' +rTypeLabel);
    if(rTypeLabel!= ''){
        Id rtypeid = Schema.SObjectType.Account.getRecordTypeInfosByName().get(recordTypeLabel).getRecordTypeId();        
        return rtypeid ;
    return null;

Every time I run this component on an LightningAPP (to preview), debug log returns me the correct record type label. But when I run this same component on the "Lightning for Outlook", I get the log as "From Class: on" thus throwing me the error. Where I am doing wrong?

1 Answer 1


Well, after spending few extra hours than usual, I was able to fix it. The problem with my code lies within the document.querySelector. As per my <input type="radio" implementation, I do not need value, rather I need to query id. Like this:

var rTypeLabel= document.querySelector('input[name="options"]:checked').id

But hey, when I query 'value' instead of 'id', it worked well on Google Chrome(verified console) and I got the state as SUCCESS. But on the Internet Explorer and the Lightning For Outlook plugin, it didn't worked. So my trial-and-error with id worked on both. Hope someone who's stuck with this kind of issue find my post helpful.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .