Fetch XML problem

Hi, all.

I have a problem that is caused by a limitation of the 
fetch XML schema: I want to calculate the prices for a 
list products according to a special pricelist by the 
default unit of measure. 

I found no way to select unique product and 
priceleveldetail details for the products because I can 
only give one join attribute (productid or uomid) for the 
link-entity. Example:

<fetch mapping='logical'>
   <entity name='product'>
   <attribute name='productid'/>
   <attribute name='name'/>
   <attribute name='price'/>
   <attribute name='defaultuomid'/>
   <link-entity name='productpricelevel' from='productid'>
      <attribute name='pricelevelid'/>
      <attribute name='pricingmethodcode'/>
      <attribute name='percentage'/>
      <attribute name='amount'/>
      <attribute name='uomid'/>
      <filter>
         <condition attribute = 'pricelevelid' 
operator='eq' value='{D8231AE0-9BEE-40FF-AE7A-
FC722722B5F0}'/>
      </filter>
   </link-entity>
      <filter type='and'>
         <condition attribute = 'name' operator='like' 
value='a%'/>
      </filter>
   </entity>
</fetch>

This returns multiple results per product if a product has 
defined multiple conditions for the pricelevel.

Any idea?

Regards,
Oliver
0
Oliver
2/6/2004 1:56:37 PM
crm 35858 articles. 1 followers. Follow

2 Replies
739 Views

Similar Articles

[PageSpeed] 48

Olivier,

FetchXml doesn't allow you to specify that you want 'disctinct' records.
This is a problem I reported to Microsoft several months ago in CRM v1.0
but, because I was unable to reproduce the problem in their client
application, they were unwilling to fix it in CRM v1.2. I already have a
support case with them where they acknowledge the problem and I also entered
a product enhencement suggestion in addition to talking to some of their
product managers at various conferences but they are not concerned since
their client application doesn't suffer from this problem. Their answer to
this problem is that we are responsible to parse the XML returned by the
query and filter duplicates!

This is an important issue to us since we have developed an advance search
tool for Microsoft CRM called SearchPac to allow users to build complex
queries and set criteria on multiple linked objects. Our product  builds the
fetchXml string and relies on the query engine to perform the search but, as
you found out, it sometimes return the same record multiple times. An
example would be a query that returns all account that have an opportunity
worth more than $50,000. In this scenario, the same account will be returned
multiple times if it has more than one opportunity woth more than $50,000.

I encourage you to open a support case with Microsoft and maybe they will
fix this in CRM v2.0 if they hear enough complains. In the mean time, to
only workaround I know of, is to manually parse the XML.

-Jeremie Desautels
c360 Solutions




"Oliver Lambert" <oliver.lambert@orbis.de> wrote in message
news:b97101c3ecb9$0a2026d0$a001280a@phx.gbl...
> Hi, all.
>
> I have a problem that is caused by a limitation of the
> fetch XML schema: I want to calculate the prices for a
> list products according to a special pricelist by the
> default unit of measure.
>
> I found no way to select unique product and
> priceleveldetail details for the products because I can
> only give one join attribute (productid or uomid) for the
> link-entity. Example:
>
> <fetch mapping='logical'>
>    <entity name='product'>
>    <attribute name='productid'/>
>    <attribute name='name'/>
>    <attribute name='price'/>
>    <attribute name='defaultuomid'/>
>    <link-entity name='productpricelevel' from='productid'>
>       <attribute name='pricelevelid'/>
>       <attribute name='pricingmethodcode'/>
>       <attribute name='percentage'/>
>       <attribute name='amount'/>
>       <attribute name='uomid'/>
>       <filter>
>          <condition attribute = 'pricelevelid'
> operator='eq' value='{D8231AE0-9BEE-40FF-AE7A-
> FC722722B5F0}'/>
>       </filter>
>    </link-entity>
>       <filter type='and'>
>          <condition attribute = 'name' operator='like'
> value='a%'/>
>       </filter>
>    </entity>
> </fetch>
>
> This returns multiple results per product if a product has
> defined multiple conditions for the pricelevel.
>
> Any idea?
>
> Regards,
> Oliver


0
Jeremie
2/6/2004 4:45:08 PM
Hello.

Thank you for this information. I will also open a support 
case in the next days about this problem.

Regards,
Oliver
0
Oliver
2/9/2004 2:42:24 PM
Reply:

Similar Artilces:

Strange problem while executing MFC Application
Hi i am working on IVR system, while MFC dialog based application, using TAPI 3.1, VC++ 6, and Windows XP. Hardware involved U.S Robotics modem and anda small Exchange for telephony application testing. When i execute my application some times it runs correctly and some time give the following message and closing the application: "Tapi Test MFC application has encountered a problem and needs to close. We are sorry for inconvenious." "f you are in middle of something, the information you are working on might be lost" "Please tell Microsoft about this problem"...

2007 Track Changes Problem
I have a document that has track changes turned on. Under the Track Changes Options window, I have insertions set to underline and deletions set to strikethrough. When I delete something, instead of getting a strikethrough, I get the balloon showing deleted and what was deleted. The insertions act as they are supposed to with an underline. In another document where the deletions show as strikethrough, when I accept all the track changes, the deletions still show with strikethrough, it doesn't remove the text to be deleted. Can anyone help please? For your first document...

Query XML file
hi guys I'm new to XML. I've publish XML to Web Server. Now I want to query specific information. Pls tell me the most easiest way to do that. second Is there any way to secure online XML file. If yes pls inform me. thanks ...

CRM lockout problem
I'm trying to install CRM 1.2 on SBS2003. I managed to get the intial installation to work, then added an additional user which I gave administrator priviledges. I then decided to remove the administrator priviledges from that user (I thought) and I am now completely locked out of the system. When I go to the homepage I just get an error message telling me that the user trying to log on has no licence allocated and I can't do anything. I've reinstalled the system a couple of times to no avail, albeit using the existing SQL database. Any suggestions how I can get back into the sys...

Problem with second instance of ActiveX Object
Hi, I have been using the MSHFlexgrid activeX object in a Visual Studio 2005 VC++ project and it has been working fine. Recently, in the same project, I created a new dialog and inserted another MSHFlexgrid object in the dialog. However I'm now getting 2 strange errors as follows: mshflexgrid.h(15) : error C2011: 'CMSHFlexGrid' : 'class' type redefinition 1> mshflexgrid.h(15) : see declaration of 'CMSHFlexGrid' textdisplaydlg2.h(17) : error C2079: 'CTextDisplayDlg2::m_FlexGrid' uses undefined class 'CMSHFlexGrid' I had to manually cha...

Outlook keeps fetching new headers
Outlook keeps fetching new headers daily at the same time, this usally errors out with The UID of a message changed unexpectedly. I have looked for Rules or filters that may cause this, but found nothing. Has anyone ever seen this problem ...

Format XML Nodes
Hi, I have xml look like following <ContactInformation> <ContactName> <Name> <Person> <LastName NewValue="Shepherd"> </LastName> <FirstName NewValue="Bob"> </FirstName> </Person> </Name> </ContactName> <Phone> <PhoneType NewValue="FAX"> </PhoneType> <PhoneFormatted> <PhoneAreaCode NewValue="461"> </Phon...

XML Document #2
I have a list of products in an xml file I want to modify the document by adding, removing and editing items. I'm developing on the Compact Framework and as a result memory is an issue. I don't really want to build a DOM of the XML using XML Document, since it is not really needed and it wastes memory. Can I use another technique ? Jonathan Taylor wrote: > I have a list of products in an xml file I want to modify the document by > adding, removing and editing items. > > I'm developing on the Compact Framework and as a result memory is an issue. > > I d...

winmail.dat problem again
Hi, I know this has been asked before, but I can't find a solution to the problem. When I send attachements with Outlook 2003 the receiver gets a winmail.dat file instead. I've read all the articles about this and so on, but the only solution I find is : * Download a program that converts this into the original file. -This is not a good solution when the receiver is of high importance and you don`t really wan't to bother the person with "computer related problems"... * Don't send in rich text format (only plain text or html) - Well, I've tried this both in plain...

Problem with pop3 authentication
Hi all, there's a problem with my exchange eviroment. When I change the user password from a user on Active Directory, this user cannot login on POP3 protocol using this new password for a long boring time. When I use OWA and Exchange Client, everthing works fine. There's some settings on Exchange to clean this cache or reduce this delay time? Thanks in advance. ...

page numbering problems
I have created a form in Excel to use in court documents. The number of printed pages varies, depending on how much information is entered into the form. I need to enter the page numbers at the top of each page from # 2 to the end of the document, but page 1 cannot have a page # on it. I realize that I can do that in a header, but because a header will also affect page 1 that doesn't work for this form. What I have in mind is code to count the printed pages - from that I can work backwards to insert the specific page number after each page break; however, everything I have tr...

how to fetch data from a websearch to excel
I need help in figuring out how to supply different entries from an excel list into searchable webservers and recording the output from the webserver-like supplying a booktitle in an excel list into amazon and recording the price amazon supplies with the entry in my excel list... ...

How to get xml data from AXWebbrowser control?
I am using the axwebbrowser control in VB.net to automate the navigation of a password protected website. After loading data and pressing the correct submit button I get to a page that has only XML data on it. How do I get this XML data out of the AXwebbrowser control so I and parse it using the xml tools? The strange part is when I create a string called xmltext = axwebbrowser1.document.body.outerhtml The xmltext has quite a bit of extra code in it and the xml tags are gone. Now this browser control displays the xml perfectly. but xmltext contains the following.... xmltext= "<bod...

XML samples
Does anyone have good links for MSXML sample code? I need to parse XML files and convert to HTML with a somewhat different format. It may be easier just to parse the strings, but I figure that MSXML is worth a look if I don't have to start from scratch. On Thu, 25 Mar 2010 14:01:39 -0500, mayayana wrote: > Does anyone have good links for MSXML sample code? I need to parse XML > files and convert to HTML with a somewhat > different format. It may be easier just to parse the strings, but I > figure that MSXML is worth a look if I don't have to start from s...

Export to XML
Hi all This is Faisal i am looking to export the invoice from RMS after printing it to XML Format . is any one know how ??? Best Regards Faisal Malaeb Faisalmalaeb@hotpop.com ...

Weird problem with Outlook 2000
I use windows Me. Outlook frequently--but not always--reverts to a previous window when I click on the icon for new message instead of opening a new message window. Also, in the menu bar there is an item "Favorites" If I move the cursor over that--even without clicking the program freezes for maybe 15 sec. Clicking on that item does nothing at all. What's going on? Jerry lobdillj@charter.net What version of Outlook are you using? Note: this group does not support Outlook Express. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion in...

Lookup and fetch from the same column
I have spread sheet that has three columns, out of which two are pr populated and I am finding the information for the third column fro the other system. > > Example : > Module-- Job---------- Owner > abc215-- AQ20DX > abc224-- ABG9DA > abc224-- ABG9DB > abc224-- ABG9DX > abc225-- AO14DX > abc225-- AO15DX > abc375-- AQ20DX > abf987-- ABG9DA > abh897-- ABG9DB > Using the Job Name I get the information from the other system an populate the info as follows. > > Module-- Job-------Owner > abc215-- AQ20DX--14B > abc224-- ABG9DA--14E...

WideChartoMultiByte problems
Hi I am trying to convert a wchar_t string to multibyte. The following code is what i am using void Ctest_editDlg::OnOK() { CString m_strList; int ret = WideCharToMultiByte(m_edit.GetCodePage(),WC_COMPOSITECHECK ,m_edit.GetInputBuffer(),-1,m_strList.GetBuffer(),0,NULL,NULL); AfxMessageBox(m_strList); //CDialog::OnOK(); } Compiling code with MBCS support. When i input 5 japanese characters i get the ret value from the function as 10 meaning 10 bytes have been writen however my variable m_strList is still empty!!! m_edit.GetCodePage() = 932 m_edit.GetInputBuffer() = returns a wchar_t st...

2 small problems
Outlook 2002 / W98 I expect these to be easy but, as an old guy, I can't find the answer. 1) Journaling - when I get an email and want it to show up in the journal, I D&D to the Journal. This leaves a copy in my Inbox. How do I get email into the Journal folder without deleting it or keeping a copy in the Inbox? 2) Forms - I have finally managed to create a form used in 2 folders. The form works great in one folder but in the other the title shows as strike-thru. How do I get rid of the strike-thru? -- Replace the AT in address Statistics convinces us we are in a minority. P...

xml format problem
Hi I'm using the following code to create xml string: Dim Doc As New System.Xml.XmlDocument Dim newAtt As System.Xml.XmlAttribute Dim dec As System.Xml.XmlDeclaration dec = Doc.CreateXmlDeclaration("1.0", Nothing, Nothing) dec.Encoding = "UTF-8" Doc.AppendChild(dec) Dim DocRoot As System.Xml.XmlElement = Doc.CreateElement("userlist") newAtt = Doc.CreateAttribute("ACTION") newAtt.Value = vAction DocRoot.Attributes.Append(newAtt) newAtt = Doc.CreateAttribute("VENDORNAME") newAtt.Value = vVendorName DocRoot.Attributes.Append(newAtt) Doc.A...

To access a particular node in XML
I'm newbie to xml and C#. I have one XML file with the following content: <Store> <Book id="1" > <Title>Thermodynamics Unleashed</Title> <Price>56.00</Price> <Book> <Book id="2" > <Title>CAD & CAm</Title> <Price>72.00</Price> <Book> <Book id="3" > <Title>Machine Design</Title> <Price>56.00</Price> <Book> </Store> Now, I want to access a particular node only ( say, <Book id="2"> ) and then I read the ...

Help...Weird problem
Runing XP with SP2 and Publisher 2003 with SP1. Using IE 6.0 (sometimes netscape 8.0 beta) I create my files in publisher...then when I do a File->Web Page preview...Only the background and text shows up. So I upload the page to my server and the same thing happend (yes i upload the sub folder and files). Now...if I go to my husbands computer and view the uploaded page...the pictures are there on my published web site. This seems to be related to some setting in my IE browser, as if I open web pages I created and upload in Netscape on MY computer everything looks fine. But if I ...

Keynote Speakers Announced for XML 2004
Keynote Speakers for XML 2004 Announced Speakers Include Executives from IBM, Microsoft, DaimlerChrysler; World's Largest XML Trade Conference Slated for Nov. 15-19 in Washington, D.C. Alexandria, Va. August 17, 2004 - IDEAlliance, a leading industry association dedicated to fostering XML and other information technology standards, today announced the keynote speakers for XML Conference and Exposition 2004, being held Nov. 15-19 at the Marriott Wardman Park Hotel in Washington, D.C. The keynote presenters are: " Michael Daconta, Metadata Program Man...

Access 2003 and 2007 on same PC
I have Office 2003 and Office 2007 installed on the same PC (installed correctly as per the KB article http://support.microsoft.com/default.aspx/kb/928091). I am having problems with VBA References. A new database created in Access 2003 contains references to the Microsoft Access 12.0 Object Library, not the Access 11. Therefore none of my VBA code will work. it comes up with an error of "object or class does not support the set of events" Does anyone know how to re-set the reference back to Microsoft Access 11.0 Object Library - I can't untick the reference to 12.0 and when I b...

how to fetch blob data in bulk fetching mode
Since bulk fetching mode do things more efficiently, so I determined to use bulk fetching mode in my app. But the problem is, there're some long large binary data in my database. As a tutorial in MSDN says, you can bind these field to CLongBinary objects , but this approach works only when you fetch your data once at a row. I'll be really very appreciate if you tell me how to achieve this, or tell me where can I find a example. Thanks in advance. ...