Scenario 1: The Problem
We are developing a Booking System for the client, at one point during the requirements gathering we discovered that we will need either another Notes tab on one of the entities alternatively some way of associating multiple notes with a particular entity / event.
Scenario 1: The Investigation
Went happily out on the web to google away…
The findings were however very meagre, found the following:
The findings were however very meagre, found the following:
“I am trying to reference the notes from a related entity (e.g car entity notes) within an entity (e.g. case entity with a tab for car notes). What i did was opened up the entity (car entity) which contains the note (annotation) and got the src by hovering over the 'Click here to enter new note' (and also through the debugging tools).
The src is: /_controls/notes/notesdata.aspx?id={'GUID NUMBER HERE'}&ParentEntity=10045&EnableInlineEdit=true&EnableInsert=true
When i then put the full src url into the case entity car notes tab, the notes display there. I can edit the notes but cant create a new note. I get an error message "The requested record was not found or you do not have sufficient permissions to view it."
When I put it the actual record entity url into the src e.g userdefined/edit.aspx?id={'GUID NUMBER HERE'}&etc=10045&oType=2&security=852023" it shows the whole record form and I can create new notes etc but it looks messy as the Menus e.g. Save & Close etc and the details section are all visible within the iframe...NOT COOL AT ALL!
I think the issue with the first src url is that im referencing the notes from another entity within a different entity. Anyone have any ideas on how or what other parameters I can pass or something?
P.S I made sure that the entity ID im passing is correct, its showing the correct notes - just cant save it!”
Well, I, being a novice on CRM was happy because this at least got me on the right track as to where to begin in the first place. I went ahead coding happily.
And here is what happened:
Created a custom entity to be a container for the additional Notes:
Added the required 1:N relation between the new CustomerNote entity and the entity where the new Notes Tab and the Iframe will be added:
Modifying the entity where I am adding a new Tab with an Iframe: i.e. adding the new Tab, new section and the new Iframe to hold the Notes entity:
This is where the fun begins, according to the article found on the web (and others similar to it) we now need to enter the URL to the new custom entity and to the page that will handle the notes. The url should be:
/_controls/notes/notesdata.aspx?id={61DD79D5-C825-E011-81C9-8BF184968426}&ParentEntity=10029&EnableInlineEdit=true&EnableInsert=true&security=852023
Where the GUID is the ID of the new custom entity derived by simply looking into the CRM database in the table [YOUR_CRM_INSTANCE].[MetadataSchema].[Entity] like this:
And the ParentEntity Type is found in the same table on the entity that holds the Tab and Iframe:
And the resulting URL string will then be something like this:
So far so good, all set to Save and Publish and here we go:
Oooops…..
Scenario 1: The Actual Error
The person reading this with some eye for the tiniest detail will say, HEY, Wait a minute, what is this I see in the corner???
Remember when we started this little adventure we were here:
And NOW when we get our frustrating ERROR we are here:
Wait a moment…. What is going on here?
AHA! We do have actually 3 CRM ORGANIZATIONS on the server…. Kollo, SSM and SIIW but there is only one installation of CRM and only one instance of /_controls/notes/notesdata.aspx if we care to have a look in the CRM Deployment Manager we will find that the SIIW instance is set as the DEFAULT instance and following that path CRM is trying to add our notes records into that SIIW instance and since there is no entity called CustomerNotes there….. CRASH#¤%¤
AHA! We do have actually 3 CRM ORGANIZATIONS on the server…. Kollo, SSM and SIIW but there is only one installation of CRM and only one instance of /_controls/notes/notesdata.aspx if we care to have a look in the CRM Deployment Manager we will find that the SIIW instance is set as the DEFAULT instance and following that path CRM is trying to add our notes records into that SIIW instance and since there is no entity called CustomerNotes there….. CRASH#¤%¤
Scenario 1: The Solution
The solution to this particular problem is as simple as it is brilliant:
Just put the fully qualified URL in the Iframe URL field like this:
&EnableInsert=true&security=852023
Alexander Berggren
CRM Rookie Of The Year
Inga kommentarer:
Skicka en kommentar