We use a session cookie as anonymous ID for your visit. View our privacy policy to learn more.

Welcome Guest : please login to be able to post Search | Active Topics | Log In | Register

CRM, sData and Sage 50 Options · View
Mr Mick Lowe
Posted: Friday, July 27, 2012 9:16:16 AM
Rank: Member

Joined: 7/27/2012
Posts: 3
Hi,

Have a strange issue trying to connect CRM gadgets to Sage 50 using SData feeds, I can successfully create a gadget which display a list of customers. When I try to create one for sales orders/sales invoices I get the following error:

An error occurred when attempting to process the Gadget. Please contact your System Administrator.

I know there are invoices in the data (about 60,000) so not sure why I can't retrieve the data? Any help appreciated.

Mick
Darron Cockram
Posted: Monday, July 30, 2012 3:29:19 AM
Rank: Advanced Member

Joined: 10/13/2010
Posts: 289
What version of Accounts are you using? I'm not familiar with the CRM gadgets but there's a couple of things I would suggest checking:

- Are there any errors in the logs?
- Can you view the same feed directly in a web browser or do it give an error?
Mr Mick Lowe
Posted: Monday, July 30, 2012 4:00:06 AM
Rank: Member

Joined: 7/27/2012
Posts: 3
Hi Darron,

Accounts are Sage 50 2012.

Pasting the link into a browser returns the following:


<diagnosis xmlns="http://schemas.sage.com/sdata/2008/1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sdatasync="http://schemas.sage.com/sdata/sync/2008/1"xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sdata="http://schemas.sage.com/sdata/2008/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sme="http://schemas.sage.com/sdata/sme/2007" xmlns:http="http://schemas.sage.com/sdata/http/2008/1">
<sdata:severity>error</sdata:severity>
<sdata:sdataCode>ApplicationDiagnosis</sdata:sdataCode>
<sdata:applicationCode xsi:nil="true"/>
<sdata:message>
Exception of type 'System.OutOfMemoryException' was thrown.
</sdata:message>
<sdata:stackTrace>
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity) at System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength) at System.Text.StringBuilder.Append(String value) at Sage.Integration.Presentation.Xml.XmlGeneratorContext.Append(String value) at Sage.Integration.Presentation.Xml.XmlGeneratorContext.AppendFormat(String format, String[] args) at Sage.Integration.Presentation.LabelAction.OnRenderAttributes(XmlGeneratorContext context, PresentationActionResult result) at Sage.Integration.Presentation.PresentationAction.BeginRender(Object context, Object result) at Sage.Integration.Presentation.Xml.XmlGeneratorContext.BeginRender(Int32 id, Object value) at DynamicActionProcessor495c4f4cac4043c98aa7a67bb20f617f.Process(Object , Object , Object ) at Sage.Integration.Presentation.Xml.XmlContentGenerator.XmlContentGeneratorInstance.Generate(IRequest request, FeedEntry feedEntry, MediaType mediaType) at Sage.Integration.Presentation.Xml.XmlContentGenerator.GenerateXml(IRequest request, FeedEntry feedEntry, String name, PresentationSchemaType schemaType, MediaType mediaType) at Sage.Integration.Presentation.Html.HtmlContentGenerator.GenerateHtml(IRequest request, FeedEntry feedEntry, String name, PresentationSchemaType schemaType) at Sage.Integration.Presentation.ContentGenerator.GenerateHtml(IRequest request, FeedEntry feedEntry, String name, PresentationSchemaType schemaType) at Sage.Integration.Presentation.ContentGenerator.Process(IRequest request) at Sage.Integration.Messaging.Request.ProcessResponse(IResponse response, IRequest request) at Sage.Integration.Messaging.Request.OnPostProcessRequest() at Sage.Integration.Messaging.Request.Process(RequestTargetInvoker invoker) at Sage.Integration.Adapter.AdapterController.RealAdapterController.Process(IRequest request) at Sage.Integration.Adapter.AdapterController.RealAdapterController.ProcessWorker(IProtocolRequest protocolRequest) at Sage.Integration.Adapter.AdapterController.Process(IProtocolRequest request) at Sage.Integration.Messaging.MessagingService.Process(IProtocolRequest protocolRequest)
</sdata:stackTrace>
<sdata:payloadPath/>
</diagnosis>

Regards

Mick
Darron Cockram
Posted: Monday, July 30, 2012 8:32:04 AM
Rank: Advanced Member

Joined: 10/13/2010
Posts: 289
If you're getting a problem in the browser it's reasonable to assume that it's the same problem with the CRM gadget.

As you mentioned that there are 60,000 invoices it's possibly not too surprising to see the OutOfMemoryException if CRM is trying to return all the records in one hit.

The results of an Sdata query are returned as XML by default and a quick check on a feed with 1 invoice on my PC shows that this is ~26.5KB in size. The exact size will vary of course but, if my maths are correct, this means that to return all records we'd be looking at a little over 1.5Gb of memory required. As the call stack indicates a string creation this memory would have to be contiguous so, even on a system with a lot of RAM, it's pretty unlikely that there is enough memory available for such a large amount of data.

It should be straightforward enough to confirm if the volume of data is the problem by restricting the number of records returned. Try this URL in your browser: http://localhost:5493/sdata/accounts50/GCRM/-/salesInvoices?count=1. If that returns an error then it's not related to the amount of data, but if it does return data we know it is simply the sheer volume that is the problem.

If it's the former the next thing to do would be to run a check data routine in Accounts as data corruption could theoretically cause that error. If it is the latter, which I strongly suspect it will be, then restricting the amount of data, or using paging to to get the data in smaller chunks would be the way to go. I'm afraid that as I'm not familiar with CRM I couldn't advise how you could configure it to do this (or even if it's possible) but if you contact the CRM Support team I'm sure they would be able to advise further on that front.
Mr Mick Lowe
Posted: Monday, July 30, 2012 10:21:15 AM
Rank: Member

Joined: 7/27/2012
Posts: 3
Thanks Darron, you are correct, the amount of data is causing the problem and it doesn't look like CRM can limit this when rendering the gadget so not sure if this can be resolved.

Mick
Darron Cockram
Posted: Tuesday, July 31, 2012 3:10:25 AM
Rank: Advanced Member

Joined: 10/13/2010
Posts: 289
It might be worth submitting a request to the wishlist https://support.sage.co.uk/default.aspx?page=568 as I would have thought even without the memory issues it would be very useful to restrict the results of the Sdata query anyway. For example only show invoices created in the last week, only those with a particular status, etc.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS