Add notes to contact Dynamically

Vote:
 

We are using Episerver commers 8.16.1 and I am looking for a way to add notes to the customer dynamicly. Any Help would be appreciated. 

#142809
Dec 29, 2015 20:55
Vote:
 

Hi,

By dynamically you mean programmatically? By code?

/Q

#142816
Dec 30, 2015 17:31
Vote:
 
var note = new EntityObject("ContactNote");
note["ContactId"] = new PrimaryKeyId(new Guid("{id-of-your-customer-contact}"));

note["NoteTitle"] = "...";
note["NoteContent"] = "...";

var pk = BusinessManager.Create(note);

Other properties you may be interested in:

- CreatorId

- ModifierId

- NoteType

#142825
Dec 30, 2015 23:36
Vote:
 

Yes by code. I need to add a note to the customer object much like a note can be added to the order object. So that the note will be viewable in the commers manger when you are looking at contat->notes.

#142828
Dec 31, 2015 18:14
Vote:
 

As you want to see this field in Commerce Manager, therfore you can create a metafield (Notes) for Contact Object, Update that field in your code, pseudo code will be something like

customContact["NewMetafIeld"] = "customer notes"
customContact.saveChanges()

Regards

/K

#142834
Jan 03, 2016 18:01
Vote:
 

There are 2 types of built-in notes for contact object: ordinary notes and order notes. code above adds new ordinary note to the contact and it's available for admins via Commerce Manager UI.

#142835
Jan 03, 2016 20:45
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.