Skip to main content
added 6 characters in body
Source Link
Ashwani
  • 22.7k
  • 4
  • 41
  • 73

According the logic you have written, it looks like that you are trying to store value of input text to the Sobject's lookup field. For example if you have TestG2, you are trying to assign it to Lookup type field which ultimately trowwill throw exception when insert/update happen.

Reason is lookup fields always have Id of the records instead of name. So, you typehead component showing those value must have Id behind as they are record of some object. Store and set that Id to inputText instead of the name visible on page.

According the logic you have written, it looks like that you are trying to store value of input text to the Sobject's lookup field. For example if you have TestG2, you are trying to assign it to Lookup type field which ultimately trow exception when insert/update happen.

Reason is lookup fields always have Id of the records instead of name. So, you typehead component showing those value must have Id behind as they are record of some object. Store and set that Id to inputText instead of the name visible on page.

According the logic you have written, it looks like that you are trying to store value of input text to the Sobject's lookup field. For example if you have TestG2, you are trying to assign it to Lookup type field which ultimately will throw exception when insert/update happen.

Reason is lookup fields always have Id of the records instead of name. So, you typehead component showing those value must have Id behind as they are record of some object. Store and set that Id to inputText instead of the name visible on page.

Source Link
Ashwani
  • 22.7k
  • 4
  • 41
  • 73

According the logic you have written, it looks like that you are trying to store value of input text to the Sobject's lookup field. For example if you have TestG2, you are trying to assign it to Lookup type field which ultimately trow exception when insert/update happen.

Reason is lookup fields always have Id of the records instead of name. So, you typehead component showing those value must have Id behind as they are record of some object. Store and set that Id to inputText instead of the name visible on page.