Create Note via logic hook

Hello

I am attempting to create a ‘Note’ attached to a ‘Contact’ via a logic hook. The hook fires but the note is not created and no errors show up, I ran the log in debug mode and found this “INSERT INTO notes_cstm”, for some reason its attempting to insert into the notes_cstm instead of Note which obviously won’t work. I tried upgrading to the latest version but that didn’t help.

Has anybody encountered this before? Any suggestions as to why this is happening and how to rectify it>

Thanks

What are the conditions when the note needs to be created? It may be something that can be done using the workflow rules engine.

Thanks for your reply, the problem with using a workflow is that I need a field from a related module, which I cannot get via workflow.

The scenario is as follows

I have a custom module , Orders, that links to contacts with some additional data, so a simple many-to-many relation won’t work. When a contact is added I want to add a note related to the contact indicating they’ve been added to the Order. Its triggered from the Order/Contacts sub-panel so it contains the OrderID, but I want the OrderNo as the subject of the note, hence the logic hook instead of the workflow. If there is a way to pull the related field in workflow that would be great.

Figured it out, I was using the bean to insert and assigning it an ID, so its was updating instead of inserting, pretty silly mistake on my part.