2tes Notiz-Feld auf einer Entität

15. Oktober 2014 11:42

Hallo zusammen,

wir haben die Anforderung, auf einer Entität mehrere Notizfelder pflegen zu können.
Leider wird immer nur ein Notizfeld im Standard erlaubt.

Die Anforderung wäre genau:
So wie das Notizfeld sollen Einträge gemacht werden, der Benutzer und die Zeit und das Datum muss mitgeloggt werden, quasi das Feld Notiz, wie es aufgebaut ist, wäre perfekt.

Nach ein bisschen googlen bin ich auf folgende Anleitung gestoßen:


I looked into being able to host the Notes list from a related entity in an IFRAME of a parent entity. It works but with unfortunate caveat.

What to do

Create a new Entity, for instance 'Alternate Notes'
Create N:1 relationship between 'Account' and 'Alternate Notes'
Place the corresponding 'Alternate Notes' lookup attribute on the Account form
Upon creation of an 'Account' entity instance, create and attach an 'Alternate Notes' entity instance via Workflow
Create an IFRAME in Account; populate the src with the following:
var lookupItem = crmForm.<alternatenoteslookupattribute>.DataValue;

if (lookupItem != null) {
crmForm.all.IFRAME_AlternateNotes.src = prependOrgName("/_controls/notes/notesdata.aspx?id="+ lookupItem[0].id + "&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false");
}
else {
crmForm.all.IFRAME_AlternateNotes.src = "about:blank";
}
The IFRAME will now display a Notes viewer that looks exactly the same as for those attached to the Account, but the content will correspond to the attached 'Alternate Notes' entity instance.

The caveat

Unfortunately, the code behind the Notes control "hardcodes" the "parent" entity instance for the Notes being edited/added to be the GUID of the entity for which the form is being displayed (ie. the 'Account'), not the GUID of the entity that is passed to "notesdata.aspx" (ie. the 'Alternate Notes').

This causes all attempts to add/edit Notes to fail with the following error:

"The requested record was not found or you do not have sufficient permissions to view it"

For this reason, you must make sure that the following parameters are set to false, as per the example above:

EnableInlineEdit=false&EnableInsert=false
So, the Notes control will "look" just like the 'Account' notes while displaying notes for the 'Alternate Notes', but you can't edit them directly. To edit, you must click on the 'Alternate Notes' lookup field and edit the Notes there.

A bit clunky, but not bad, if it's more important to you to display the notes in a common format, than to edit them inline.



Meine Frage an Euch wäre, ob Ihr vielleicht einen einfacheren Weg dafür kennt.
Ich brauche quasi ein "Lebenszyklus"-Feld wie Notiz, anhängen von Datein wäre auch super. Eben genau wie Notiz.

Viele Grüße
liq

Re: 2tes Notiz-Feld auf einer Entität

16. Oktober 2014 08:19

Hallo,
ich kann zwar nicht verstehen, warum mehrere Notizfelder benötigt werden, ich kann ja zum einen mehrere Notizen hinterlegen und zum anderen sind die Daten in Notizfelder unstrukturierte Daten die nicht durchsucht und indiziert werden können.
Aber egal, das müsst ihr ja wissen. Es gibt im Standard keine Möglichkeit, mehrere eigenständige Notizfelder auf eine Entität zu bringen und dein Workarround erlaubt in den zusätzlichen Notizen auch keine Anhänge.