Tuesday 23 August 2016

AngularJS controller as vs Scope


https://www.youtube.com/watch?v=F6BIxHkiHjc&list=PL6n9fhu94yhWKHkcL7RJmmXyxkuFB3KSl&index=34

Monday 8 August 2016

SharePoint create folder batch by batch

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Client;

namespace CreateFolders
{
 
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter the URL");
            string strWebURL = Console.ReadLine();
            Console.WriteLine(strWebURL);
            ClientContext objContext = new ClientContext(strWebURL);
            List objList = objContext.Web.Lists.GetByTitle("Programs");
            ListItemCollection objListColl = objList.GetItems(new CamlQuery());
            string[] entityCollection = { "List1", "List2", "List3" }; //List Name
            objContext.Load(objListColl);
            objContext.ExecuteQuery();
            int batchCount = 30;
            foreach (string entityName in entityCollection)
            {
                int i = 0;

                List eachList = objContext.Web.Lists.GetByTitle(entityName);
                ListItemCollection eachItemcollection = objContext.Web.Lists.GetByTitle(entityName).GetItems(new CamlQuery());
                objContext.Load(eachList);
                objContext.Load(eachItemcollection);
                objContext.ExecuteQuery();

                foreach (ListItem programItem in objListColl)
                {

                    string itemid = programItem["ID"].ToString();
                    string title = programItem["Title"].ToString();

                    IEnumerable<ListItem> tempItem = eachItemcollection.AsEnumerable().Where(x => (x["Title"] != null && x["Title"].ToString() == itemid));
                    if (tempItem.Count() == 0)
                    {
                        ListItemCreationInformation itemInfo = new ListItemCreationInformation();
                        itemInfo.UnderlyingObjectType = FileSystemObjectType.Folder;
                        itemInfo.LeafName = itemid;
                        ListItem tempListItem = eachList.AddItem(itemInfo);
                        tempListItem["Title"] = itemid;
                        tempListItem["Program"] = itemid + ";#" + title;
                        tempListItem["Author"] = programItem["Author"];
                        tempListItem["Editor"] = programItem["Editor"];
                        tempListItem.Update();
                        i++;
                        if (i % batchCount == 0)
                        {
                            objContext.ExecuteQuery();
                        }
                    }

                }
                if (i % batchCount != 0)
                {
                    objContext.ExecuteQuery();
                }
            }

        }
    }
}

Thursday 4 August 2016

Aras good tool

Download .exe
Connect to your Aras Innovator instance
You can write AMLs
Run
Get the result

Good one: https://github.com/erdomke/InnovatorAdmin