locked
CRM Form not Saving After Polaris Update RRS feed

  • Question

  • After the Polaris update was deployed to our CRM Online 2011 organization, a ribbon button which triggers a JavaScript function that saves the form no longer works.  Our organization uses the Connector for Microsoft Dynamics GP solution with a customized Account entity.  Its form has a custom ribbon button, Submit, which triggers the JavaScript, below.

    function Dynamics_Integration_account_Form_Group0_Control0_1()
    {
    	if(crmForm.all.dynamics_isreadyforintegration.DataValue == false)
    	{
    		crmForm.all.dynamics_isreadyforintegration.DataValue = true; 
    		crmForm.all.dynamics_isreadyforintegration.Disabled = true; 
    		crmForm.all.dynamics_isreadyforintegration.ForceSubmit = true; 
    		crmForm.all.dynamics_integrationkey.ForceSubmit = true; 
    		crmForm.all.accountnumber.ForceSubmit = true; 
    		crmForm.all.address1_name.ForceSubmit = true;
    	}	
    	crmForm.Save();
    }

    The code to set the dynamics_isreadyforintegration Radio button to true and disable it works.  Upon Save, the Form is supposed to be refreshed and the Submit button should become disabled if the dynamics_isreadyforintegration property is true, but it doesn't anymore.  The dynamics_isreadyforintegration property is not acutally saved.

    The ribbon button's code definition is:

    <JavaScriptFunction FunctionName="Dynamics_Integration_account_Form_Group0_Control0_1" Library="$Webresource:account_ribbon_connector.js" />

    And the Enable rule is:

    <EnableRule Id="Dynamics.Integration.account.form.NotReady.EnableRule"> <FormStateRule State="Create" InvertResult="true" /> <ValueRule Field="dynamics_isreadyforintegration" Value="false" /> </EnableRule>

    Our CRM Online 2011 is now at version 5.0.9690.3233.

    Thanks in adavance.

    Monday, January 28, 2013 6:55 PM

Answers

  • I'd wager because the CRM 4.0 / "crmForm" syntax is no longer supported the functionality no longer works.

    Might have to convert it to something like this:

    function Dynamics_Integration_account_Form_Group0_Control0_1()
    {
    	if(Xrm.Page.getAttribute("dynamics_isreadyforintegration").getValue() == false)
    	{
    		Xrm.Page.getAttribute("dynamics_isreadyforintegration").setValue(true); 
    		Xrm.Page.getControl("dynamics_isreadyforintegration").setDisabled(true); 
    		Xrm.Page.getAttribute("dynamics_isreadyforintegration").setSubmitMode("always"); 
    		Xrm.Page.getAttribute("dynamics_integrationkey").setSubmitMode("always"); 
    		Xrm.Page.getAttribute("accountnumber").setSubmitMode("always"); 
    		Xrm.Page.getAttribute("address1_name").setSubmitMode("always");
    	}	
    	Xrm.Page.data.entity.save();
    }
    I believe this code might get updated automatically if you update the connector to the latest version.


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn



    Monday, January 28, 2013 7:19 PM
    Moderator

All replies

  • I'd wager because the CRM 4.0 / "crmForm" syntax is no longer supported the functionality no longer works.

    Might have to convert it to something like this:

    function Dynamics_Integration_account_Form_Group0_Control0_1()
    {
    	if(Xrm.Page.getAttribute("dynamics_isreadyforintegration").getValue() == false)
    	{
    		Xrm.Page.getAttribute("dynamics_isreadyforintegration").setValue(true); 
    		Xrm.Page.getControl("dynamics_isreadyforintegration").setDisabled(true); 
    		Xrm.Page.getAttribute("dynamics_isreadyforintegration").setSubmitMode("always"); 
    		Xrm.Page.getAttribute("dynamics_integrationkey").setSubmitMode("always"); 
    		Xrm.Page.getAttribute("accountnumber").setSubmitMode("always"); 
    		Xrm.Page.getAttribute("address1_name").setSubmitMode("always");
    	}	
    	Xrm.Page.data.entity.save();
    }
    I believe this code might get updated automatically if you update the connector to the latest version.


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn



    Monday, January 28, 2013 7:19 PM
    Moderator
  • Thank you, all.

    Funny, I saw @Andrii's reply first.  I had already spent a week with MS Support before they mentioned checking the "Include HTC Support" box.  That allowed the old JavaScript to execute for forms.  So, I incorrectly assumed it would allow JavaScript to run within the Ribbon.

    But it made me think... and I did exactly what you suggested, @Jason,  and it worked.

    So, my next dilemma are...

    • I am new to CRM, and I inherited this site.  Where else could there be custom CRM 4.0 API code?
    • We're also using Dynamics Labs Donation Management solution, which seems to be no longer available.  It has lots old code.
    • I would love to find out how the Connector was installed in the first place, let alone upgrade it.
    • When is the next major release?  They say CRM 4.0 API code will no longer be supported after that.
    • Where is there a difinitive site that shows one-to-one code changes from CRM 4.0 API to CRM 2011?

    Regards,

    -Dave

    Tuesday, January 29, 2013 12:18 PM
  • Tuesday, January 29, 2013 1:28 PM
    Moderator