Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CRM 2011 Advanced Find - Fetch XML - import for revised find

Is there some way to edit an XML file from CRM "Advanced Find" then bring it back in with changes?

I’m tired of using Advanced find when I have lots of values to insert for on one field type (eg. zipcode = 45211) and would like a way to speed up the process without handing it off to the person who would write it in SQL.

So my thought is to create the beginnings of query using “Advance Find”, then export that query using Download Fetch XML, then modify the XML file, (not sure how or if this next part can be accomplished >>) then import that XML file back into CRM to use for my new query or replace the related XML file wherever it might reside.

Example change to XML:

    <filter type="or">
        <condition attribute="address1_postalcode" operator="like" value="45211%" />
        <condition attribute="address1_postalcode" operator="like" value="45213%" />
        <condition attribute="address1_postalcode" operator="like" value="45219%" />
        etc…
    </filter>
like image 865
mann Avatar asked Aug 31 '12 14:08

mann


2 Answers

You'd have to create a utility that updates views and allows you to hand edit the XML. I don't think it would be too difficult to create said utility, but there is no way to do it through the UI itself. See this link: http://social.microsoft.com/Forums/en/crm/thread/fd4bdbad-dd81-4507-a8e3-23cc35ff53f3

(you might be able to mess around with importing the view, but I doubt it).

like image 129
Daryl Avatar answered Oct 23 '22 21:10

Daryl


You will need to write an (console?) application to this problem. Use the SavedQuery entity to retrieve the advanced find query and set the FetchXML field, set the id to a new GUID and Name to an appropriate label and create a new advanced find record.

like image 2
Gaurav Dalal Avatar answered Oct 23 '22 20:10

Gaurav Dalal