locked
BCS passing dynamic inputs to methods & calling using in O365 RRS feed

  • Question

  • Hi all ,

    I have a requirement to pass dynamic values to BDC methods & retrieve data, for this I have created a BDC model file(which has SQL server as external source) with GenericInvoker methods & upload same to Admin central. how do we access these generic methods in Office 365 using JavaScript client object model.

    what are the options we have to invoke methods manually by passing dynamic values.

    I tried below code. but I getting below error.

    The web with URL 'http://XXXXXXXX:26110/sites/RA5' is not an app web. The GetAppBdcCatalog method must be called on an app web.

    Any help on this would be appreciated

     function retrieveListItems() {
    
                // This code runs when the DOM is ready and creates a context object which is needed to use the SharePoint object model
                $(document).ready(function () {
                    context = SP.ClientContext.get_current();
                    web = context.get_web();
                    context.load(web);
                    entity = web.getAppBdcCatalog().getEntity("PersonalDetails", "New external content type");
                    context.load(entity);
                    lob = entity.getLobSystem();
                    context.load(lob);
                    lobSystemInstances = lob.getLobSystemInstances();
                    context.load(lobSystemInstances);
                    context.executeQueryAsync(GetLobSubscribesystemInstance, onQueryFailed);
                });
    
            }
    
    
    
            function Entity() {
                alert("Reached the Entity method");
               
            }
    
            //these are the helper methods and variables
    
            var context;
            var web;
            var user;
            var entity;
            var lob;
            var lobSystemInstance;
            var lobSystemInstances;
    
            // Initialize the LobSystemInstance.
            function GetLobSubscribesystemInstance() {
                var $$enum_1_0 = lobSystemInstances.getEnumerator();
                while ($$enum_1_0.moveNext()) {
                    var instance = $$enum_1_0.get_current();
                    lobSystemInstance = instance;
                    context.load(lobSystemInstance);
                    break;
                }
                context.executeQueryAsync(Entity, onQueryFailed);
            } 
    
        function onQueryFailed(sender, args) {
    
        alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
        }


    ragava_28


    Monday, January 12, 2015 9:20 PM

All replies

  • Replace this line and check the name space of your external content type.

                    entity = web.getEntity("PersonalDetails", "New external content type");
    


    Mostafa Abdellah

    Sunday, July 17, 2016 12:15 PM