Q: Validate columns against validationformula client object model while uploading documents Please see the below code where List<order> metadata contains values for my SharePoint columns/fields. I have to validate against Field.validationformula specified in SharePoint site. Can some one helps me to elaborate the provision how to do this validation.
   public bool UploadDocumentwithMetadata(string fileName, string filePath, string docLibraryName, bool overwrite,
        List<Order> metadata, string subfoldername)
    {

        bool uploadStatus = false;
        string fileurl;
        try
        {
            // Create the new file  
            if (subfoldername == "")
                fileurl = fileName;
            else
                fileurl = Path.Combine(docLibraryName + "/" + subfoldername, fileName);
            var newFile = new FileCreationInformation
            {
                Content = System.IO.File.ReadAllBytes(filePath),
                Url = fileurl,
                Overwrite = overwrite
            };
            Microsoft.SharePoint.Client.ListItem item = null;
            var docs = _site.Lists.GetByTitle(docLibraryName);
            if (docs != null)
            {
                StringBuilder SB = new StringBuilder();
                Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
                uploadStatus = true;
                item = uploadFile.ListItemAllFields;field.Value.ToString();

                foreach (var order in metadata)
                {
                    Field fld = null;
                    foreach (var eachfield in docs.Fields)
                    {
                        if (eachfield.InternalName == order._InternalName)
                        {
                            fld = eachfield;
                            break;
                        }
                    }

                    string validationformula = fld.ValidationFormula;

                    item[order._InternalName] = order._Range;
                }

                /////
        ****/
        //if columns satisfies fld.ValidationFormula;
                    //then upload
        //else exist
        /***
        /////

            }

            return uploadStatus;

        }

