Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

JavaScript gives error in CRM Online

$
0
0

Hello,

I already have js files in the form library in CRM online.

I created a new form in Opportunity and added the library to the specific field on onSave event.

Its works fine. But when I add extra code to it, it gives an error. We have version 9.0.2

Code is given below

function AnnuityTotal()
{
var sumAnnuity=
Xrm.Page.getAttribute("new_estimatedalftotal").getValue() +
Xrm.Page.getAttribute("new_cloudpublic").getValue() +
Xrm.Page.getAttribute("new_thirdpartyservicestotal").getValue() + // I added this line and it started giving error. Even when I remove this line, it still gives an error.
Xrm.Page.getAttribute("new_dedicatedsupport").getValue() +
Xrm.Page.getAttribute("new_solutionspecificsupport").getValue() +
Xrm.Page.getAttribute("new_thirdpartysupport").getValue() +
Xrm.Page.getAttribute("new_customsupport").getValue();

var sumRev12 = Xrm.Page.getAttribute("new_hosting").getValue() * 12;
var sumRev22 = sumRev12 + Xrm.Page.getAttribute("new_hostingsetupfee").getValue();

Xrm.Page.getAttribute("new_annuitytotal1").setValue(sumAnnuity + sumRev22);
}

Error log

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Invalid XML.Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>32c46c68-f358-4d17-95c3-491220dcd86c</ActivityId>
<ErrorCode>-2147220991</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d2p1:key>ApiExceptionSourceKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Plugin/Microsoft.Crm.ObjectModel.WebResourceService</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiOriginalExceptionKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Microsoft.Crm.CrmException: Invalid XML. ---&gt; Microsoft.Crm.CrmException: Invalid XML.
at Microsoft.Crm.ObjectModel.WebResourceService.GetXmlDocument(String value)
at Microsoft.Crm.ObjectModel.WebResourceService.ValidateDependencyXML(WebResource webResource, ExecutionContext context)
at Microsoft.Crm.ObjectModel.WebResourceService.ValidateUpdateWebResource(WebResource webResource, ExecutionContext context)
at Microsoft.Crm.ObjectModel.WebResourceService.Update(IBusinessEntity entity, Boolean flushCache, ExecutionContext context)
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.&lt;&gt;c__DisplayClass1_1.&lt;Execute&gt;b__0()</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiStepKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">1cdb7d56-21c8-4b15-8e89-a78f8bc2f5a6</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiDepthKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">1</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiActivityIdKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">32c46c68-f358-4d17-95c3-491220dcd86c</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiPluginSolutionNameKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiStepSolutionNameKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>Invalid XML.</Message>
<Timestamp>2018-04-27T04:10:55.8207966Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

Any suggestions please?

Thank you.


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>