I am learning how to use Aura to create lightning components for record pages inside of salesforce. All I am trying to do at this point is to print the name of the Record (I'm testing with account records). However, whenever I try to save the helper file I get this error:
FIELD_INTEGITY_EXCEPTION Failed to save Pic2Helper.js: null: Source
Here is the code I am using:
Pic2.cmp (main component):
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" controller = "LightTest" >
<aura:handler name="init" action="{!c.doInit}" value ="{!this}"/>
<aura:attribute name="thisAccount" type="Account"/>
Here it is: {!v.thisAccount.Name}
</aura:component>
Pic2Controller.js:
({
doInit : function(component, event, helper) {
component.get("v.recordId");
helper.getOb(component);
}
})
Pic2Helper.js (the file that won't save):
({
getOb : function(component) {
var action = component.get("c.getAccount");
action.setParams("inID" : component.get("v.recordId"));
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
component.set("v.thisAccount", response.getReturnValue());
}
else {
console.log("Failed with state: " + state);
}
});
$A.enqueueAction(action);
} ,
})
LightTest.apxc (Controller):
public with sharing class LightTest {
@AuraEnabled
public static String getAccount(String inId){
List<Account> boi = [select Name from Account where id = :inId];
Account it = boi.get(0);
return it.Name;
}
}
I am really lost and don't know where to even start to see what I did wrong. Any help on why that error is happening or anything else I have inevitably messed up would be much appreciated.
Thanks!