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

Illegal assignment from List to Id
I'm getting this error from the following second-to-last line
RIM__c.name is an autonumber field; but when I try to run this test it is failing due to a required field not being completed. The RIM_Item.RIM__c field is required and I had it pulling the RIM__c id, then realized that it should be the value from the RIM__c.name field....
RIM__c.name is an autonumber field; but when I try to run this test it is failing due to a required field not being completed. The RIM_Item.RIM__c field is required and I had it pulling the RIM__c id, then realized that it should be the value from the RIM__c.name field....
RIM__c rtm = new RIM__c (); rtm.Customer_Name__c ='Test' ; rtm.Available_Account_Balance__c = 100 ; insert rtm ; RIM_Item__c item = new RIM_Item__c(); item.Item_Purpose__c = 'Test' ; item.Transaction_Type__c = 'Check' ; item.Transaction_Amount_Detail__c = 500 ; item.RIM__c = [select name from RIM__c where id = :rtm.id] ; insert item ;
All Answers
"System.DmlException: Upsert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [RIM__c]: [RIM__c]"
stack trace: "Class.multiAddRIM.save: line 20, column 1
Class.multiAddRIMTest.testcasePositive: line 29, column 1"
Also, I'm trying for 75% coverage and only getting 68
initialize the List <RIM_Item__c> RIMitemList at line 3 on Class
THANK YOU SO MUCH!
It started out so simple and then the test requirement threw me off.