1

I want to create an external list in SharePoint via API data.

My questions are as follows:

1- How to create external list in SharePoint via API data?

2- when user updates item in SharePoint, how can I know those fields and items that edited by users? version history is one option. Any options are preferable?

1 Answer 1

0
  1. We can use the code below to create external list.

    SPListDataSource ds = new SPListDataSource();
    ds.SetProperty(SPListDataSource.BDCProperties.LobSystemInstance, "Demo Customers");
    ds.SetProperty(SPListDataSource.BDCProperties.EntityNamespace, "http://intranet");
    ds.SetProperty(SPListDataSource.BDCProperties.Entity, "Demo Customers");
    ds.SetProperty(SPListDataSource.BDCProperties.SpecificFinder, "CustomerRead Item");
    using (SPSite site = new SPSite("http://intranet"))
    {
        using (SPWeb web = site.RootWeb)
        {
            web.Lists.Add("Demo Customers", "Demo Customers", "Lists/DemoCustomers", ds);
        }
    }
    

    http://chakkaradeep.com/index.php/creating-external-lists-programmatically/

  2. Version history is a good option to achieve your requirement, we can also use event receiver to monitor the user changed for the list item.

    https://msdn.microsoft.com/en-us/library/ff650021.aspx?f=255&MSPPError=-2147217396

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.