Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:44:20+00:00 2026-06-08T05:44:20+00:00

Setup I’m adding an appointment to a custom entity in an on site CRM

  • 0

Setup

I’m adding an appointment to a custom entity in an on site CRM 2011.

  • I click the “New Activity” button on the Ribbon, select Appointment, then Ok.
  • On the new window that opens, I F12 to open the IE debugger, and select the Script tab, set a break point both in my onLoad function, and in the crmForm_window_onload_handler of the FormScript.js.aspx file, and click the start debugging button.
  • I then reload the appointment window.

Issue

The break point in crmForm_window_onload_handler hits, but when I step into what should be the onLoad function of my custom js web resource file (appointment.js), rather than stepping into the onLoad function of my appointment.js file, it steps into the onLoad of an exact copy of my file, only it’s name is script block (some random number from 0-99) ie script block(23). Why are these script blocks being created? In the on Save I’m also running this code:

Xrm.Page.getAttribute('new_issyncreqd').setValue(true);
Xrm.Page.getAttribute('new_issyncreqd').setSubmitMode("always");

But it’s not actually saving and I’m guessing it’s related to the script blocks…


Update

I did figure out why the code that is updating the IsSyncReqrdField is not working. This is for on Site CRM 2011 version V 5.0.9690.1992 (rollup 6). It apparently has a bug for the Appointment entity where it saves the entity first, then actually runs the custom onSave code. This is how it currently looks:

function crmForm_onsave_handler(eventObj,eventArgs)
{
  try
  {
    var eContext=Mscrm.FormUtility.constructExecutionObject(eventObj,0,eventArgs,null);
    eContext = Mscrm.FormUtility.constructExecutionObject(eventObj,0,eventArgs,eContext)
    Mscrm.Form_onsave();
    eContext=Mscrm.FormUtility.constructExecutionObject(eventObj,1,eventArgs,eContext)
    NEW.Appointment.onSave(eContext); // <-- My custom OnSave Handler 
  }
  catch(e)
  {
    displayError('crmForm', 'onsave', e.description);
  }
}

The bug is that the Mscrm.Form_onsave(); line is actually saving the record to the database, so when the custom event handler runs, it’s already been saved, and any updates made in the custom event handler won’t update the record.

The fix for this bug is to set bSaveInProgress = true; in the onLoad of the form, and then
bSaveInProgress = !isValid;
event.returnValue = isValid;
in the onSave. The bSaveInProgress = true; will keep Mscrm.Form_onsave(); from actually saving the recrod and the event.returnValue will actually cause it to be created. It works and is a hack, but it’s the only thing I’ve come up with to work around this bug…


The Problem Remains

Why are script blocks being created and executed instead of using the file that is already there?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:44:23+00:00Added an answer on June 8, 2026 at 5:44 am

    First, script blocks are created when inline javascript is coming from an XML or SVG file.

    This is a known IE issue (scan for “script block”): http://msdn.microsoft.com/en-us/ie/ff959805.aspx

    You can see the XML files, by usingthe “Network” tab in IE9 and then capturing a form load. There should be a few aspx files that are actually XML. An example is RenderGridView.aspx.

    So the problem is that the aspx file is being retrieved again and then executing the inline function replacing the former script block (since javascript operates as a single global file).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I setup a site on a new server using Plesk and I'm using site
Setup I am using custom Forms Authentication - all standard stuff. In the Login
Setup: I have a combo-box, it's itemsource bound to an ObservableCollection<T> of a custom
Setup: Windows Server 2003 / SQL Server 2005. ASP.NET 2.0. IIS 6. The site
Setup: I have a form and a Submit button. Ideally the user should fill
Setup: I'm opening a new window via js that is a classic asp page
SETUP: Using Google Apps Script's UI (doGet) with tabPanel option. At the bottom of
Setup: A--< B >-- C . On A there is a RFS on B,
setup.py from distutils.core import setup import py2exe setup(console=['program.py']) The error Traceback (most recent call
Setup iMac 10.7.4, Eclipse Indigo, Pydev, Python 2.7 I’m trying to install the Tweepy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.