You need to sign in to do that
Don't have an account?
Abhishek Sharma 527
create look up relationship on child object
Hello there, I was given a task to -
i)create custom object invoice with field total amount
ii)create child object invoice line item with lookup relationship to invoice
iii)add price field into invoice line item
I have created 'invoice' object and field 'total amount'
now how to create lookup relation on child object
I'm confused whether we can create relationship on object, it can be created on fields only as I know or maybe something I don't know on this.
can anyone plz guide.
i)create custom object invoice with field total amount
ii)create child object invoice line item with lookup relationship to invoice
iii)add price field into invoice line item
I have created 'invoice' object and field 'total amount'
now how to create lookup relation on child object
I'm confused whether we can create relationship on object, it can be created on fields only as I know or maybe something I don't know on this.
can anyone plz guide.
You need to insert the id for the lookup fields. or
If this helps, please mark it as best answer.
Thanks!!
All Answers
1.Create another object called invoice line item.
2. create price field.
3. create a lookup field, which is lookup to Invoice object.
If this helps, Please mark it as best answer.
Thanks!!
Now you need to create a new custom object InvoiceLineItem, and after creation this create a lookup type field and link with invoice object.
Now Invoice object will be parent and InvoiceLineItem will be child.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
now, when i'm inserting record using anonymous window with this code, it showing error - System.StringException: Invalid id: Hardware shop
//my code -
Invoice_Line_Item__c il = new Invoice_Line_Item__c(
Name = 'Entry 1',
Invoice__c = 'Hardware shop'
);
insert il;
this is my invoice line item page (I can add records from here but I was trying to do from anonymous window, so can you plz guide )
You need to insert the id for the lookup fields. or
If this helps, please mark it as best answer.
Thanks!!