0

enter image description hereI am Using visualforce component for insert and updating child record. this component is reusable for multiple objects, like account, contact, etc., as like we can use this. I am doing DML inside a component. this component just receives a parentId through attribute, and we need to perform adding rows (childRecords) and need to save. Please suggest me how to resolve this issue

marked as duplicate by Matt Lacey Jul 27 '16 at 6:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    Hi DSuresh, welcome to SFSE! Please take the time to visit the Help center and read How do I ask a good question. If you post the code for your component and any related controller, I'm confident you'll find plenty of people willing to assist you. – crmprogdev Jul 25 '16 at 14:07
  • @Dupada DS Have you fixed this? If so, please add the solution as answer and accept it. – Vignesh Jul 26 '16 at 7:30
  • Closing this as a dupe of another question even though this one came first — they clearly relate to the same error, but the other includes some more information and has what I believe to be the correct answer. – Matt Lacey Jul 27 '16 at 6:10
0

If you are receiving parentId through the attribute then before using parentId in the DML, use String.escapeSingleQuotes(parentId) and then use it in the DML.

Hopefully it will solve your problem.

Since you have not shared the code, it is just a guess.

Not the answer you're looking for? Browse other questions tagged or ask your own question.