EOleException in Custom Email Preview Gadget

Hello,

currently we are working on building a custom gadget for one of our customers to help him process incoming emails inside the crm.

The gadget we are working on alows a user to preview the incoming emails and assign them to a team and user.

On the right the users can click a communication that will be displayed in the gadget on the left. At the top of the left gadget are 2 dropdowns that alow selecting a team and user that the communication gets assigned to.

Unfortunetly we sometimes get an EOleException that says "Either BOF or EOF is True or the current record has been deleted. The requested action requires a record" (translated from german)

Using the SQL Profiler we were able track it down to a broken SQL query beeing executed by the CRM.

For some reason the CRM is looking for a communication with the ID 0 even though the Communication ID was given in the URL.

What is even more strange is the fact that in the query 3 lines below the red box starting with "select * from Communication" the communication id has the value that was provided in the URL.

Has anyone had this problem bevore and knows how to solve it ? We are working with CRM Version 7.2.j.4

What also meight be interresting is the fact that in our testing enviroment this error only ocures on maybe 1 in 10 clicked emails.

In the customers live System its more like every 7 in 10 Emails...

The preview is provided by a System Act that is usually used when viewing an Email in the CRM.

The URL is this:

http://<Server Name>/CRM/eware.dll/Do?SID=<Session ID>&Act=373&Mode=1&CLk=&Key0=6&Key6=<Some Communication ID>

Note that the Communication ID is never 0 or missing when that error ocures. However setting it to 0 or removing it intentionaly causes the same error to happen.

  • 0

    One of the things I would suggest is to have the custom gadget log the URL it was trying to process. You would then be able to confirm the way in which the path is built and perhaps give an idea why sometimes the communication id is 0.

    It could be that you are handling a variable that that is a string object rather than a primitive. It may be worth looking at what 'typeof' object you are handling and creating.

  • 0

    Hi Jeff,

    thanks for your response.

    Today i refactored the whole code of the gadget and now the bug does not appar as often anymore.
    Now its maybe a 1 in 20 chance in the test enviroment and the live system for it to apear.

    Im still not sure why this is happening though... While refactoring the code i added a console.log to capture the urls.

    Here is an example where i got the error:

    Object published by the list gadget and received by the custom gadget:
    Object { entityRecordId: "725", entityFilteredBy: "725", comm_communicationid: "725", comp_companyid: "400797", comm_datetime: "2016-11-29T18:15:20+01:00", comp_name: "Stephanie Brugger", comp_cs_ebayname: "pfaffi.123", comm_subject: "Details zum Artikel: pfaffi.123 hat…", comm_channelid: "1", cmli_comm_userid: "1" } gadgetEmailSimple.html:22:5

    This is the URL of the top frame of the gadget that alows selecting a team and user
    /CRM/CustomPages/Gadget/AssignEmail.asp?SID=184842442029315&Comm_CommunicationId=725

    And this is the URL of the bottom frame that shows the preview of the email
    /CRM/eware.dll/Do?SID=184842442029315&Act=373&Mode=1&CLk=&Key0=6&Key6=725

    As you can see the urls both include a valid Key6 for the system act and a valid Comm_CommunicationId for the custom asp page.

    What i think meight be happening is now that i changed the code the timing between the sql querys beeing executed is different.
    Maybe due to some really close timing the execution of the ASP page (top frame) was interfering with the execution of the system act used for the preview. But thats just a guess...