Coder Social home page Coder Social logo

crmfetchkit's People

Contributors

awjacobson avatar thuld avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crmfetchkit's Issues

Can you expose SoapParser setPagingDetails(), its a great method for paging

Hi (great library by the way)

Can you expose the SoapParser externally to enable a caller to easily use the paging cookie. Its used internally in fetchall.

If not then could you add an example to the site showing how a user can use the paging functionality.

Attached is a trivialised (badly coded example); showing CRMFetchKit loading 2 pages of data, by utilising the SoapParser setPagingDetails() method which I made public.

Is there a better way to update the fetchxml and call with the paging cookie and page no.??

 var fxml2 = [
        '<fetch count="5" returntotalrecordcount= "true" >',
        '<entity name="customeraddress" >',
        '<attribute name="line1" />',
        '<attribute name="city" />',
        '<attribute name="stateorprovince" />',
        '<attribute name="county" />',
        '<attribute name="country" />',
        '<attribute name="postalcode" />',
        '<order attribute="city" descending= "true" />',
        '</entity>',
        '</fetch>'
    ].join('');
    CrmFetchKit.FetchMore(fxml2).then(function (response) {
        console.log(response.totalRecordCount);
        console.log(response.moreRecords);
        console.log(response.entityName);
        console.log(response.pagingCookie);
        for (var i = 0; i < response.entities.length; i++) {
            console.log(response.entities[i].getValue('line1'));
        }
        var sp = CrmFetchKit.GetSoapParser();
        fxml2 = sp.setPagingDetails(fxml2, 2, response.pagingCookie);
        CrmFetchKit.FetchMore(fxml2).then(function (response) {
            console.log(response.totalRecordCount);
            console.log(response.moreRecords);
            console.log(response.entityName);
            console.log(response.pagingCookies);
            for (var i = 0; i < response.entities.length; i++) {
                console.log(response.entities[i].getValue('line1'));
            }
            var sp = CrmFetchKit.GetSoapParser();
            fxml2 = sp.setPagingDetails(fxml2, 2, response.pagingCookie);
        });
    });

Unable to get property '<' of undefined or null reference

In IE i get the Above error While in chrome i do not and it works fine

here is the code

    annid = currenturl.substr(currenturl.lastIndexOf('/') + 1);
    annid = annid.replace("med_announcement_view?data=","");
    console.log(annid);

var serverUrl = Xrm.Page.context.getClientUrl();
annUrl = serverUrl + "/WebResources/med_announcement_view?data=";

//Announcement
var fetchxml = [
'',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
''
].join('');

CrmFetchKit.Fetch(fetchxml).then(function(entities) {

    document.getElementById("currenttitle").innerHTML = entities[0]["attributes"]["med_name"]["value"];            

});```


this is a webresource page thats **not** part of a bigger form, its a pop out page,

hence i include the below in the header so i can use the XRM object
`<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>`

Update to support WebAPI

WebAPI was released in CRM 8.0 (CRM 2016). Can CrmFetchKit be made to use this instead of the SOAP endpoint if it is available?

JavaScript warnings in CRM 2015 Update 1

There's a few JavaScript warnings appearing when using CRM 2015 Update 1. I've fixed these in our branch with the following. Is this patch OK?

@@ -5602,10 +5602,13 @@
             // since version SDK 5.0.13
             url = context.getClientUrl();
         }
-        else if ( context.isOutlookClient() && !context.isOutlookOnline() ) {
+        else if ( context.isOutlookClient !== undefined && context.isOutlookOnline !== undefined &&
+                  context.isOutlookClient() && !context.isOutlookOnline() ) {
+            // isOutlookClient() and isOutlookOnline() have been depreciated in CRM 2015 Update 1
             url = localServerUrl;
         }
-        else {
+        else if ( context.getServerUrl !== undefined ) {
+            // getServerUrl() is only available pre CRM 2015 Update 1
             url = context.getServerUrl();
             url = url.replace(/^(http|https):\/\/([_a-zA-Z0-9\-\.]+)(:([0-9]{1,5}))?/, localServerUrl );
             url = url.replace(/\/$/, "" );

Cancelling/Ignoring a fetch

Hi,

Thanks for the great library. Is it possible to cancel a fetch?

Say there's a custom search form that fires off a few fetches upon pressing the "find" button. If the find button is pressed quickly multiple times can any previous incomplete fetches that are still running be cancelled, just leaving the last search criteria running. Is this doable?

Is there a way access the BlueBird Promise library?

Since you are packaging the BlueBird Promise library within CrmFetchKit, I was wondering if there was a way to get the promise object from the CrmFetchKit. I am trying to use the Promise.All() capability, and don’t want load another library since the CrmFetchKit has it.

If not, any plans to expose it, or provide the Promise.All() capability within the CrmFetchKit library, like:

CrmFetchKit.all([CrmFetchKit.Fetch(xml1), CrmFetchKit.Fetch(xml2)]).then(function () {
            console.log("all in");
 });

CrmFetchKit.GetById fails for the Appointment entity.

When attempting to retrieve an Appointment entity from CRM using GetById (or GetByIdSync), the request fails with the message: "'Appointment' entity doesn't contain attribute with Name = 'appointmentid'."

Digging into the code, it would appear that the issue is caused by the following line in the function buildGetByIdFetchXml of soapXmlMessages.js

 var idAttribute = entityname + 'id';

Unfortunately, the id field on the appointment entity is actually activityid. I suspect this will also fail for other activity entity types as well.

Unable to get property replace of undefined or null reference

I included the library (CrmFetchKit.Bundle.js) in my CRM instance as a web resource. When I go to execute a query, I get the error "unable to get property replace of undefined or null reference" in line 5339. This line seems to be giving me problems starting at 5340:

var escape = module.exports = function escape(string) {
return string.replace(/([&"<>'])/g, function(str, item) {
return escape.map[item];
})

Why isn't string defined?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.