I have two methods in my Apex controller that create/update a record
// Creating a new item
@AuraEnabled
public static Item__c newItemDB(Item__c item) {
insert item;
return item;
}
// Updating item
@AuraEnabled
public static Item__c updateItemDB(Item__c item) {
update item;
return item;
}
The problem I have is when they are executed, two of the fields are not displaying on the page because they are lookup relationships. When I refresh the page they do display.
How do I get lookup relationship data on these methods?
Update:
I did as you suggested and it works!
The problem now is my test classes are failing
System.AssertException: Assertion Failed:
Expected: TouchpointDev__Whiteboard_Item__c:{Name=Test Item 1, TouchpointDev__Item_Due_Date__c=2016-08-18 00:00:00, TouchpointDev__AssignedTo__c=005d0000006FYTHAA4, TouchpointDev__High_Priority__c=false, TouchpointDev__PersonalItem__c=true, TouchpointDev__Completed__c=false, Id=a00d000000k2s6iAAA},
Actual: TouchpointDev__Whiteboard_Item__c:{Id=a00d000000k2s6iAAA, Name=Test Item 1, TouchpointDev__PersonalItem__c=true, TouchpointDev__AssignedTo__c=005d0000006FYTHAA4, TouchpointDev__Completed__c=false, TouchpointDev__High_Priority__c=false, TouchpointDev__Item_Due_Date__c=2016-08-18 00:00:00}
All the data matches, but I think it's failing cause it's not in the order it needs be now. How do I fix that?
Item__c
again to get it's Parent's Name. – Praveen Aug 18 '16 at 17:39