Can I extract the BDC data in InfoPath form without writing specific BDC action I have a InfoPath which write backs to my LOB system. Before writing the data back to the LOB system I have to retrive the data first from my LOB system. I already have a BDC which is retriving this data. Is it possible to retrive the BDC data into my InfoPath form without writing a BDC action. Can someone provide a solution for this or direct me to a forum or blog where I can find the solution© 2009 Microsoft Corporation. All rights reserved.Mon, 29 Jun 2009 12:15:12 Zf6e42dcd-eec4-4f65-98da-8884b577507ahttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#f6e42dcd-eec4-4f65-98da-8884b577507ahttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#f6e42dcd-eec4-4f65-98da-8884b577507aAnanyahttp://social.msdn.microsoft.com/Profile/en-US/?user=AnanyaCan I extract the BDC data in InfoPath form without writing specific BDC action I have a InfoPath which write backs to my LOB system. Before writing the data back to the LOB system I have to retrive the data first from my LOB system. I already have a BDC which is retriving this data. Is it possible to retrive the BDC data into my InfoPath form without writing a BDC action. Can someone provide a solution for this or direct me to a forum or blog where I can find the solutionThu, 22 Jan 2009 17:21:15 Z2009-01-22T17:21:15Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#da43a4a5-3b61-41f3-bebf-5f0791ac6a04http://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#da43a4a5-3b61-41f3-bebf-5f0791ac6a04Ashish kanoongohttp://social.msdn.microsoft.com/Profile/en-US/?user=Ashish%20kanoongoCan I extract the BDC data in InfoPath form without writing specific BDC actionAnanya<br/><br/>Did you fina any solution ? I am also looking for the sameFri, 19 Jun 2009 17:12:08 Z2009-06-19T17:12:08Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#93e6b044-fcfa-480e-acd4-435c1f2dd9b2http://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#93e6b044-fcfa-480e-acd4-435c1f2dd9b2Ram Gopinathan - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Ram%20Gopinathan%20-%20MSFTCan I extract the BDC data in InfoPath form without writing specific BDC action<p>You could write a web service that uses the BDC object model to execute BDC entity methods and then add the webservice as datasource to infopath form<br/>here is sample code to call BDC entity methods via code<br/><br/>#region using statements<br/>using System;<br/>using System.Collections;<br/>using System.Collections.Generic;<br/>using System.Collections.Specialized;<br/>using System.Data;<br/>using System.Configuration;<br/>using System.Web;<br/>using System.Web.Security;<br/>using System.Web.UI;<br/>using System.Web.UI.HtmlControls;<br/>using Microsoft.SharePoint;<br/>using Microsoft.SharePoint.Portal;<br/>using Microsoft.Office.Server.ApplicationRegistry.MetadataModel;<br/>using Microsoft.Office.Server.ApplicationRegistry.Runtime;<br/>#endregion</p> <p>namespace Microsoft.SharePoint.Common<br/>{<br/>    public class BDCWrapper<br/>    {<br/>        #region properties<br/>        private string _lobInstanceName ;<br/>        public string LobInstanceName<br/>        {<br/>            get<br/>            {<br/>                return _lobInstanceName;<br/>            }<br/>        }<br/>        private string _sspName;</p> <p>        public string SSPName<br/>        {<br/>            get { return _sspName; }<br/>        }<br/> <br/>        private LobSystemInstance _lobInstance = null;<br/>        public LobSystemInstance LobInstance<br/>        {<br/>            get<br/>            {<br/>                if (_lobInstance == null)<br/>                {<br/>                    //Microsoft.Office.Server.ApplicationRegistry.Infrastructure.SqlSessionProvider.Instance().SetSharedResourceProviderToUse(this.SSPName); <br/>                    NamedLobSystemInstanceDictionary lobInstances = ApplicationRegistry.GetLobSystemInstances();<br/>                    _lobInstance = lobInstances[this.LobInstanceName];<br/>                }<br/>                return _lobInstance;<br/>            }<br/>        }<br/>        #endregion</p> <p>        #region constructor<br/>        public BDCWrapper(string lobInstanceName, string sspName)<br/>        {<br/>            this._lobInstanceName = lobInstanceName;<br/>            this._sspName = sspName;<br/>            //set shared resource provider to use if current Office Server Context is null<br/>            if (Microsoft.Office.Server.ServerContext.Current == null)<br/>            {<br/>                Microsoft.Office.Server.ApplicationRegistry.Infrastructure.SqlSessionProvider.Instance().SetSharedResourceProviderToUse(sspName);<br/>            }<br/>        }<br/>        #endregion</p> <p>        #region helper methods<br/>        /// &lt;summary&gt;<br/>        /// builds a data table schema based on the Entity Definition in LOB System<br/>        /// &lt;/summary&gt;<br/>        /// &lt;param name=&quot;fields&quot;&gt;Field Collection&lt;/param&gt;<br/>        /// &lt;returns&gt;DataTable&lt;/returns&gt;<br/>        private DataTable BuildDataTableSchema(FieldCollection fields)<br/>        {<br/>            DataTable dt = new DataTable();<br/>            foreach (Field f in fields)<br/>            {<br/>                DataColumn column = new DataColumn(f.Name, Type.GetType(f.TypeDescriptor.TypeName));<br/>                dt.Columns.Add(column);<br/>            }<br/>            return dt;<br/>        }<br/>        #endregion</p> <p>        #region public methods<br/>        /// &lt;summary&gt;<br/>        /// used to get data from LOB System using BDC<br/>        /// &lt;/summary&gt;<br/>        /// &lt;returns&gt;DataTable&lt;/returns&gt;<br/>        public DataTable GetBDCData(string entityName, params object[] filterValues)<br/>        {<br/>            DataTable data = null;     <br/>            Entity entity = this.LobInstance.GetEntities()[entityName];<br/>            FilterCollection finderFilters = entity.GetFinderFilters();</p> <p>            if (finderFilters.Count != filterValues.Length)<br/>            {<br/>                throw new ApplicationException(&quot;Not enough filter values specified&quot;);<br/>            }<br/>            for (int i = 0; i &lt; filterValues.Length; i++)<br/>            {<br/>                switch (finderFilters[i].GetType().FullName)<br/>                {<br/>                    case &quot;Microsoft.Office.Server.ApplicationRegistry.Runtime.WildcardFilter&quot;:<br/>                        WildcardFilter wf = (WildcardFilter)finderFilters[i];<br/>                        wf.Value = filterValues[i];<br/>                        break;<br/>                    case &quot;Microsoft.Office.Server.ApplicationRegistry.Runtime.ComparisonFilter&quot;:<br/>                        ComparisonFilter cf = finderFilters[i] as ComparisonFilter;<br/>                        cf.Value = filterValues[i];<br/>                        break;<br/>                    case &quot;Microsoft.Office.Server.ApplicationRegistry.Runtime.LimitFilter&quot;:<br/>                        LimitFilter lf = finderFilters[i] as LimitFilter;<br/>                        lf.Value = Convert.ToUInt32(filterValues[i]);<br/>                        break;<br/>                }<br/>            }<br/>            <br/>            IEntityInstanceEnumerator entityInstanceEnumerator = entity.FindFiltered(finderFilters, this.LobInstance);<br/>            data = BuildDataTableSchema(entity.GetFinderView().Fields);<br/>            <br/>            //populate rows into data table<br/>            while (entityInstanceEnumerator.MoveNext())<br/>            {<br/>                IEntityInstance entityInstance = entityInstanceEnumerator.Current;<br/>                DataRow row = data.NewRow();<br/>                foreach (Field f in entity.GetFinderView().Fields)<br/>                {<br/>                    if (entityInstance[f] != null)<br/>                    {<br/>                        row[f.Name] = entityInstance[f];<br/>                    }<br/>                }<br/>                data.Rows.Add(row);<br/>            }<br/>            return data;<br/>        }<br/>        public DataTable FindSpecific(object identifierValue, string entityName)<br/>        {<br/>            DataTable data = null;     <br/>            Entity entity = this.LobInstance.GetEntities()[entityName];<br/>            IEntityInstance entityInstance = entity.FindSpecific(identifierValue, this.LobInstance);<br/>            data = BuildDataTableSchema(entity.GetSpecificFinderView().Fields);<br/>            DataRow row = data.NewRow();<br/>            foreach (Field f in entity.GetSpecificFinderView().Fields)<br/>            {<br/>                if (entityInstance[f] != null)<br/>                {<br/>                    row[f.Name] = entityInstance[f];<br/>                }<br/>            }<br/>            data.Rows.Add(row);</p> <p>            return data;<br/>        }<br/>        #endregion<br/>    }<br/>}</p>Fri, 19 Jun 2009 17:21:41 Z2009-06-27T13:15:29Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#79f67549-9622-4832-8c4a-c54ac6d629bahttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#79f67549-9622-4832-8c4a-c54ac6d629baAshish kanoongohttp://social.msdn.microsoft.com/Profile/en-US/?user=Ashish%20kanoongoCan I extract the BDC data in InfoPath form without writing specific BDC actionRamprakash<br/><br/>Thanks for reply. Can you show me any live demo or send me complete code, so I can test it if it not agains your ethics?<br/><br/>AshiFri, 19 Jun 2009 17:47:23 Z2009-06-19T17:47:23Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#3b3c76de-6d09-4f56-a04a-c241c9155d88http://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#3b3c76de-6d09-4f56-a04a-c241c9155d88Ram Gopinathan - MSFThttp://social.msdn.microsoft.com/Profile/en-US/?user=Ram%20Gopinathan%20-%20MSFTCan I extract the BDC data in InfoPath form without writing specific BDC actionAshi,<br/><br/>Sorry I don't have a live demo set to demonstrate the end to end scenario from infopath-webservice-bdc call via api<br/>the code pasted here is from a helper class I use in my projects for talking to BDC via API, you can just add it to your web service project and call methods in it<br/>It shouldn't be that hard to create a web service project add use the code I provided to execute BDC entity methods and wire up infopath form to consume web service<br/>if you have trouble let me know I will try to put something together over the weekend, no promises though<br/>Fri, 19 Jun 2009 18:13:03 Z2009-06-19T18:13:03Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#0dfa5b72-a3aa-43fd-895c-f4dacb32bcefhttp://social.msdn.microsoft.com/Forums/en-US/sharepointbdc/thread/f6e42dcd-eec4-4f65-98da-8884b577507a#0dfa5b72-a3aa-43fd-895c-f4dacb32bcefManishrao Patilhttp://social.msdn.microsoft.com/Profile/en-US/?user=Manishrao%20PatilCan I extract the BDC data in InfoPath form without writing specific BDC actionHi,<br/><br/>I think you can do one thing, instead of showing bdc information in some BDC webparts you use DVWP of sharepoint designer which is clean, easy and still power enough.<br/>Since this webpart (DVWP) is purely xml and xslt driven so can easily play with it and redirect the user to the infopath form with required parameters (needless to say query string).<br/>I'm quiet confident that you will get good enough help online regarding xml and xslt in context to the DVWP.<br/>This approach is quiet easy and easy for maintanence.<br/><hr class="sig">Manish Patil http://patilmanishrao.wordpress.com Posting is provided &quot;AS IS&quot; with no warranties, and confers no rights.Mon, 29 Jun 2009 12:15:11 Z2009-06-29T12:15:11Z