<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2146358158958580173</id><updated>2024-09-28T20:13:49.479-07:00</updated><category term="CRM"/><category term="Email router"/><category term="JS"/><category term="CRM 2011"/><category term="Java Script"/><category term="SMTP"/><category term="crm 4"/><category term="google"/><category term="588725dd-c878-41c5-a4c3-5efc93cd3ffd"/><category term="ASPX GridView"/><category term="Bag"/><category term="CrmCheckPrivilege"/><category term="ExtJS"/><category term="Facebook"/><category term="IFrame"/><category term="Illegal operation attempted on a registry key that has been marked for deletion"/><category term="Instant search"/><category term="JPEG IE 8 9 CMYK problem resulution solution RGB Buffer overflow QueryAllInformationFile not displayed image internet explorer IE"/><category term="JS. call web service"/><category term="JSON"/><category term="List of processes"/><category term="Outlook"/><category term="Outlook 2010 notification issue"/><category term="POST request"/><category term="Process"/><category term="Process Explorer"/><category term="Query"/><category term="Reload"/><category term="Replace Task Manager"/><category term="SQL"/><category term="SSRS"/><category term="WMI"/><category term="Width"/><category term="Windows"/><category term="Windows Management Instrumentation"/><category term="Wrap"/><category term="blacklist"/><category term="call service"/><category term="cimv2"/><category term="com error"/><category term="com exception"/><category term="error"/><category term="exception"/><category term="iis 6"/><category term="log in"/><category term="logedin user"/><category term="silverlight"/><category term="user"/><category term="wcf"/><category term="web service error"/><category term="yahoo"/><title type='text'>.Net or not .Net</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>60</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-7136562469636045744</id><published>2016-01-26T11:23:00.001-08:00</published><updated>2016-01-26T11:23:40.525-08:00</updated><title type='text'>iTextSharp: Remove pages from PDF and Combine tiff, png, jpg, bmp, pdf files into one single pdf file</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I didn`t think that it will take so long time to combine different files into one pdf file, but it took :)&lt;br /&gt;If you are writing the similar program here are two functions which will help you much.&lt;br /&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static byte[] SplitPdf(string filePath, List&amp;lt;PageRange&amp;gt; pages)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PdfReader reader = null;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Document sourceDocument = null;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PdfCopy pdfCopyProvider = null;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PdfImportedPage importedPage = null;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MemoryStream outputStream = new MemoryStream();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var pagesCount = 0;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; reader = new PdfReader(filePath);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pagesCount = reader.NumberOfPages;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sourceDocument = new Document(reader.GetPageSizeWithRotation(Math.Min(pages[0].PageFrom, pagesCount)));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pdfCopyProvider = new PdfCopy(sourceDocument, outputStream);&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sourceDocument.Open();&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; pages.Count; i++)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var from = Math.Min(Math.Max(pages[i].PageFrom, 1), pagesCount);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var to = Math.Min(pages[i].PageTo, pagesCount);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int page = from; page &amp;lt;= to; page++)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; importedPage = pdfCopyProvider.GetImportedPage(reader, page);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pdfCopyProvider.AddPage(importedPage);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sourceDocument.Close();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; reader.Close();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return outputStream.ToArray();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new Exception(string.Format(&quot;Unable to split Pdf document. Details: {0}&quot;, ex.Message));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static byte[] CombineImages(List&amp;lt;string&amp;gt; filePaths)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Document document = new Document();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MemoryStream outputStream = new MemoryStream(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PdfWriter pdfWriter = PdfWriter.GetInstance(document, outputStream); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PdfImportedPage importedPage = null;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.Open();&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var filePath in filePaths)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var ext = Path.GetExtension(filePath);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (ext.ToLower() == &quot;.tiff&quot; || ext.ToLower() == &quot;.tif&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (var imageFileStream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var decoder = new TiffBitmapDecoder(imageFileStream, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; decoder.Frames.Count; i++)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (MemoryStream stream = new MemoryStream())&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; JpegBitmapEncoder encoder = new JpegBitmapEncoder();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; encoder.QualityLevel = 100;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; encoder.Frames.Add(BitmapFrame.Create(decoder.Frames[i]));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; encoder.Save(stream);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var image = iTextSharp.text.Image.GetInstance(stream.ToArray());&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; image.SetAbsolutePosition(0, 0);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.SetPageSize(new iTextSharp.text.Rectangle(0, 0, image.Width, image.Height, 0));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.NewPage();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pdfWriter.DirectContent.AddImage(image, false);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else if (ext.ToLower() == &quot;.pdf&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var reader = new PdfReader(filePath);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var pagesCount = reader.NumberOfPages; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (int i = 1; i &amp;lt;= pagesCount; i++)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.SetPageSize(reader.GetPageSizeWithRotation(i));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.NewPage();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; importedPage = pdfWriter.GetImportedPage(reader, i);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int rotation = reader.GetPageRotation(i);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (rotation == 90 || rotation == 270)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pdfWriter.DirectContent.AddTemplate(&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; importedPage, 0, -1f, 1f, 0, 0, reader.GetPageSizeWithRotation(i).Height);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pdfWriter.DirectContent.AddTemplate(importedPage, 1f, 0, 0, 1f, 0, 0);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (FileStream fs = File.OpenRead(filePath))&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var image = iTextSharp.text.Image.GetInstance(fs);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; image.SetAbsolutePosition(0, 0);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.SetPageSize(new iTextSharp.text.Rectangle(0, 0, image.Width, image.Height, 0));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.NewPage();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pdfWriter.DirectContent.AddImage(image, false);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; document.Close(); &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pdfWriter.Close(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return outputStream.ToArray();&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new Exception(string.Format(&quot;Unable to combine files into one Pdf document. Details: {0}&quot;, ex.Message));&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/7136562469636045744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2016/01/itextsharp-remove-pages-from-pdf-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/7136562469636045744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/7136562469636045744'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2016/01/itextsharp-remove-pages-from-pdf-and.html' title='iTextSharp: Remove pages from PDF and Combine tiff, png, jpg, bmp, pdf files into one single pdf file'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-1853372934337956093</id><published>2016-01-12T10:34:00.006-08:00</published><updated>2016-01-13T00:14:32.390-08:00</updated><title type='text'>Convert HTML to PDF using C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I lost several hours trying to convert Html to Pdf and with the help of stackoverflow and after getting many errors like &quot;Html document is not well formed&quot;, &quot;Incorrect header tag&quot;, &quot;Invalid nested tag head found, expected closing tag meta&quot; came to the following solution:&lt;br /&gt;
&lt;br /&gt;
1. Read html document using&amp;nbsp;HtmlAgilityPack library&lt;br /&gt;
2. Retrieve Body part of the document&lt;br /&gt;
3. Convert body to well-formed XHTML&lt;br /&gt;
4. Write XHTML to PDF document using iTextSharp&lt;br /&gt;
&lt;br /&gt;
NuGet Packages you need:&lt;br /&gt;
1. iTextSharp&lt;br /&gt;
2. iTextSharp XML Worker&lt;br /&gt;
3. HtmlAgilityPack&lt;br /&gt;
&lt;br /&gt;
The code:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;public class HtmlToPdf&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public static byte[] ConvertHtmlToPdf(string htmlText)&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HtmlDocument htmlDoc = new HtmlDocument();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; htmlDoc.LoadHtml(htmlText);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Convert HTML to well-formed XHTML&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; htmlDoc.OptionFixNestedTags = true;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; htmlDoc.OptionOutputAsXml = true;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; htmlDoc.OptionCheckSyntax = true;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HtmlNode bodyNode = htmlDoc.DocumentNode;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; htmlText = bodyNode.WriteTo();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Create a byte array that will hold final PDF&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Byte[] bytes;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var ms = new MemoryStream();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var doc = new Document();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var writer = PdfWriter.GetInstance(doc, ms);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; writer.CloseStream = false;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var srHtml = new StringReader(htmlText);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Open the document for writing&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.Open(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Add support for embeded images&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var tagProcessors = (DefaultTagProcessorFactory)Tags.GetHtmlTagProcessorFactory();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tagProcessors.RemoveProcessor(HTML.Tag.IMG);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tagProcessors.AddProcessor(HTML.Tag.IMG, new CustomImageTagProcessor());&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string arialuniTff = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), &quot;ARIALUNI.TTF&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FontFactory.Register(arialuniTff);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; HtmlPipelineContext htmlContext = new HtmlPipelineContext(null);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; htmlContext.SetTagFactory(tagProcessors);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ICSSResolver cssResolver = XMLWorkerHelper.GetInstance().GetDefaultCssResolver(true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IPipeline pipeline = new CssResolverPipeline(cssResolver, new HtmlPipeline(htmlContext, new PdfWriterPipeline(doc, writer))); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XMLWorker worker = new XMLWorker(pipeline, true); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XMLParser xmlParser = new XMLParser(true, worker, Encoding.Unicode); &amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlParser.Parse(srHtml); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; srHtml.Close();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.Close();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; writer.Close();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.Close(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bytes = ms.ToArray();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ms.Close();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Now we just need to do something with those bytes.&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Here I&#39;m writing them to disk but if you were in ASP.Net you might Response.BinaryWrite() them.&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var testFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), &quot;test.pdf&quot;);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.IO.File.WriteAllBytes(testFile, bytes);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return bytes;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; public class CustomImageTagProcessor : iTextSharp.tool.xml.html.Image&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public override IList&amp;lt;IElement&amp;gt; End(IWorkerContext ctx, Tag tag, IList&amp;lt;IElement&amp;gt; currentContent)&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IDictionary&amp;lt;string, string&amp;gt; attributes = tag.Attributes;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string src;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!attributes.TryGetValue(HTML.Attribute.SRC, out src))&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new List&amp;lt;IElement&amp;gt;(1);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (string.IsNullOrEmpty(src))&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new List&amp;lt;IElement&amp;gt;(1);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (src.StartsWith(&quot;data:image/&quot;, StringComparison.InvariantCultureIgnoreCase))&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // data:[&amp;lt;MIME-type&amp;gt;][;charset=&amp;lt;encoding&amp;gt;][;base64],&amp;lt;data&amp;gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var base64Data = src.Substring(src.IndexOf(&quot;,&quot;) + 1);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var imagedata = Convert.FromBase64String(base64Data);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var image = iTextSharp.text.Image.GetInstance(imagedata);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;br /&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var list = new List&amp;lt;IElement&amp;gt;();&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var htmlPipelineContext = GetHtmlPipelineContext(ctx);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; list.Add(GetCssAppliers().Apply(new Chunk((iTextSharp.text.Image)GetCssAppliers().Apply(image, tag, htmlPipelineContext), 0, 0, true), tag, htmlPipelineContext));&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return list;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return base.End(ctx, tag, currentContent);&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/1853372934337956093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2016/01/convert-html-to-pdf-using-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1853372934337956093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1853372934337956093'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2016/01/convert-html-to-pdf-using-c.html' title='Convert HTML to PDF using C#'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-5371822195240480105</id><published>2015-07-18T02:47:00.001-07:00</published><updated>2015-07-18T02:52:27.152-07:00</updated><title type='text'>Hungy: new puzzle game for widows phone</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWvh5ATmreoo69iX4SJQA8dXTq8EpLhVKVS8t70xg_rNEp5j7DJWFvaud8ZEP14k-2TurbfX5MvIZNt4KQV6aybkmrmc_R_CaApxPQE9jcAw7-Ybr8FSyZm6Uw0YkpKvxzKeVOw1GnFxrX/s1600/hungy-long-web%255B1%255D.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWvh5ATmreoo69iX4SJQA8dXTq8EpLhVKVS8t70xg_rNEp5j7DJWFvaud8ZEP14k-2TurbfX5MvIZNt4KQV6aybkmrmc_R_CaApxPQE9jcAw7-Ybr8FSyZm6Uw0YkpKvxzKeVOw1GnFxrX/s640/hungy-long-web%255B1%255D.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Few months ago we started the development of puzzle game which was focused on the knowledge of animals food chain and fast decision making. We decided to make tetris like game, where users could control the movements of the falling animals.&amp;nbsp;The challenge was to organize animals positions correctly to not run out of space for new animals.&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In the game animals on the top can eat animals on the bottom only if they can eat them in the real world. After all we got the game, which screenshots are shown bellow.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img alt=&quot;Hungy: Finish&quot; border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDU8S5mPcBNC4aH3RBes4MTkMTfdVnJFix7zyh07ok8cssh6Cormg8teiJEEA8mwHJ8HrZ_ibYHZKNukFUaWdWd-7Y7KZqZTXI-s593iH9QBdvD9IPyQg1e8OJOqvaoijavfsPrEExD0it/s200/4.png&quot; title=&quot;Hungy: Finish&quot; width=&quot;120&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;img alt=&quot;Hungy: New level&quot; border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcuWKmISyojN_hugnOPOPPQEKwpMw7EGQH7j2xBaZG7WRfpCD63QpvRMjzELz8E9yRvC1NJ98ko2Yw5Z4v2XM1K6YyEdcp_ucnktHnokV4gt3xuQEUt_pFF82Ni53uFIsnkttwVrK1EsqM/s200/1.png&quot; title=&quot;Hungy: New level&quot; width=&quot;120&quot; /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUFb5dpJCOCR8TXsRMpqaWDRSzctB7Hu5NX14ynV1dIM2JCFuf1bHgNDyfAwLJIJ5BtN9lDyHhHqeVAkJPI868jZ3UjonncQXKHbaPhWc4MGbFlGC6Me0wW8zr_17IavPYcvtV42y7AQq4/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Hungy: Menu&quot; border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUFb5dpJCOCR8TXsRMpqaWDRSzctB7Hu5NX14ynV1dIM2JCFuf1bHgNDyfAwLJIJ5BtN9lDyHhHqeVAkJPI868jZ3UjonncQXKHbaPhWc4MGbFlGC6Me0wW8zr_17IavPYcvtV42y7AQq4/s200/3.png&quot; title=&quot;Hungy: Menu&quot; width=&quot;120&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgURg3-kzoZJmdyE7aPzZZLLgADsqpnYruvov2TuXW41U2DlhNgS4nmYIxh0UwhzMKzQb2bdhZ2PCGdhYKoFZp4YQFUAD4zN7xJc0tto6v_z0lGeK09XgZNi_GVl66Qj7bL17TqFpLyrZsZ/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img alt=&quot;Hungy: Playing game&quot; border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgURg3-kzoZJmdyE7aPzZZLLgADsqpnYruvov2TuXW41U2DlhNgS4nmYIxh0UwhzMKzQb2bdhZ2PCGdhYKoFZp4YQFUAD4zN7xJc0tto6v_z0lGeK09XgZNi_GVl66Qj7bL17TqFpLyrZsZ/s200/2.png&quot; title=&quot;Hungy: Playing game&quot; width=&quot;120&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now our amazing game is available in the windows phone store:&amp;nbsp;&lt;a href=&quot;https://www.windowsphone.com/en-am/store/app/hungy/36319ee3-a15c-43cc-af5d-e02398c6fe84&quot;&gt;https://www.windowsphone.com/en-am/store/app/hungy/36319ee3-a15c-43cc-af5d-e02398c6fe84&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Please, download, play and leave us your feedback.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/5371822195240480105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2015/07/hungy-new-puzzle-game-for-widows-phone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/5371822195240480105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/5371822195240480105'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2015/07/hungy-new-puzzle-game-for-widows-phone.html' title='Hungy: new puzzle game for widows phone'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWvh5ATmreoo69iX4SJQA8dXTq8EpLhVKVS8t70xg_rNEp5j7DJWFvaud8ZEP14k-2TurbfX5MvIZNt4KQV6aybkmrmc_R_CaApxPQE9jcAw7-Ybr8FSyZm6Uw0YkpKvxzKeVOw1GnFxrX/s72-c/hungy-long-web%255B1%255D.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-2755271300140315150</id><published>2015-02-06T01:22:00.001-08:00</published><updated>2015-02-06T01:22:23.619-08:00</updated><title type='text'>Using DHL web services in your .net application OR How to call DHL XML-PI services using C# language</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Like the all big shipping providers, DHL also provides web services which can be used to retrieve the rate of the desired shipping, order a shipping, and accomplish nearly all the tasks which can be done in the DHL office.&lt;br /&gt;
&lt;br /&gt;
The problem for .Net developers is that the services provided by DHL are XML PI services, which, according to google, expends as an &quot;XML Processing instructions services&quot;, and which are not native for .net developers. After few minutes of googling you`ll find a lot of questions on how to integrate these services with your application and no clear answer.&lt;br /&gt;
&lt;br /&gt;
Here are the simple steps and a small C# code, which demonstrates the Rate retrieval from DHL service.&lt;br /&gt;
&lt;br /&gt;
1. First of all, you`ll need a&amp;nbsp;XML-PI Toolkit, where you can find a good documentation and sample requests. You can get this toolkit from &lt;a href=&quot;http://www.dhl-usa.com/en/express/resource_center/integrated_shipping_solutions/request_xml_toolkit.html&quot;&gt;here&lt;/a&gt;. By the way &lt;a href=&quot;http://www.dhl-usa.com/en/express/resource_center/integrated_shipping_solutions/integrating_xml_services.html&quot;&gt;here&amp;nbsp;&lt;/a&gt;&amp;nbsp;you can find good information about&amp;nbsp;developing with DHL Integration Solutions.&lt;br /&gt;
2. There is a &lt;a href=&quot;https://xmlpi-validation.dhl.com/serviceval/jsps/main/Main_menu.jsp&quot;&gt;web site&lt;/a&gt;, where you can validate your requests. Also in this site you&#39;`ll find the Urls of the web services. In our case we`ll use the following Uri:&amp;nbsp;&lt;a href=&quot;http://xmlpitest-ea.dhl.com/XMLShippingServlet&quot;&gt;http://xmlpitest-ea.dhl.com/XMLShippingServlet&lt;/a&gt;.&lt;br /&gt;
3. And here is the small code, which demonstrates the call of the DHL service:&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt; 

        string requestText = @&quot;here must be your XML request text. The samples can be found in toolkit. I used the NonDutiable Req.xml. By the way change the Date property to the action date in the xml, before sending the request.&quot;;

            WebRequest requestRate = HttpWebRequest.Create(&quot;http://xmlpitest-ea.dhl.com/XMLShippingServlet&quot;);
            requestRate.ContentType = &quot;application/x-www-form-urlencoded&quot;;
            requestRate.Method = &quot;POST&quot;;

            using (var stream = requestRate.GetRequestStream())
            {
                var arrBytes =  System.Text.ASCIIEncoding.ASCII.GetBytes(requestText);
                stream.Write(arrBytes, 0, arrBytes.Length);
                stream.Close();
            }

            WebResponse responseRate = requestRate.GetResponse();
            var respStream = responseRate.GetResponseStream();
            var reader = new StreamReader(respStream, System.Text.Encoding.ASCII);
            string strResponse = reader.ReadToEnd();
            respStream.Close();

&lt;/pre&gt;
If you`ll have further questions, write them in the comments below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/2755271300140315150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2015/02/using-dhl-web-services-in-your-net.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/2755271300140315150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/2755271300140315150'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2015/02/using-dhl-web-services-in-your-net.html' title='Using DHL web services in your .net application OR How to call DHL XML-PI services using C# language'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-1846440554945245931</id><published>2013-06-06T00:58:00.003-07:00</published><updated>2013-06-06T01:04:26.536-07:00</updated><title type='text'>Office Open XML cell.StyleIndex OR how to set style of your cell using OpenXML</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Have you ever tried to set style of a cell of your Excel document? If not, then trust me, it is not an easy task :)&lt;br /&gt;
Even changing background colour of a cell is becoming whole challenge in OpenXML. The only thing which you can &amp;nbsp;do is to set&amp;nbsp;&amp;nbsp;cell.StyleIndex in your code. What value must be assigned to this property is a big story. For interest you can read some information and ways to do this in&amp;nbsp;&lt;a href=&quot;http://bloggingmath.wordpress.com/2010/07/21/setting-a-cell-color-with-open-xml-spreadsheetml/&quot;&gt;http://bloggingmath.wordpress.com/2010/07/21/setting-a-cell-color-with-open-xml-spreadsheetml/&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/hh180830%28v=office.14%29.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/hh180830%28v=office.14%29.aspx&lt;/a&gt;. The way, which I am proposing is much easer compared the ones ,which you will find in google and big.&lt;br /&gt;
&lt;br /&gt;
Here are the steps to set custom style to your cell.&lt;br /&gt;
&lt;br /&gt;
1. Create excel document, which you will use as a template in your code. You will need it anyway.&lt;br /&gt;
2. Create new excel sheet in your document and set it`s style to the one, you want. In the image above this cell is B4.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsqksoluHaqHLgB9ZD95W-vNxPmHuvc9gFNGc57l2j7B9AR63GPuN4jXzjJpG8Abuwg-DrM2PXuz4N3e0bpDEypJMeUa1tvtXg6F3_nTlLGjbBUfGEN-1gDDPGulWqqQB-Dtoi3GhrXjsU/s1600/openxmlstyle1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsqksoluHaqHLgB9ZD95W-vNxPmHuvc9gFNGc57l2j7B9AR63GPuN4jXzjJpG8Abuwg-DrM2PXuz4N3e0bpDEypJMeUa1tvtXg6F3_nTlLGjbBUfGEN-1gDDPGulWqqQB-Dtoi3GhrXjsU/s400/openxmlstyle1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
3. Get the style index of this cell and assign it to the cell, which style you want to change.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
The code will be something similar this:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush: js&quot;&gt; 
//Retrieve style index &amp;nbsp;
cell = GetCell(worksheetPart.Worksheet, &quot;B&quot;, 4);
UInt32Value styleIndex = cell.StyleIndex;
//Set style index to other cell
cell = GetCell(worksheetPart.Worksheet, &quot;A&quot;, 12);
cell.CellValue = new CellValue(&quot;Управление проектом&quot;);
cell.DataType = new EnumValue&amp;lt;CellValues&amp;gt;(CellValues.String);
cell.StyleIndex = styleIndex;&lt;/div&gt;
&lt;/pre&gt;
&lt;/div&gt;
4. That is it. You solved the challenge by writing few lines of code.
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
You can also hide sheet 2 in you template excel document, so clients will not see it in the generated document.&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/1846440554945245931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2013/06/office-open-xml-cellstyleindex-or-how.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1846440554945245931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1846440554945245931'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2013/06/office-open-xml-cellstyleindex-or-how.html' title='Office Open XML cell.StyleIndex OR how to set style of your cell using OpenXML'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsqksoluHaqHLgB9ZD95W-vNxPmHuvc9gFNGc57l2j7B9AR63GPuN4jXzjJpG8Abuwg-DrM2PXuz4N3e0bpDEypJMeUa1tvtXg6F3_nTlLGjbBUfGEN-1gDDPGulWqqQB-Dtoi3GhrXjsU/s72-c/openxmlstyle1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-7589430549437030139</id><published>2013-04-17T03:48:00.003-07:00</published><updated>2013-04-17T03:48:39.681-07:00</updated><title type='text'>Importing organisation in MS CRM 4,0</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Task:&lt;/b&gt; Import organisation with existing database to CRM 4.&lt;br /&gt;
&lt;b&gt;Solution: &lt;/b&gt;The solution is&amp;nbsp;obvious&amp;nbsp;- restore existing database in SQL Server and then import organisation via Deployment Manager. Also there are a lot of articles, which can help you accomplish this task. One of them is&amp;nbsp;&lt;a href=&quot;http://www.tribridge.com/Blog/crm/default/2011-06-14/How-to-Migrate-CRM-4-SQL-2005-32-bit-to-SQL-2008-64-bit-Environment.aspx&quot;&gt;http://www.tribridge.com/Blog/crm/default/2011-06-14/How-to-Migrate-CRM-4-SQL-2005-32-bit-to-SQL-2008-64-bit-Environment.aspx&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
During import process you can get&amp;nbsp;differer&amp;nbsp;errors. The error which we were getting was the following:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
15:12:23| &amp;nbsp;Error| Import Organization (Name=Orgname, Id=edff439a-85a6-e211-bd62-005056b1659d) failed with Exception:&lt;br /&gt;System.Data.SqlClient.SqlException: &lt;b&gt;Invalid column name &#39;new_businessunit_opportunity_id&#39;.&lt;br /&gt;Invalid column name &#39;new_base_rate&#39;&lt;/b&gt;.&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()&lt;br /&gt;&amp;nbsp; &amp;nbsp;at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at Microsoft.Crm.Tools.Admin.DBImportHelper.UpdateSystemUserReferences(IDbCommand command, Guid oldSystemUserId, Guid newSystemUserId, Guid newAdObjectGuid, DomainAccount newAdDomainAccount)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at Microsoft.Crm.Tools.Admin.DBImportHelper.UpdateSystemUserAndReferences(IDbCommand command, User user, Guid organizationId)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at Microsoft.Crm.Tools.Admin.ImportOrganizationInstaller.Import(Guid organizationId, String organizationUniqueName, String organizationFriendlyName, String sqlServerName, String databaseName, Uri reportServerUrl, String privilegedUserGroupName, String sqlAccessGroupName, String userGroupName, String reportingGroupName, String privilegedReportingGroupName, ICollection`1 users, MultipleTenancy multipleTenancy)&lt;br /&gt;15:12:23|Warning|&lt;b&gt; Attempting to cancel a long running process: ProgressWizard. This might leave the data in an invalid state and the application might not function correctly.&lt;/b&gt;&lt;/blockquote&gt;
&lt;div&gt;
At first we tried to understand what means &quot;new_base_rate is an invalid column&quot;. After hours of research we finally found the resolution. The problem in our environment was the size of users in CRM. We had a lot of users, which import process was taking long time. After fixed time CRM automaticly was&amp;nbsp;cancelling&amp;nbsp;import process and logging these strange &quot;invalid column&quot; messages. Also, you can notice &quot;Attempting to cancel a long running process:&quot;, which was really the cause of the problem. To resolve this issue you need to do the following:&lt;/div&gt;
&lt;div&gt;
1. Check rollup versions in your development and real servers. There must be the same.&lt;/div&gt;
&lt;div&gt;
2. Run deployment manager as a domain administrator&lt;/div&gt;
&lt;div&gt;
3. Create few registry keys in your server (&lt;a href=&quot;http://blogs.technet.com/b/crmchina/archive/2010/05/28/crm-4-0-import-organization.aspx&quot;&gt;http://blogs.technet.com/b/crmchina/archive/2010/05/28/crm-4-0-import-organization.aspx&lt;/a&gt;):&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18.15625px;&quot;&gt;DWORD OptimizeOrgImport = 1&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;DWORD OLEDBTimeout = 86400&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;DWORD ExtendedTimeout = 1000000&lt;/span&gt;&lt;/h3&gt;
&lt;b&gt;Key location &lt;/b&gt;-&amp;nbsp;HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ MSCRM&lt;/blockquote&gt;
4. Also, you can get a warning:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Check OrganizationDatabaseVersionValidator : Warning: The organization database selected for import is a different version than the organization database that is currently deployed.&amp;nbsp;&lt;/blockquote&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #c9d7f1;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;div&gt;
&lt;span style=&quot;line-height: 18.15625px;&quot;&gt;This does not somehow influence on the&amp;nbsp;behavioured&amp;nbsp;of import process.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18.15625px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18.15625px;&quot;&gt;
That is it. This steps solved our problem.&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/7589430549437030139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2013/04/importing-organisation-in-ms-crm-40.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/7589430549437030139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/7589430549437030139'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2013/04/importing-organisation-in-ms-crm-40.html' title='Importing organisation in MS CRM 4,0'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-7020528991949642838</id><published>2013-03-26T07:35:00.002-07:00</published><updated>2013-03-26T07:40:18.493-07:00</updated><title type='text'>SharePoint 2013: RelatedItems column in WebPart</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Task: Show related items in the web part like the image bellow:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz1NugkBV2zT5waAXueypop2dtD3IqCdQA9e44fnRa7lllj8o8Wq3Jriq3mLf8udUOFZd6skeAevtWuV-82y3QWR6ZJ9Em_qk1IjlhJQQnNFYjlnOCAQPFUp3nVcSy_tq0WRuNa5n65BGZ/s1600/sharepoint+related+items.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz1NugkBV2zT5waAXueypop2dtD3IqCdQA9e44fnRa7lllj8o8Wq3Jriq3mLf8udUOFZd6skeAevtWuV-82y3QWR6ZJ9Em_qk1IjlhJQQnNFYjlnOCAQPFUp3nVcSy_tq0WRuNa5n65BGZ/s400/sharepoint+related+items.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Resolution:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Add the following code in your web part under &amp;lt;xsl:template name=&quot;dvt_1.rowview&quot;&amp;gt; in the html table, where all other fields are.&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;   
&amp;lt;tr&amp;gt;
      &amp;lt;td width=&quot;190px&quot; valign=&quot;top&quot; class=&quot;ms-formlabel&quot;&amp;gt;
       &amp;lt;H3 class=&quot;ms-standardheader&quot;&amp;gt;
        &amp;lt;nobr&amp;gt;Связанные элементы&amp;lt;/nobr&amp;gt;
       &amp;lt;/H3&amp;gt;
      &amp;lt;/td&amp;gt;
      &amp;lt;td width=&quot;400px&quot; valign=&quot;top&quot; class=&quot;ms-formbody&quot;&amp;gt;       
       &amp;lt;SharePoint:FormField runat=&quot;server&quot; FieldName=&quot;RelatedItems&quot; ControlMode=&quot;Display&quot;  ListId=&quot;de8beacf-5505-47cd-80a6-aa44e7ffe2f4&quot; /&amp;gt; 
      &amp;lt;/td&amp;gt;
     &amp;lt;/tr&amp;gt;
&lt;/pre&gt;
&lt;pre class=&quot;brush: js&quot;&gt;
&lt;/pre&gt;
&lt;pre class=&quot;brush: js&quot;&gt;By the way, you need to set listid to the GUID of the List, which item is related to task.&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/7020528991949642838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2013/03/sharepoint-2013-relateditems-column-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/7020528991949642838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/7020528991949642838'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2013/03/sharepoint-2013-relateditems-column-in.html' title='SharePoint 2013: RelatedItems column in WebPart'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz1NugkBV2zT5waAXueypop2dtD3IqCdQA9e44fnRa7lllj8o8Wq3Jriq3mLf8udUOFZd6skeAevtWuV-82y3QWR6ZJ9Em_qk1IjlhJQQnNFYjlnOCAQPFUp3nVcSy_tq0WRuNa5n65BGZ/s72-c/sharepoint+related+items.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-2348347236134867420</id><published>2013-03-26T01:07:00.000-07:00</published><updated>2013-03-26T01:12:54.073-07:00</updated><title type='text'>CRM 4: Create custom button in associated list view menu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Have you ever tried to remove &quot;Add existing button&quot; or add your new custom button to associated list view menu like the image bellow?&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgADO99GG3TRsTeCjmLDL4NtSLj8yL2ucKahimykXEAtWbxIlYyY5Tx82NOoGWGRJv9t-bigJKXsBOHyRcYvGYBHeJH05CJY284NfTlYBeipGfR4HPCgPXGpNliEM_hPu6tpFgfgruEDtVw/s1600/menubutton.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgADO99GG3TRsTeCjmLDL4NtSLj8yL2ucKahimykXEAtWbxIlYyY5Tx82NOoGWGRJv9t-bigJKXsBOHyRcYvGYBHeJH05CJY284NfTlYBeipGfR4HPCgPXGpNliEM_hPu6tpFgfgruEDtVw/s400/menubutton.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ok, by few lines of JS you can do this. Here is how:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
1. &quot;Add existing&quot; button can be removed using the steps described by Daniel CAI in &lt;a href=&quot;http://danielcai.blogspot.in/2010/03/mscrm-40-remove-existing-xxxxx-to-this.html&quot;&gt;this&amp;nbsp;&lt;/a&gt;excellent&amp;nbsp;blog post.&lt;br /&gt;
2. I added function &quot;createCustomNavButton&quot; to the code of Daniel, which will allow you to add custom buttons.&lt;br /&gt;
Ok, here is the whole code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;function changeButtons(navItemId, relName) {
    var clickActionPattern = /loadArea\([&#39;&quot;]{1}([A-Za-z0-9_]+)[&#39;&quot;]{1}(, ?[&#39;&quot;]\\x26roleOrd\\x3d(\d)[&#39;&quot;])*\).*/;
    var iframe
      , roleOrd;

    var removeAddExistingButton = function () {
        var frameDoc = iframe.contentWindow.document;
        if (!frameDoc) return;

        var grid = frameDoc.all[&#39;crmGrid&#39;];
        if (!grid) return;

        var otc = grid.GetParameter(&#39;otc&#39;);

        // Locate the &quot;Add Existing&quot; button using its magic id.  
        var btnId = (!roleOrd)
                  ? &#39;_MBtoplocAssocOneToMany&#39; + otc + relName.replace(/_/g, &quot;&quot;)
                  : &#39;_MBtoplocAssocObj&#39; + otc + relName.replace(/_/g, &quot;&quot;) + roleOrd;

        var btn = frameDoc.getElementById(btnId);
        if (btn) {
            btn.parentNode.removeChild(btn);

        }
    };

    var createCustomNavButton = function (caption, action, iconuri) {
        var frameDoc = iframe.contentWindow.document;
        if (!frameDoc) return;

        var grid = frameDoc.all[&#39;crmGrid&#39;];
        if (!grid) return;

        var otc = grid.GetParameter(&#39;otc&#39;);

        // Locate the &quot;Add Existing&quot; button using its magic id.  
        var btnId = (!roleOrd)
                  ? &#39;_MBtoplocAssocOneToMany&#39; + otc + relName.replace(/_/g, &quot;&quot;)
                  : &#39;_MBtoplocAssocObj&#39; + otc + relName.replace(/_/g, &quot;&quot;) + roleOrd;

        var btn = frameDoc.getElementById(btnId);
        if (btn) {
        debugger;
        var newButtonHtml = &#39;
&lt;li class=&quot;ms-crm-Menu&quot; onclick=&quot;&#39;+action+&#39;&quot; title=&quot;&#39; + caption + &#39;&quot;&gt;&#39;
                + &#39;&lt;span class=&quot;ms-crm-Menu-Label&quot;&gt;&lt;a class=&quot;ms-crm-Menu-Label&quot; href=&quot;javascript:onclick();&quot; onclick=&quot;return false;&quot; target=&quot;_self&quot;&gt;&#39;
                + &#39;&lt;img alt=&quot;&#39; + caption + &#39;&quot; class=&quot;ms-crm-Menu-ButtonFirst&quot; src=&quot;&#39; + iconuri + &#39;&quot; /&gt;&lt;span class=&quot;ms-crm-MenuItem-TextRTL&quot;&gt;&#39; + caption + &#39;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&#39;;

            var newHtml = btn.parentElement.innerHTML + newButtonHtml;
            btn.parentElement.innerHTML = newHtml;
        }
    };

    var onReadyStateChange = function () {
                var bn = crmForm.all.new_businessunit_opportunity_id.DataValue;
                if (bn != null &amp;amp;&amp;amp; (bn[0].name == &#39;ECM.ЛБ&#39; || bn[0].name == &#39;ECM.ЛБ через СИ&#39;)) {
                    createCustomNavButton(&#39;Посмотреть ФРП&#39;, &quot;window.open(&#39;https://server/?oppid=&quot; + crmForm.ObjectId + &quot;&#39;, &#39;&#39;, &#39;width=200,height=100&#39;);&quot;, &quot;https://server/_imgs/ico/16_excel.gif&quot;);
                    createCustomNavButton(&#39;Отправить на согласование ФРП&#39;, &quot;window.open(&#39;https://server?oppid=&quot; + crmForm.ObjectId + &quot;&#39;, &#39;&#39;, &#39;width=290,height=300&#39;);&quot;, &quot;https://server/_imgs/sharepoint.gif&quot;);
            removeAddExistingButton();
        }
    };

    (function init() {
        if (!crmForm.ObjectId) return;

        var navItem = document.getElementById(navItemId);
        if (!navItem) return;

        var clickAction = navItem.getAttributeNode(&#39;onclick&#39;).nodeValue;
        if (!clickAction || !clickActionPattern.test(clickAction))
            return;

        var areaId = clickAction.replace(clickActionPattern, &#39;$1&#39;);
        roleOrd = clickAction.replace(clickActionPattern, &#39;$3&#39;);

        navItem.onclick = function loadAreaOverride() {
            if (!roleOrd)
                loadArea(areaId);
            else
                loadArea(areaId, &#39;\x26roleOrd\x3d&#39; + roleOrd);


            iframe = document.getElementById(areaId + &#39;Frame&#39;);
            if (!iframe) return;

            iframe.attachEvent(&#39;onreadystatechange&#39;, onReadyStateChange);
        }
    })();
}
changeButtons(&#39;nav_new_opportunity_new_frp&#39;, &#39;new_opportunity_new_frp&#39;);
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/2348347236134867420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2013/03/crm-4-create-custom-button-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/2348347236134867420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/2348347236134867420'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2013/03/crm-4-create-custom-button-in.html' title='CRM 4: Create custom button in associated list view menu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgADO99GG3TRsTeCjmLDL4NtSLj8yL2ucKahimykXEAtWbxIlYyY5Tx82NOoGWGRJv9t-bigJKXsBOHyRcYvGYBHeJH05CJY284NfTlYBeipGfR4HPCgPXGpNliEM_hPu6tpFgfgruEDtVw/s72-c/menubutton.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-452323239609667003</id><published>2013-03-22T02:10:00.000-07:00</published><updated>2013-03-22T02:18:20.344-07:00</updated><title type='text'>SharePoint 2013: Approve and Reject buttons on DispForm.aspx of task</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Task:&lt;/b&gt; Create custom view form, which will contain 2 buttons allowing to accept and reject&amp;nbsp;task&amp;nbsp;&amp;nbsp;(Set TaskOutcome field) in view mode.&lt;br /&gt;
Something like this:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidUD9y7Mn51KUjnpvZ7asSv3sz_AXbdwmMHO51HxjncB_JZfeynx2w617UFxcOyUiqCz6t7jv3JScLCCzhqnYfApBdApaQqNw0UKIkeN7NvPK6PlnWnNm3hFgYgBC5Sqioh5c9OPAefNwD/s1600/taskform.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidUD9y7Mn51KUjnpvZ7asSv3sz_AXbdwmMHO51HxjncB_JZfeynx2w617UFxcOyUiqCz6t7jv3JScLCCzhqnYfApBdApaQqNw0UKIkeN7NvPK6PlnWnNm3hFgYgBC5Sqioh5c9OPAefNwD/s400/taskform.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Resolution:&lt;/b&gt;&lt;br /&gt;
1. Create custom form &amp;nbsp;in SharePoint 2013 designer and set it as default form.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM8AV1Ke_yWqBLDvvzpQj2kdG1mPnnJPZXF_r6-YflRwda_NTXZwLqCJIn_lomXpRTDkg_s-JCdfp4z7CmmsHMkGznuPEImXXVO2qDl10hoKg73-1CoJ9liJRzxe2rqPWaZ2Es88M3J4eW/s1600/sharepoint-newform.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;110&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM8AV1Ke_yWqBLDvvzpQj2kdG1mPnnJPZXF_r6-YflRwda_NTXZwLqCJIn_lomXpRTDkg_s-JCdfp4z7CmmsHMkGznuPEImXXVO2qDl10hoKg73-1CoJ9liJRzxe2rqPWaZ2Es88M3J4eW/s400/sharepoint-newform.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0CTAG6T76s8jdyR8LSojA5FrvIFNpQ3LvscED_ibsUnpZM-ng0JODeEhxJuX8xLuP_8Gqp1MKdezHc6285b7msAtEArEOX18GIAZobh9PIFAf-_aP3uvIBz1SK5Y-i1ej7aI12Psg5zI7/s1600/sharepoint-newform.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0CTAG6T76s8jdyR8LSojA5FrvIFNpQ3LvscED_ibsUnpZM-ng0JODeEhxJuX8xLuP_8Gqp1MKdezHc6285b7msAtEArEOX18GIAZobh9PIFAf-_aP3uvIBz1SK5Y-i1ej7aI12Psg5zI7/s320/sharepoint-newform.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
2. Add buttons to form inside&lt;b&gt; xsl:template name=&quot;dvt_1.body&quot;&lt;/b&gt; tag.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;   &lt;input name=&quot;btnAccept&quot; onclick=&quot;javascript: updateItem(&#39;Утвержден&#39;); {ddwrt:GenFireServerEvent(&#39;__commit;__redirect={/gal/_layouts/15/start.aspx#/DocLib/Forms/view.aspx}&#39;)}&quot; type=&quot;button&quot; value=&quot;Утвердить&quot; /&gt;
   &lt;br /&gt;
   
   &lt;input name=&quot;btnCancel&quot; onclick=&quot;javascript: updateItem(&#39;Отклонен&#39;); {ddwrt:GenFireServerEvent(&#39;__commit;__redirect={/gal/_layouts/15/start.aspx#/DocLib/Forms/view.aspx}&#39;)}&quot; type=&quot;button&quot; value=&quot;Отклонить&quot; /&gt;
      &lt;br /&gt;
      
   &lt;sharepoint:gobackbutton controlmode=&quot;Edit&quot; id=&quot;gobackbutton&quot; runat=&quot;server&quot;&gt;
   &lt;/sharepoint:gobackbutton&gt;&lt;br /&gt;


&lt;/pre&gt;
&lt;div&gt;
&lt;/div&gt;
3. Add ScriptEditorWebPart. Add the following code inside it:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;var QueryString = function () {
  // This function is anonymous, is executed immediately and 
  // the return value is assigned to QueryString!
  var query_string = {};
  var query = window.location.search.substring(1);
  var vars = query.split(&quot;&amp;amp;&quot;);
  for (var i=0;i&amp;lt;vars.length;i++) {
    var pair = vars[i].split(&quot;=&quot;);
     // If first entry with this name
    if (typeof query_string[pair[0]] === &quot;undefined&quot;) {
      query_string[pair[0]] = pair[1];
     // If second entry with this name
    } else if (typeof query_string[pair[0]] === &quot;string&quot;) {
      var arr = [ query_string[pair[0]], pair[1] ];
      query_string[pair[0]] = arr;
     // If third or later entry with this name
    } else {
      query_string[pair[0]].push(pair[1]);
    }
  } 
    return query_string;
} ();

function onQuerySucceeded() {

    //alert(&#39;Item updated!&#39;);
}

function onQueryFailed(sender, args) {

    alert(&#39;Request failed. &#39; + args.get_message() + &#39;\n&#39; + args.get_stackTrace());
}

function updateItem(taskoutcome) {
   var clientContext = new SP.ClientContext.get_current();
   var oList = clientContext.get_web().get_lists().getByTitle(&#39;Задачи&#39;);
   this.oListItem = oList.getItemById(QueryString.ID);
   oListItem.set_item(&#39;TaskOutcome&#39;, taskoutcome);
   oListItem.set_item(&#39;Status&#39;, &#39;Завершена&#39;);

  var bodycontent = document.getElementById(&#39;bodytdid&#39;).innerHTML;
  oListItem.set_item(&#39;Body&#39;, bodycontent);

   oListItem.update();              
   clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
That is it. Everything is done.&amp;nbsp;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/452323239609667003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2013/03/sharepoint-2013-approve-and-reject.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/452323239609667003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/452323239609667003'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2013/03/sharepoint-2013-approve-and-reject.html' title='SharePoint 2013: Approve and Reject buttons on DispForm.aspx of task'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidUD9y7Mn51KUjnpvZ7asSv3sz_AXbdwmMHO51HxjncB_JZfeynx2w617UFxcOyUiqCz6t7jv3JScLCCzhqnYfApBdApaQqNw0UKIkeN7NvPK6PlnWnNm3hFgYgBC5Sqioh5c9OPAefNwD/s72-c/taskform.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-5645395639709176176</id><published>2012-12-17T01:12:00.003-08:00</published><updated>2012-12-17T01:13:12.012-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CRM"/><category scheme="http://www.blogger.com/atom/ns#" term="iis 6"/><category scheme="http://www.blogger.com/atom/ns#" term="silverlight"/><category scheme="http://www.blogger.com/atom/ns#" term="wcf"/><title type='text'>Steps you need to check when hosting Silverlight on IIS 6</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
When you are hosting a Silverlight application on ISS, you need at first check the following things:&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;1. .svc file type is mapped to the aspnet_isapi.dll. &lt;/b&gt;If it is not, then you`ll see the following screen, when opening your .svc in web browser:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWOMMDMkJYUpcse01NubDdbeL8qftTVINTgEodHpLYApydjWkNnShlkBzekUIpJfgst6DeHZEgSAcet-F19swBnMmdYz5LTH1Jy2L2nIcOZ7s6OhaAfR3Hn6Otx5CmgF_-f8aSkd72mTOE/s1600/silverlight+crm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWOMMDMkJYUpcse01NubDdbeL8qftTVINTgEodHpLYApydjWkNnShlkBzekUIpJfgst6DeHZEgSAcet-F19swBnMmdYz5LTH1Jy2L2nIcOZ7s6OhaAfR3Hn6Otx5CmgF_-f8aSkd72mTOE/s400/silverlight+crm.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;To correct this issue do the following:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;To verify that the svc file type is mapped to be handled by aspnet_isapi.dll in IIS 5.1 or 6.0&lt;/span&gt;&lt;br /&gt;
&lt;ol class=&quot;ordered&quot; style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
From the&amp;nbsp;&lt;strong&gt;Start&lt;/strong&gt;&amp;nbsp;menu, right-click&amp;nbsp;&lt;strong&gt;Computer&lt;/strong&gt;, then click&amp;nbsp;&lt;strong&gt;Manage&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Expand&amp;nbsp;&lt;strong&gt;Services and Applications, Internet Information Services&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Right-click&amp;nbsp;&lt;strong&gt;Web Sites&lt;/strong&gt;&amp;nbsp;and select&amp;nbsp;&lt;strong&gt;Properties&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
On the&amp;nbsp;&lt;strong&gt;Home Directory&lt;/strong&gt;&amp;nbsp;tab, click&amp;nbsp;&lt;strong&gt;Configuration&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
In the list of application mappings, verify that the .svc file is mapped to the aspnet_isapi.dll. If the file has not been mapped:&lt;/div&gt;
&lt;/li&gt;
&lt;ol class=&quot;ordered&quot;&gt;
&lt;li&gt;Click&amp;nbsp;&lt;strong&gt;Add&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the&amp;nbsp;&lt;strong&gt;Add/Edit Application Extension Mapping&lt;/strong&gt;&amp;nbsp;dialog box, click&amp;nbsp;&lt;strong&gt;Browse&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Browse to the folder that contains the aspnet_isapi.dll, select the file, then click&amp;nbsp;&lt;strong&gt;Open&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Specify .svc as the extension.&lt;/li&gt;
&lt;li&gt;Make sure&amp;nbsp;&lt;strong&gt;Check that file exists&lt;/strong&gt;&amp;nbsp;is unchecked.&lt;/li&gt;
&lt;li&gt;Click&amp;nbsp;&lt;strong&gt;OK&lt;/strong&gt;, and&amp;nbsp;&lt;strong&gt;OK&lt;/strong&gt;&amp;nbsp;again to return to the&amp;nbsp;&lt;strong&gt;Web Sites Properties&lt;/strong&gt;&amp;nbsp;dialog box.&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;To verify that the svc file type is mapped correctly in IIS 7.0&lt;/span&gt;&lt;br /&gt;
&lt;ol class=&quot;ordered&quot; style=&quot;font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Open a command prompt window and type&amp;nbsp;&lt;strong&gt;start inetmgr&lt;/strong&gt;&amp;nbsp;to open the Internet Information Services (IIS) MMC snap-in.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
In the left pane, expand the node with the computer&#39;s name, then expand the&amp;nbsp;&lt;strong&gt;Web Sites&lt;/strong&gt;&amp;nbsp;node, and then select the&amp;nbsp;&lt;strong&gt;Default Web Site&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
Double-click&amp;nbsp;&lt;strong&gt;Handler mappings in the Features View&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;color: #2a2a2a; line-height: 18px; padding-bottom: 15px;&quot;&gt;
In the list of application mappings, verify that the .svc file is mapped to the aspnet_isapi.dll. If the file has not been mapped:&lt;/div&gt;
&lt;/li&gt;
&lt;ol class=&quot;ordered&quot;&gt;
&lt;li&gt;Click&amp;nbsp;&lt;strong&gt;Add Managed Handler&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Type&amp;nbsp;&lt;strong&gt;*.svc&lt;/strong&gt;&amp;nbsp;into the&amp;nbsp;&lt;strong&gt;Request path:&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Type&amp;nbsp;&lt;strong&gt;System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/strong&gt;&amp;nbsp;into the&amp;nbsp;&lt;strong&gt;Type&lt;/strong&gt;&amp;nbsp;textbox.&lt;/li&gt;
&lt;li&gt;Type&amp;nbsp;&lt;strong&gt;svc-Integrated&lt;/strong&gt;&amp;nbsp;into the&amp;nbsp;&lt;strong&gt;Name:&lt;/strong&gt;&amp;nbsp;textbox.&lt;/li&gt;
&lt;li&gt;Click&amp;nbsp;&lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click&amp;nbsp;&lt;strong&gt;Add Script Map&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Type&amp;nbsp;&lt;strong&gt;*.svc&lt;/strong&gt;&amp;nbsp;into the&amp;nbsp;&lt;strong&gt;Request path:&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Type&amp;nbsp;&lt;strong&gt;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll&lt;/strong&gt;&amp;nbsp;into the&amp;nbsp;&lt;strong&gt;Executable:&lt;/strong&gt;&amp;nbsp;text box.&lt;/li&gt;
&lt;li&gt;Type&amp;nbsp;&lt;strong&gt;svc-ISAPI-2.0&lt;/strong&gt;&amp;nbsp;into the&amp;nbsp;&lt;strong&gt;Name:&lt;/strong&gt;&amp;nbsp;text box.&lt;/li&gt;
&lt;li&gt;Using the Move Up/Move Down controls, ensure that the managed handler (svc-Integrated) appears before the aspnet_isapi (svc-ISAPI-2.0) handler in the list.&lt;/li&gt;
&lt;li&gt;Click&amp;nbsp;&lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9OSLbzP00EFsLDA7W9ZGcCDSPwxiJkeHvZV3p-Fgua32L-i1hAIS7I4M1icZcfbfOupopIm0K6dcUv0z397wGvpgTMPB8ElAORj2Hn_eChoYExp4z316XWEag9IYFlQ9OoyatsWFF4kH7/s1600/iis+crm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9OSLbzP00EFsLDA7W9ZGcCDSPwxiJkeHvZV3p-Fgua32L-i1hAIS7I4M1icZcfbfOupopIm0K6dcUv0z397wGvpgTMPB8ElAORj2Hn_eChoYExp4z316XWEag9IYFlQ9OoyatsWFF4kH7/s400/iis+crm.png&quot; width=&quot;370&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 16px;&quot;&gt;Source:&amp;nbsp;http://msdn.microsoft.com/en-us/library/ms752252%28v=vs.90%29.aspx&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 16px;&quot;&gt;After, you&#39;ll be able to see your wcf service in web browser:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFESu9zYr1q4wAmNgdYf_OCOZONrff__hRES1luqViDPola6XbJ-rdlQpZ2H4O_GQMCBFfr8POsSxvMWr0fAL2cVfdGxQXYtFLpKomS1jVGtgbNXYvDHj0LJb_oXM2UfPia5AW5yUXyT9j/s1600/wcf+crm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;321&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFESu9zYr1q4wAmNgdYf_OCOZONrff__hRES1luqViDPola6XbJ-rdlQpZ2H4O_GQMCBFfr8POsSxvMWr0fAL2cVfdGxQXYtFLpKomS1jVGtgbNXYvDHj0LJb_oXM2UfPia5AW5yUXyT9j/s400/wcf+crm.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Segoe UI, Lucida Grande, Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12px; line-height: 16px;&quot;&gt;2. Make suer your silverlight application is referencing correct wcf service. Common mistake is to left &quot;localhost://blam blam.cvs&quot; as the wcf service&amp;nbsp;reference.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/5645395639709176176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/12/steps-you-need-to-check-when-hosting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/5645395639709176176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/5645395639709176176'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/12/steps-you-need-to-check-when-hosting.html' title='Steps you need to check when hosting Silverlight on IIS 6'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWOMMDMkJYUpcse01NubDdbeL8qftTVINTgEodHpLYApydjWkNnShlkBzekUIpJfgst6DeHZEgSAcet-F19swBnMmdYz5LTH1Jy2L2nIcOZ7s6OhaAfR3Hn6Otx5CmgF_-f8aSkd72mTOE/s72-c/silverlight+crm.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-7512057942546300614</id><published>2012-12-14T01:30:00.003-08:00</published><updated>2013-03-24T22:04:06.878-07:00</updated><title type='text'>Host Silverlight Application on IIS 6</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
When hosting silverlight application on IIS6 you can get the following error message:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEQGhHFxFY91DnqMVsGxI8rpetkl8aQSI_W7PdJDkSk1-Hk6c1wktqgubgvu8hfSc7rs7T_iNA7uCN3ngt_7OadW_K01tXIratK51-hDVdSGZ82qXR3j1qLMhQ2xVHd7NfYXmtriruiXZt/s1600/Silverlight.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;261&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEQGhHFxFY91DnqMVsGxI8rpetkl8aQSI_W7PdJDkSk1-Hk6c1wktqgubgvu8hfSc7rs7T_iNA7uCN3ngt_7OadW_K01tXIratK51-hDVdSGZ82qXR3j1qLMhQ2xVHd7NfYXmtriruiXZt/s400/Silverlight.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;To fix this issue, do the following:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
&lt;b&gt;1. Adjust the Content Expiration Setting&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
You should adjust the content expiration setting to 1 minute. The following procedure outlines how to do this with IIS.&lt;/div&gt;
&lt;ol style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px;&quot;&gt;
Right-click&amp;nbsp;&amp;nbsp;&lt;b&gt;your Web Site&amp;nbsp;&lt;/b&gt;and select&amp;nbsp;&lt;b&gt;Properties&lt;/b&gt;&amp;nbsp;from the context menu.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px;&quot;&gt;
Select the&amp;nbsp;&lt;b&gt;HTTP Headers&lt;/b&gt;&amp;nbsp;tab and click &quot;Enable Content Expiration&quot;.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px;&quot;&gt;
Set the content to expire after 1 minute.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
&lt;b&gt;&lt;u&gt;2. Register MIME Types and File Extensions&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
You must register some MIME types and file extensions so that the browser on the client&#39;s system can load the correct handler. You need to add the following types:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
Extension&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
MIME Type&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
.xap&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
application/octet-stream&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
.xaml&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
application/xaml+xml&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
The .xap needs to have that mime type, in order to be able to be downloaded.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
&lt;u&gt;&lt;b&gt;3.&amp;nbsp;&lt;/b&gt;&lt;b&gt;Execute permissions must be Scripts Only.&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;
&lt;ol style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px;&quot;&gt;
Right-click&amp;nbsp;&amp;nbsp;&lt;b&gt;your Web Site&amp;nbsp;&lt;/b&gt;and select&amp;nbsp;&lt;b&gt;Properties&lt;/b&gt;&amp;nbsp;from the context menu.&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px;&quot;&gt;
Select the&amp;nbsp;&lt;b&gt;Directory&amp;nbsp;&lt;/b&gt;tab and change &quot;Execute Permissions&quot; to Script only.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 14px;&quot;&gt;
Thanks much to&amp;nbsp;http://geekswithblogs.net/SoftwareDoneRight/archive/2010/01/09/how-to-host-silverlight-apps-under-iis6.aspx&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/7512057942546300614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/12/host-silverlight-application-on-iis-6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/7512057942546300614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/7512057942546300614'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/12/host-silverlight-application-on-iis-6.html' title='Host Silverlight Application on IIS 6'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEQGhHFxFY91DnqMVsGxI8rpetkl8aQSI_W7PdJDkSk1-Hk6c1wktqgubgvu8hfSc7rs7T_iNA7uCN3ngt_7OadW_K01tXIratK51-hDVdSGZ82qXR3j1qLMhQ2xVHd7NfYXmtriruiXZt/s72-c/Silverlight.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-1009931769978387560</id><published>2012-11-28T00:50:00.001-08:00</published><updated>2012-11-28T00:50:07.471-08:00</updated><title type='text'>SQL error when trying to insert data returned from Linked server procedure</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Query:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;DECLARE @TABLE TABLE ( StatusFlag int, StatusText varchar(150), run_date varchar(150), run_time varchar(150), run_duration varchar(150) )&lt;br /&gt;insert into @TABLE&lt;br /&gt;EXECUTE &amp;nbsp;[CRM_OUT].[dbo].[GetLoadStatus]&lt;br /&gt;SELECT * FROM @TABLE&lt;/span&gt;&lt;/blockquote&gt;
&lt;div&gt;
Error:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;OLE DB provider &quot;SQLNCLI10&quot; for linked server &quot;Server...&quot; returned message &quot;The partner transaction manager has disabled its support for remote/network transactions.&quot;.&lt;br /&gt;The operation could not be performed because OLE DB provider &quot;SQLNCLI10&quot; for linked server &quot;ServerB&quot; was unable to begin a distributed transaction.&lt;/span&gt;&lt;/blockquote&gt;
Solution:&lt;br /&gt;
Run the following script on the server, where you wrote a select request:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;EXEC sp_serveroption @server = &#39;SRV-crm-sql-02&#39;,@optname = &#39;remote proc transaction promotion&#39;, @optvalue = &#39;false&#39; ;&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
Thanks to http://www.sqlservercentral.com/Forums/Topic1102122-146-1.aspx&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/1009931769978387560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/11/sql-error-when-trying-to-insert-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1009931769978387560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1009931769978387560'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/11/sql-error-when-trying-to-insert-data.html' title='SQL error when trying to insert data returned from Linked server procedure'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-9212552960667271749</id><published>2012-11-19T00:02:00.006-08:00</published><updated>2012-11-19T00:02:52.825-08:00</updated><title type='text'>MS CRM 4.0: SQL scripts for every day</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
1.&amp;nbsp;PickList Display Value&lt;br /&gt;
&lt;br /&gt;
Sometimes you need so query data exactly from CRM tables and not from filtered views. In this case of picklists you`ll find, that table stores only their values (integer) and not the text, which you can see on the entity form. Here is a small function, which can help you in such situations.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;SELECT &amp;nbsp; &amp;nbsp; LastName, FirstName, dbo.MapPickList(‘contact’, ‘ShoeSize’, ShoeSize) AS DisplayValue&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;FROM &amp;nbsp;Contact&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;CREATE FUNCTION MapPickList&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;/******Name of the CRM Entity we are querying******/&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@entity varchar(50),&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;/******Name of the CRM Attribute we are querying******/&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@attribute varchar(50),&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;/******The picklist int value stored by CRM******/&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@value int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;RETURNS varchar(500)&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;DECLARE &amp;nbsp;@return varchar(500)&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;SET @return = (SELECT StringMap.Value AS DisplayValue&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;FROM StringMap INNER JOIN MetadataSchema.Entity ON StringMap.ObjectTypeCode = MetadataSchema.Entity.ObjectTypeCode&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;WHERE (StringMap.AttributeName Like @attribute) AND (StringMap.AttributeValue = @value) AND (MetadataSchema.Entity.Name Like @entity))&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;return @return&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;END&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/9212552960667271749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/11/ms-crm-40-sql-scripts-for-every-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/9212552960667271749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/9212552960667271749'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/11/ms-crm-40-sql-scripts-for-every-day.html' title='MS CRM 4.0: SQL scripts for every day'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-2187852655686587127</id><published>2012-11-16T07:29:00.001-08:00</published><updated>2012-11-16T07:29:02.173-08:00</updated><title type='text'>SQL tasks, impersonation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Today I got a task to write a procedure, which will return execution status of the SQL Server Task.&lt;br /&gt;
The first thing was to write the main functionality, the second was to allow user to use this functionality in linked server.&lt;br /&gt;
And here we go.&lt;br /&gt;
Code&amp;nbsp;snippets for&amp;nbsp;retrieving&amp;nbsp;task statuses&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;font-size: 12px;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;font-size: 12px;&quot;&gt;SELECT 
    [sJOB].[job_id] AS [JobID]
    , [sJOB].[name] AS [JobName]
    , CASE 
        WHEN [sJOBH].[run_date] IS NULL OR [sJOBH].[run_time] IS NULL THEN NULL
        ELSE CAST(
                CAST([sJOBH].[run_date] AS CHAR(8))
                + &#39; &#39; 
                + STUFF(
                    STUFF(RIGHT(&#39;000000&#39; + CAST([sJOBH].[run_time] AS VARCHAR(6)),  6)
                        , 3, 0, &#39;:&#39;)
                    , 6, 0, &#39;:&#39;)
                AS DATETIME)
      END AS [LastRunDateTime]
    , CASE [sJOBH].[run_status]
        WHEN 0 THEN &#39;Failed&#39;
        WHEN 1 THEN &#39;Succeeded&#39;
        WHEN 2 THEN &#39;Retry&#39;
        WHEN 3 THEN &#39;Canceled&#39;
        WHEN 4 THEN &#39;Running&#39; -- In Progress
      END AS [LastRunStatus]
    , STUFF(
            STUFF(RIGHT(&#39;000000&#39; + CAST([sJOBH].[run_duration] AS VARCHAR(6)),  6)
                , 3, 0, &#39;:&#39;)
            , 6, 0, &#39;:&#39;) 
        AS [LastRunDuration (HH:MM:SS)]
    , [sJOBH].[message] AS [LastRunStatusMessage]
    , CASE [sJOBSCH].[NextRunDate]
        WHEN 0 THEN NULL
        ELSE CAST(
                CAST([sJOBSCH].[NextRunDate] AS CHAR(8))
                + &#39; &#39; 
                + STUFF(
                    STUFF(RIGHT(&#39;000000&#39; + CAST([sJOBSCH].[NextRunTime] AS VARCHAR(6)),  6)
                        , 3, 0, &#39;:&#39;)
                    , 6, 0, &#39;:&#39;)
                AS DATETIME)
      END AS [NextRunDateTime]
FROM 
    [msdb].[dbo].[sysjobs] AS [sJOB]
    LEFT JOIN (
                SELECT
                    [job_id]
                    , MIN([next_run_date]) AS [NextRunDate]
                    , MIN([next_run_time]) AS [NextRunTime]
                FROM [msdb].[dbo].[sysjobschedules]
                GROUP BY [job_id]
            ) AS [sJOBSCH]
        ON [sJOB].[job_id] = [sJOBSCH].[job_id]
    LEFT JOIN (
                SELECT 
                    [job_id]
                    , [run_date]
                    , [run_time]
                    , [run_status]
                    , [run_duration]
                    , [message]
                    , ROW_NUMBER() OVER (
                                            PARTITION BY [job_id] 
                                            ORDER BY [run_date] DESC, [run_time] DESC
                      ) AS RowNumber
                FROM [msdb].[dbo].[sysjobhistory]
                WHERE [step_id] = 0
            ) AS [sJOBH]
        ON [sJOB].[job_id] = [sJOBH].[job_id]
        AND [sJOBH].[RowNumber] = 1
ORDER BY [JobName]&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Many thanks to&amp;nbsp;Dattatrey Sindol, for his nice tutorial, which you can find &lt;a href=&quot;http://www.mssqltips.com/sqlservertip/2561/querying-sql-server-agent-job-information/&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Code snippets&amp;nbsp;for the second step:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;GRANT IMPERSONATE ON LOGIN::[user1] TO [user2]&lt;br /&gt;select * from sys.syslogins where name = @szlogin&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Create PROCEDURE [dbo].[IT_GetJobStatus]&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@jobId uniqueidentifier&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;BEGIN&lt;br /&gt;execute as Login = &#39;user2&#39;&lt;br /&gt;SELECT &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[sJOBH].[run_status] as StatusFlag,&lt;br /&gt;&amp;nbsp; &amp;nbsp; CASE [sJOBH].[run_status]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN 0 THEN &#39;Failed&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN 1 THEN &#39;Succeeded&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN 2 THEN &#39;Retry&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN 3 THEN &#39;Canceled&#39;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHEN 4 THEN &#39;Running&#39; -- In Progress &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end as StatusText&lt;br /&gt;FROM&lt;br /&gt;&amp;nbsp; &amp;nbsp; [msdb].[dbo].[sysjobs] AS [sJOB]&lt;br /&gt;&amp;nbsp; &amp;nbsp; LEFT JOIN (&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [job_id]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , MIN([next_run_date]) AS [NextRunDate]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , MIN([next_run_time]) AS [NextRunTime]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FROM [msdb].[dbo].[sysjobschedules]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GROUP BY [job_id]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) AS [sJOBSCH]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ON [sJOB].[job_id] = [sJOBSCH].[job_id]&lt;br /&gt;&amp;nbsp; &amp;nbsp; LEFT JOIN (&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SELECT&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [job_id]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , [run_date]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , [run_time]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , [run_status]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , [run_duration]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , [message]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , ROW_NUMBER() OVER (&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PARTITION BY [job_id]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ORDER BY [run_date] DESC, [run_time] DESC&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) AS RowNumber&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FROM [msdb].[dbo].[sysjobhistory]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE [step_id] = 0&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) AS [sJOBH]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ON [sJOB].[job_id] = [sJOBH].[job_id]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AND [sJOBH].[RowNumber] = 1&lt;br /&gt;where [sJOB].[job_id] = @jobId&lt;br /&gt;END&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Some good materials about SQL Server permissions you can find here:&lt;/div&gt;
&lt;div&gt;
1.&amp;nbsp;&lt;a href=&quot;http://blogs.msdn.com/b/sqlserverfaq/archive/2009/07/24/how-to-impersonate-the-privileges-to-create-a-login-using-the-stored-procedures-using-execute-as-clause.aspx&quot;&gt;http://blogs.msdn.com/b/sqlserverfaq/archive/2009/07/24/how-to-impersonate-the-privileges-to-create-a-login-using-the-stored-procedures-using-execute-as-clause.aspx&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
2.&amp;nbsp;&lt;a href=&quot;http://sqlserverbuddy.blogspot.ru/2010/08/select-permission-was-denied-on-object.html&quot;&gt;http://sqlserverbuddy.blogspot.ru/2010/08/select-permission-was-denied-on-object.html&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
3.&amp;nbsp;&lt;a href=&quot;http://www.sommarskog.se/grantperm.html#EXECUTE_AS&quot;&gt;http://www.sommarskog.se/grantperm.html#EXECUTE_AS&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
VH&lt;/div&gt;
&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/2187852655686587127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/11/sql-tasks-impersonation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/2187852655686587127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/2187852655686587127'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/11/sql-tasks-impersonation.html' title='SQL tasks, impersonation'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-1156806208492610065</id><published>2012-11-09T12:27:00.002-08:00</published><updated>2012-11-09T12:43:27.145-08:00</updated><title type='text'>Beeline Internet...Good work guys</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Today I understood why all hate Beeline, which is a&amp;nbsp;Russian&amp;nbsp;ISP. Here is my story.&lt;br /&gt;
&lt;br /&gt;
Months ago we started to use beeline services. Internet connection was working pretty well - nearly 40Mb/sec for 650 rubles/month. We had a small problem - we wanted to connect few computers to internet&amp;nbsp;simultaneously. We had &amp;nbsp;a router LG-Nortel, which I started to configure. After some&amp;nbsp;tries&amp;nbsp;I understood that it is not possible to use this router to create VPN connection to beeline, because L2TP protocol was not supported by this router. I started to look for a router, which will have all the needed features.&lt;br /&gt;
In the beeline site I found the list of routers which they support:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihr6dyFISdcb3LfuahnCFTbR92T9ls6Y0Q6f-Syk3t5SoYiqZvjRhrbMmr8ki-evZp_blUYJryc787ObYyC-ItonxEbxesCiRuv7ePL4tDQOzyF8eOwPql-ZYsLEtcOIHfb9494QoqnjJt/s1600/Untitled.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihr6dyFISdcb3LfuahnCFTbR92T9ls6Y0Q6f-Syk3t5SoYiqZvjRhrbMmr8ki-evZp_blUYJryc787ObYyC-ItonxEbxesCiRuv7ePL4tDQOzyF8eOwPql-ZYsLEtcOIHfb9494QoqnjJt/s640/Untitled.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Today I went to store and bought router D-Link 320/DRI thinking, that this is it - the end of cables and internet sharing via computers. I came home, connected router to my computer via LAN cable and started to follow the steps written in the beeline official web site.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6ly7HM_uDsNpFQogk2FsiaOHtJEtLKf-d5QrjhpSMqYDCdAQ1gBWw5aKJMh_eyAnNr-5nqM2LaxoXs21wNvqK7AuDzjNpcbM2SkuSaRFtGAXA8pHf2z44oUCfgmfHl6At1Vu7WizrqcIp/s1600/Untitled1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;249&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6ly7HM_uDsNpFQogk2FsiaOHtJEtLKf-d5QrjhpSMqYDCdAQ1gBWw5aKJMh_eyAnNr-5nqM2LaxoXs21wNvqK7AuDzjNpcbM2SkuSaRFtGAXA8pHf2z44oUCfgmfHl6At1Vu7WizrqcIp/s640/Untitled1.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The first step - I updated my router`s firmware version to 1.2.120 and voala - after 2 minutes my &amp;nbsp;router stoped to respond. Router`s web address was not available, hard&amp;nbsp;resetting&amp;nbsp;had no effect. I started to read all the configurations and found in the last page that for my router their update is not working and that I need to go to Dlink office and ask them to update the optimased version of the firmware. According to beeline, this update is free of charge, but if you already damaged your router by installing the update version which is in the beeline web site, then you need to pay extra charges.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaYB1MQuiBAMlTGHH0x-LcU-DGFP69MRJpDClsOfUObu4MxE9zKLplxDRHT6zHQ1QZ35cb5D9d1OmZbGeY67QlMZC8gMI1OL21spcppc-WO7XxQTFVhYtAIY4Fn5HM7tsOFfWJ2ds4IdW2/s1600/Untitled3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;220&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaYB1MQuiBAMlTGHH0x-LcU-DGFP69MRJpDClsOfUObu4MxE9zKLplxDRHT6zHQ1QZ35cb5D9d1OmZbGeY67QlMZC8gMI1OL21spcppc-WO7XxQTFVhYtAIY4Fn5HM7tsOFfWJ2ds4IdW2/s640/Untitled3.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
So, what to say -&amp;nbsp;How &quot;clever&quot; a manufacturer can be to write about possible damage only in the end of the instructions. According to their web site I had to take my router to the office of dlink, pay them to fix it and after they would change the&amp;nbsp;version&amp;nbsp;of my router`s firmware. One hole day travel by metro and stay in ques.&lt;br /&gt;
&lt;br /&gt;
After some digging in google I finnaly found the solution and have done all&amp;nbsp;myself&amp;nbsp;:)&lt;br /&gt;
&lt;br /&gt;
The first think I have done was to fix router. Thanks much to guys of &lt;a href=&quot;http://forums.dlink.com/index.php?PHPSESSID=176837db72fdf8060d7f30ec5370d094&amp;amp;topic=44909.0&quot;&gt;this &lt;/a&gt;forum.&lt;br /&gt;
If you have&amp;nbsp;similar&amp;nbsp;problem, you can follow the following instructions:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee; font-family: verdana, sans-serif; font-size: x-small; line-height: 16px; text-align: -webkit-auto;&quot;&gt;1.&amp;nbsp; Plug the Ethernet cable that connects your computer, that was plugged into one of the LAN ports,&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee; font-family: verdana, sans-serif; font-size: x-small; line-height: 16px; text-align: -webkit-auto;&quot;&gt;2. Setup your PC with static IP - ex: 192.168.0.2 (different from 192.168.0.1)&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee; font-family: verdana, sans-serif; font-size: x-small; line-height: 16px; text-align: -webkit-auto;&quot;&gt;3. Make sure the PC has the new firmware&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee; font-family: verdana, sans-serif; font-size: x-small; line-height: 16px; text-align: -webkit-auto;&quot;&gt;4. Unplug the power&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee; font-family: verdana, sans-serif; font-size: x-small; line-height: 16px; text-align: -webkit-auto;&quot;&gt;5. Hold the reset button for 3~5 seconds and re plug the power WITHOUT RELEASING THE RESET BUTTON.&lt;/span&gt;&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee; font-family: verdana, sans-serif; font-size: x-small; line-height: 16px; text-align: -webkit-auto;&quot;&gt;6.Open a web browser to 192.168.0.1 and then you should see EMERGENCY FLASHING page then click browse/upload locate the file and click UPLOAD FIRMWARE NOW&lt;/span&gt;&lt;/blockquote&gt;
After, I created a normal L2TP VPN connection and that`s it - Internet was working fine with my old firmware.&lt;br /&gt;
After all this I was realy surprised - why do I need to change firmware? Why every owner of Dlink Dir320/NRI router have to go to dlink office and ask them to change firmware?&lt;br /&gt;
&lt;br /&gt;
I can say only one think - good work guys. Work in the same way...&lt;br /&gt;
&lt;br /&gt;
P.S. When you are calling to support center, you need to wait hours to be answered. What do they think, that the voice of girl &quot;Please stay with us&quot; and a stupid music is making their service to look like better ?&lt;br /&gt;
Vh&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/1156806208492610065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/11/beeline-internetgood-work-guys.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1156806208492610065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1156806208492610065'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/11/beeline-internetgood-work-guys.html' title='Beeline Internet...Good work guys'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihr6dyFISdcb3LfuahnCFTbR92T9ls6Y0Q6f-Syk3t5SoYiqZvjRhrbMmr8ki-evZp_blUYJryc787ObYyC-ItonxEbxesCiRuv7ePL4tDQOzyF8eOwPql-ZYsLEtcOIHfb9494QoqnjJt/s72-c/Untitled.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-8714128200513102887</id><published>2012-10-17T05:14:00.005-07:00</published><updated>2012-10-17T05:14:47.442-07:00</updated><title type='text'>How to call JS function when asp textbox text is changing</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #f0f3f4; color: #222222; font-family: &#39;Segoe UI&#39;, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.200000762939453px;&quot;&gt;To call some javascript, you need to use the onchange attribute of your TextBox and call javascript function.&lt;/span&gt;&lt;br style=&quot;background-color: #f0f3f4; color: #222222; font-family: &#39;Segoe UI&#39;, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.200000762939453px;&quot; /&gt;&lt;br style=&quot;background-color: #f0f3f4; color: #222222; font-family: &#39;Segoe UI&#39;, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18.200000762939453px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f3f4; border: 0px; color: #222222; font-family: Courier New; font-size: 13px; line-height: 18.200000762939453px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;lt;script language=&quot;javascript&quot;&amp;gt;&lt;br /&gt;function Changed( textControl )&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert( textControl.value );&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:TextBox id=&quot;txtName&quot; runat=&quot;server&quot; onchange=&quot;javascript: Changed( this );&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/8714128200513102887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/10/how-to-call-js-function-when-asp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/8714128200513102887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/8714128200513102887'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/10/how-to-call-js-function-when-asp.html' title='How to call JS function when asp textbox text is changing'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-5830472844304843701</id><published>2012-10-12T06:11:00.002-07:00</published><updated>2012-10-12T07:01:34.629-07:00</updated><title type='text'>MS CRM 2011: C# functions for every day</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
1. Retrieve N:N relationships&lt;br /&gt;
2. Create N:N relationships&lt;br /&gt;
3. Get Picklist value by it`s text&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
1. Retrieve N:N relationships&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;QueryExpression queryIntersectMeals = new QueryExpression()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EntityName = &quot;iteco_preference&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ColumnSet = new ColumnSet(&quot;iteco_name&quot;),&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LinkEntities =&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new LinkEntity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LinkFromEntityName = &quot;iteco_preference&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LinkFromAttributeName = &quot;iteco_preferenceid&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LinkToEntityName = &quot;iteco_iteco_preference_contact&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LinkToAttributeName = &quot;iteco_preferenceid&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LinkCriteria = new FilterExpression&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FilterOperator = LogicalOperator.And,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Conditions =&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new ConditionExpression&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AttributeName = &quot;contactid&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Operator = ConditionOperator.Equal,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Values = { clientId }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new ConditionExpression&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AttributeName = &quot;iteco_preferenceid&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Operator = ConditionOperator.Equal,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Values = { Guid.Parse(passengers[i].Attributes[&quot;Meal&quot;].Value) }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/blockquote&gt;
____________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
2. Create N:N relationships.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
AssociateRequest associateMealClient = new AssociateRequest();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; associateMealClient.Target = new EntityReference(&quot;contact&quot;, clientId);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; associateMealClient.Relationship = new Relationship(&quot;iteco_iteco_preference_contact&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; associateMealClient.RelatedEntities = new EntityReferenceCollection(new List&amp;lt;EntityReference&amp;gt;() { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new EntityReference(&quot;iteco_preference&quot;, Guid.Parse(passengers[i].Attributes[&quot;Meal&quot;].Value))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iOrg.Execute(associateMealClient); &amp;nbsp;&amp;nbsp;&lt;/blockquote&gt;
______________________________________________________________________________&lt;br /&gt;
3. Get Picklist value by it`s text.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
/// &amp;lt;summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// Возвращает значение picklist по тексту&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;/summary&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;param name=&quot;entityName&quot;&amp;gt;Имя сущности&amp;lt;/param&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;param name=&quot;service&quot;&amp;gt;CRM service&amp;lt;/param&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;param name=&quot;attributeName&quot;&amp;gt;Имя атрибута&amp;lt;/param&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;param name=&quot;optionText&quot;&amp;gt;Текст picklist&amp;lt;/param&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /// &amp;lt;returns&amp;gt;Возвращает значение picklist по тексту&amp;lt;/returns&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public int? GetOptionsetValue(string entityName, IOrganizationService service, string attributeName, string optionText)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int? optionsetValue = null;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RetrieveEntityRequest retrieveDetails = new RetrieveEntityRequest&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EntityFilters = EntityFilters.All,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LogicalName = entityName&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RetrieveEntityResponse retrieveEntityResponseObj = (RetrieveEntityResponse)service.Execute(retrieveDetails);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Microsoft.Xrm.Sdk.Metadata.EntityMetadata metadata = retrieveEntityResponseObj.EntityMetadata;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata picklistMetadata = metadata.Attributes.FirstOrDefault(attribute =&amp;gt; String.Equals&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (attribute.LogicalName, attributeName, StringComparison.OrdinalIgnoreCase)) as Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Microsoft.Xrm.Sdk.Metadata.OptionSetMetadata options = picklistMetadata.OptionSet;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (OptionMetadata option in options.Options)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (option.Label.UserLocalizedLabel.Label == optionText)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; optionsetValue = option.Value;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return optionsetValue;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/5830472844304843701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/10/ms-crm-2011-c-functions-for-every-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/5830472844304843701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/5830472844304843701'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/10/ms-crm-2011-c-functions-for-every-day.html' title='MS CRM 2011: C# functions for every day'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-6433143754602284417</id><published>2012-10-12T06:07:00.000-07:00</published><updated>2012-12-05T02:21:23.238-08:00</updated><title type='text'>MS CRM 2011: JS functions for every day</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;1. Get the logical name of the entity for the current record in CRM 2011 using Javascript&lt;/b&gt;&lt;br/&gt;
&lt;pre class=&quot;brush: js&quot;&gt;
var entityName = Xrm.Page.data.entity.getEntityName();
&lt;/pre&gt;
&lt;b&gt;2. Get the ID&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;
var entityId = Xrm.Page.data.entity.getId();
&lt;/pre&gt;
&lt;b&gt;3. Get and Set properties:&lt;/b&gt;
&lt;pre class=&quot;brush: js&quot;&gt;
Xrm.Page.data.entity.attributes.get(&quot;new_name&quot;).getValue();
Xrm.Page.data.entity.attributes.get(&quot;new_name&quot;).setValue(&quot;sample text&quot;);
&lt;/pre&gt;
&lt;b&gt;4. Set Focus&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;
var control = Xrm.Page.ui.controls.get(&quot;AttributeName&quot;);control.setFocus();
&lt;/pre&gt; 
&lt;b&gt;5. Show/Hide Section&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;
Xrm.Page.ui.tabs.get(&quot;yourtabname&quot;).sections.get(&quot;your section name&quot;).setVisible(true);
Xrm.Page.ui.tabs.get(&quot;yourtabname&quot;).sections.get(&quot;your section name&quot;).setVisible(false); 
&lt;/pre&gt; 
&lt;b&gt;6. Set the requirement level&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;
Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(&#39;none&#39;);
Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(&#39;required&#39;);
Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(&#39;recommended&#39;); 
&lt;/pre&gt; 
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/6433143754602284417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/10/ms-crm-2011-js-function-for-every-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/6433143754602284417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/6433143754602284417'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/10/ms-crm-2011-js-function-for-every-day.html' title='MS CRM 2011: JS functions for every day'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-708420238775036445</id><published>2012-10-02T04:59:00.003-07:00</published><updated>2012-10-02T04:59:45.100-07:00</updated><title type='text'>N:N Association and Dassiciation events in CRM 4.0 Plugin</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- ===================================================================================================&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- Enable Associate and Disassociate Plug-in Events&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- execute the following query to CRM database, it will add two entries in SdkMessageFilterBase&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- &#39;DisassociateEntities&#39; and &#39;AssociateEntities&#39; from SdkMessageBase which is not listed&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- Find the deployments SDK Filter ID for the&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- Associate and Disassociate Entity SDK Messages&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;DECLARE @DisassociateEntitiesFilterId uniqueidentifier&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;DECLARE @AssociateEntitiesFilterId uniqueidentifier&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;SET @DisassociateEntitiesFilterId = (SELECT SdkMessageId FROM SdkMessageBase WHERE [Name] = &#39;DisassociateEntities&#39;)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;SET @AssociateEntitiesFilterId = (SELECT SdkMessageId FROM SdkMessageBase WHERE [Name] = &#39;AssociateEntities&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- Enable the Associate and Disassociate Filters to be valid for custom processing&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- Custom Processing means &quot;you register plug-ins against it&quot;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;-- Note: We only do this for the &quot;generic&quot; (OTC == 0) case, just to be safer&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;UPDATE SdkMessageFilterBase SET IsCustomProcessingStepAllowed = 1 WHERE SdkMessageId = @DisassociateEntitiesFilterId AND PrimaryObjectTypeCode = 0&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;UPDATE SdkMessageFilterBase SET IsCustomProcessingStepAllowed = 1 WHERE SdkMessageId = @AssociateEntitiesFilterId AND PrimaryObjectTypeCode = 0&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;The above query will enable the &#39;DisassociateEntities&#39; and &#39;AssociateEntities&#39; message in the plugin registration tool. While registering the plugin select the entity name as ‘none’&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;While executing the plugin you will be getting four parameter as input parameters from the plugin context along with the other properties :&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;1. Related Entity1 guid and entity name&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;2. Related Entity2 guid and entity name&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;3. Relation hsip name (nothing but intersect hidden N:N entity name)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;4. Optional parameter.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;Using these value you can implement you logic.&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;Sample Code for N:N relationship with a custom entity and Sytem User:&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;public void Execute(IPluginExecutionContext context)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;{&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;try&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;crmservice = context.CreateCrmService(true);&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;if (context.MessageName == &quot;AssociateEntities&quot;)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;{&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;if (context.InputParameters.Properties[&quot;RelationshipName&quot;].ToString() == &quot;new_new_customentity_systemuser&quot;)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;string oId = string.Empty;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;string SharedUserId = string.Empty;&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;oId = (context.InputParameters.Properties[&quot;Moniker1&quot;] as Moniker).Id.ToString();&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;SharedUserId = (context.InputParameters.Properties[&quot;Moniker2&quot;] as Moniker).Id.ToString();&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;// write you logic here&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;catch (System.Web.Services.Protocols.SoapException ex)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;LogWriter.LogInfo(ex.ToString());&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;catch (Exception ex)&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;LogWriter.LogInfo(ex.ToString());&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 16.883333206176758px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, Arial, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 16.866666793823242px;&quot;&gt;Sources:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://crmpro.blogspot.com/2009/10/registering-plugins-for-event-on-many.html&quot;&gt;http://crmpro.blogspot.com/2009/10/registering-plugins-for-event-on-many.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://mscrm-chandan.blogspot.com/2010/03/trigger-nn-association-event-and.html&quot;&gt;http://mscrm-chandan.blogspot.com/2010/03/trigger-nn-association-event-and.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://dmcrm.blogspot.com/2009/08/expose-associate-and-disassociate-sdk.html&quot;&gt;http://dmcrm.blogspot.com/2009/08/expose-associate-and-disassociate-sdk.html&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/708420238775036445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/10/nn-association-and-dassiciation-events.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/708420238775036445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/708420238775036445'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/10/nn-association-and-dassiciation-events.html' title='N:N Association and Dassiciation events in CRM 4.0 Plugin'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-89137185381022443</id><published>2012-08-30T05:59:00.000-07:00</published><updated>2012-12-13T23:19:05.089-08:00</updated><title type='text'>MS CRM 4: JS Functions for every day</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;u&gt;1.&amp;nbsp;Get Logged in User&lt;br /&gt;2. CRM&amp;nbsp;Fetch&lt;br /&gt;3.&amp;nbsp;&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;Disable a field in CRM 4.0&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;4.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; text-align: justify;&quot;&gt;Enable a field in CRM 4.0&lt;/span&gt;5.&amp;nbsp;Disable an Iframe&lt;br /&gt;6.&amp;nbsp;Set lookup value&lt;br /&gt;7.&amp;nbsp;Custom filter for Lookup search box&lt;br /&gt;8.&amp;nbsp;Call WebService from JS&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;u&gt;9. Show/Hide Fields&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;u&gt;10. Change field requirement level&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;u&gt;11. Manage Picklist&lt;/u&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;1. Get Logged in User&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
function GetLoggedUser() {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var XMLRequest = &quot;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;&amp;lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;utf-8\&quot;?&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;&amp;lt;soap:Envelope xmlns:soap=\&quot;http://schemas.xmlsoap.org/soap/envelope/\&quot; xmlns:xsi=\&quot;http://www.w3.org/2001/XMLSchema-instance\&quot; xmlns:xsd=\&quot;http://www.w3.org/2001/XMLSchema\&quot;&amp;gt;&quot; + GenerateAuthenticationHeader() +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;soap:Body&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;RetrieveMultiple xmlns=\&quot;http://schemas.microsoft.com/crm/2007/WebServices\&quot;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;query xmlns:q1=\&quot;http://schemas.microsoft.com/crm/2006/Query\&quot; xsi:type=\&quot;q1:QueryExpression\&quot;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:EntityName&amp;gt;systemuser&amp;lt;/q1:EntityName&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:ColumnSet xsi:type=\&quot;q1:ColumnSet\&quot;&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:Attributes&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:Attribute&amp;gt;systemuserid&amp;lt;/q1:Attribute&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:Attribute&amp;gt;fullname&amp;lt;/q1:Attribute&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;/q1:Attributes&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;/q1:ColumnSet&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:Distinct&amp;gt;false&amp;lt;/q1:Distinct&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:Criteria&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:FilterOperator&amp;gt;And&amp;lt;/q1:FilterOperator&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:Conditions&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:Condition&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:AttributeName&amp;gt;systemuserid&amp;lt;/q1:AttributeName&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;q1:Operator&amp;gt;EqualUserId&amp;lt;/q1:Operator&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;/q1:Condition&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;/q1:Conditions&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;/q1:Criteria&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;/query&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;/RetrieveMultiple&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot; &amp;lt;/soap:Body&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;&amp;lt;/soap:Envelope&amp;gt;&quot; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Create Http request object&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var xmlHttpRequest = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlHttpRequest.Open(&quot;POST&quot;, &quot;/mscrmservices/2007/CrmService.asmx&quot;, false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlHttpRequest.setRequestHeader(&quot;SOAPAction&quot;, &quot;http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlHttpRequest.setRequestHeader(&quot;Content-Type&quot;, &quot;text/xml; charset=utf-8&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlHttpRequest.setRequestHeader(&quot;Content-Length&quot;, XMLRequest.length);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlHttpRequest.send(XMLRequest);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Store the response which would be XML&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var Result = xmlHttpRequest.responseXML;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var BusinessEntityNodes = Result.selectNodes(&quot;//RetrieveMultipleResult/BusinessEntities/BusinessEntity&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Check If data was retrived&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (BusinessEntityNodes.length != 0) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var BusinessEntityNode = BusinessEntityNodes[0];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var SystemUserId = BusinessEntityNode.selectSingleNode(&quot;q1:systemuserid&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var FullName = BusinessEntityNode.selectSingleNode(&quot;q1:fullname&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var SystemUserId = (SystemUserId == null) ? null : SystemUserId.text;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var FullName = (FullName == null) ? null : FullName.text;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return FullName;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; catch (e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert(e.message);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;2. Fetch&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;u&gt;var CrmURL = document.location.protocol + &#39;//&#39; + document.location.hostname + ((document.location.port == &#39;&#39;) ? &#39;&#39; : &#39;:&#39; + document.location.port);&lt;/u&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;oppId = crmForm.all.new_opportunity.DataValue[0].id;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var sFetch = &#39;&amp;lt;fetch mapping=&quot;logical&quot;&amp;gt;&#39;&lt;br /&gt;
&amp;nbsp; + &#39;&amp;lt;entity name=&quot;opportunity&quot;&amp;gt;&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;+ &#39;&amp;lt;attribute name=&quot;new_systemuser_opportunity_gmp_id&quot;/&amp;gt;&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; + &#39;&amp;lt;filter&amp;gt;&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; + &#39;&amp;lt;condition attribute=&quot;opportunityid&quot; operator=&quot;eq&quot; value=&quot;&#39; + oppId + &#39;&quot; /&amp;gt;&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; + &#39;&amp;lt;/filter&amp;gt;&#39;&lt;br /&gt;
&amp;nbsp; + &#39;&amp;lt;/entity&amp;gt;&#39;&lt;br /&gt;
+ &#39;&amp;lt;/fetch&amp;gt;&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlResult = Universal_fetch(sFetch);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var gmpId = xmlResult.selectSingleNode(&#39;//result/new_systemuser_opportunity_gmp_id&#39;).text;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Universal_fetch = function (sFetch) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; try {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var soapXml = &#39;&amp;lt;soap:Envelope &#39; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; &#39; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; &#39; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&amp;gt;&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; soapXml += GenerateAuthenticationHeader();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; soapXml += &#39;&amp;lt;soap:Body&amp;gt;&#39; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&amp;lt;Fetch xmlns=&quot;http://schemas.microsoft.com/crm/2007/WebServices&quot;&amp;gt;&#39; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&amp;lt;fetchXml&amp;gt;&#39; + CrmEncodeDecode.CrmXmlEncode(sFetch) + &#39;&amp;lt;/fetchXml&amp;gt;&#39; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&amp;lt;/Fetch&amp;gt;&#39; +&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;&amp;lt;/soap:Body&amp;gt;&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; soapXml += &#39;&amp;lt;/soap:Envelope&amp;gt;&#39;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var xmlhttp = new ActiveXObject(&#39;Msxml2.XMLHTTP&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlhttp.open(&#39;POST&#39;, CrmURL + &#39;/mscrmservices/2007/crmservice.asmx&#39;, false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlhttp.setRequestHeader(&#39;Content-Type&#39;, &#39;text/xml; charset=utf-8&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlhttp.setRequestHeader(&#39;SOAPAction&#39;, &#39;http://schemas.microsoft.com/crm/2007/WebServices/Fetch&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlhttp.send(soapXml);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var xmlResult = new ActiveXObject(&#39;Microsoft.XMLDOM&#39;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlResult.async = false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlResult.loadXML(xmlhttp.responseXML.selectSingleNode(&#39;//FetchResult&#39;).text);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return xmlResult;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; catch (ex) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Tahoma, Verdana, Arial; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;3. Disable a field in CRM 4.0&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Tahoma, Verdana, Arial; font-size: 11px; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;code&quot; style=&quot;background-color: #f1f1f1; font-family: consolas, &#39;courier new&#39;, courier, monospace; font-size: 12px; text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;function&lt;/span&gt;&amp;nbsp;DisableField(id)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;var&lt;/span&gt;&amp;nbsp;lookup = id.indexOf(&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&#39;_ledit&#39;&lt;/span&gt;) &amp;gt; 0;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;var&lt;/span&gt;&amp;nbsp;objField = lookup ? crmForm.all[id.replace(&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&#39;_ledit&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&#39;&#39;&lt;/span&gt;)] : crmForm.all[id];&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;INPUT&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;radio&quot;&lt;/span&gt;)&lt;br /&gt;
objField.disabled =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;INPUT&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;checkbox&quot;&lt;/span&gt;)&lt;br /&gt;
objField.disabled =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;INPUT&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;text&quot;&lt;/span&gt;)&lt;br /&gt;
objField.readOnly =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;SELECT&quot;&lt;/span&gt;)&lt;br /&gt;
objField.disabled =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;TEXTAREA&quot;&lt;/span&gt;)&lt;br /&gt;
objField.readOnly =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
objField.Disabled =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;((objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;INPUT&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;radio&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;checkbox&quot;&lt;/span&gt;) || objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;SELECT&quot;&lt;/span&gt;&amp;nbsp;|| objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;TEXTAREA&quot;&lt;/span&gt;)&lt;br /&gt;
objField.style.backgroundColor =&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;#DDDDDD&quot;&lt;/span&gt;;&lt;br /&gt;
}&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Tahoma, Verdana, Arial; font-size: 11px; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Tahoma, Verdana, Arial; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;4. Enable a field in CRM 4.0&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: Tahoma, Verdana, Arial; font-size: 11px; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;code&quot; style=&quot;background-color: #f1f1f1; font-family: consolas, &#39;courier new&#39;, courier, monospace; font-size: 12px; text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;function&lt;/span&gt;&amp;nbsp;EnableField(id)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;var&lt;/span&gt;&amp;nbsp;lookup = id.indexOf(&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&#39;_ledit&#39;&lt;/span&gt;) &amp;gt; 0;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;var&lt;/span&gt;&amp;nbsp;objField = lookup ? crmForm.all[id.replace(&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&#39;_ledit&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&#39;&#39;&lt;/span&gt;)] : crmForm.all[id];&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;INPUT&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;radio&quot;&lt;/span&gt;)&lt;br /&gt;
objField.disabled =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;INPUT&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;checkbox&quot;&lt;/span&gt;)&lt;br /&gt;
objField.disabled =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;INPUT&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;text&quot;&lt;/span&gt;)&lt;br /&gt;
objField.readOnly =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;SELECT&quot;&lt;/span&gt;)&lt;br /&gt;
objField.disabled =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;(objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;TEXTAREA&quot;&lt;/span&gt;)&lt;br /&gt;
objField.readOnly =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
objField.Disabled =&amp;nbsp;&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;false&lt;/span&gt;;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kwrd&quot; style=&quot;color: blue; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;if&lt;/span&gt;&amp;nbsp;((objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;INPUT&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;radio&quot;&lt;/span&gt;&amp;nbsp;&amp;amp;&amp;amp; objField.type !=&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;checkbox&quot;&lt;/span&gt;) || objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;SELECT&quot;&lt;/span&gt;&amp;nbsp;|| objField.tagName.toUpperCase() ==&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;TEXTAREA&quot;&lt;/span&gt;)&lt;br /&gt;
objField.style.backgroundColor =&amp;nbsp;&lt;span class=&quot;str&quot; style=&quot;color: #006080; font-family: Tahoma, Verdana, Arial; font-size: 11px;&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;br /&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Source:&amp;nbsp;&lt;a href=&quot;http://www.dynamicsexchange.com/Blogs/user.aspx?Tableid=157&quot;&gt;http://www.dynamicsexchange.com/Blogs/user.aspx?Tableid=157&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;5. Disable an Iframe&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;ol class=&quot;dp-c&quot; start=&quot;1&quot; style=&quot;background-color: white; border: none; color: #5c5c5c; font-family: Consolas, &#39;Courier New&#39;, Courier, mono, serif; font-size: 12px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1px 45px !important; padding: 0px;&quot;&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;IframeReadOnlyHelper(sIframeId)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;iro&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iro.Iframe&amp;nbsp;=&amp;nbsp;document.getElementById(sIframeId);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;(!iro.Iframe)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;IFRAME&amp;nbsp;with&amp;nbsp;id&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;+&amp;nbsp;sIframeId&amp;nbsp;+&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;&amp;nbsp;is&amp;nbsp;missing&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iro.WatermarkText&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iro.AlertMessage&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iro.OnIframeReady&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;()&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;(iro.Iframe.readyState&amp;nbsp;!=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;complete&#39;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;iframeDoc&amp;nbsp;=&amp;nbsp;iro.Iframe.contentWindow.document;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;iframeBody&amp;nbsp;=&amp;nbsp;iframeDoc.body;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;roSpan&amp;nbsp;=&amp;nbsp;iframeDoc.createElement(&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;SPAN&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;roStyle&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;overflow:hidden;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;position:absolute;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;z-index:1;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;left:0px;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;top:0px;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;height:100%;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;text-align:center;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;background-color:gray;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;font:72px&amp;nbsp;Tahoma;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roStyle&amp;nbsp;+=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;filter:alpha(opacity=20)&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roSpan.style.cssText&amp;nbsp;=&amp;nbsp;roStyle;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iframeBody.appendChild(roSpan);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;(iro.WatermarkText&amp;nbsp;!=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roSpan.innerHTML&amp;nbsp;=&amp;nbsp;&quot;&amp;lt;div&amp;nbsp;style=&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&#39;height:100;&#39;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;&amp;nbsp;+&amp;nbsp;iro.WatermarkText&amp;nbsp;+&amp;nbsp;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/div&amp;gt;&quot;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;(iro.AlertMessage&amp;nbsp;!=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roSpan.attachEvent(&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;onclick&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;(){alert(iro.AlertMessage);});&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iro.Disable&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;()&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iro.Iframe.onreadystatechange&amp;nbsp;=&amp;nbsp;iro.OnIframeReady;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iro.OnIframeReady();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;OnCrmPageLoad()&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;{&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot; style=&quot;background-color: inherit; border: none; color: #008200; margin: 0px; padding: 0px;&quot;&gt;//Load&amp;nbsp;IFRAME&amp;nbsp;with&amp;nbsp;any&amp;nbsp;URL&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;iframeActivity&amp;nbsp;=&amp;nbsp;document.all.IFRAME_account_association;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;iframeActivity.src&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;areas.aspx?oId=%7b50387202-6F73-DE11-9F19-0003FF230264%7d&amp;amp;oType=1&amp;amp;security=852023&amp;amp;tabSet=areaActivities&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;comment&quot; style=&quot;background-color: inherit; border: none; color: #008200; margin: 0px; padding: 0px;&quot;&gt;//Use&amp;nbsp;IframeReadOnlyHelper&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;roIframe&amp;nbsp;=&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;keyword&quot; style=&quot;background-color: inherit; border: none; color: #006699; font-weight: bold; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;IframeReadOnlyHelper(&lt;/span&gt;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;IFRAME&amp;nbsp;ID&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;);&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roIframe.WatermarkText&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;Read&amp;nbsp;Only&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roIframe.AlertMessage&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;background-color: inherit; border: none; color: blue; margin: 0px; padding: 0px;&quot;&gt;&quot;This&amp;nbsp;Grid&amp;nbsp;is&amp;nbsp;Disabled&quot;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; border: none; margin: 0px; padding: 0px;&quot;&gt;;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;roIframe.Disable();&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;&quot; style=&quot;background-color: #f8f8f8; border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot; style=&quot;border-left-color: rgb(108, 226, 108); border-left-width: 3px; border-style: none none none solid; color: inherit; line-height: 14px; list-style: decimal-leading-zero outside; margin: 0px !important; padding: 0px 3px 0px 10px !important;&quot;&gt;&lt;span style=&quot;background-color: inherit; border: none; color: black; margin: 0px; padding: 0px;&quot;&gt;OnCrmPageLoad(); &amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Source:&amp;nbsp;&lt;a href=&quot;http://mscrm4ever.blogspot.com/2009/11/crm-40-read-only-iframe-better-solution.html&quot;&gt;http://mscrm4ever.blogspot.com/2009/11/crm-40-read-only-iframe-better-solution.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;6. Set lookup value&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;pre class=&quot;syntax&quot;&gt;//Create an array to set as the DataValue for the lookup control.
var lookupData = new Array();
//Create an Object add to the array.
   var lookupItem= new Object();
//Set the id, typename, and name properties to the object.
   lookupItem.id = &#39;{1AAC1363-01A1-DB11-8432-0003FF9CE217}&#39;;
   lookupItem.typename = &#39;account&#39;;
   lookupItem.name = &#39;A Bike Store&#39;;
// Add the object to the array.
   lookupData[0] = lookupItem;
// Set the value of the lookup field to the value of the array.
   crmForm.all.parentaccountid.DataValue = lookupData;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;7. Custom filter for Lookup search box&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;pre class=&quot;syntax&quot;&gt;&lt;/pre&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;function FilterYurLico() {
    crmForm.all.new_legal_entity.lookupbrowse = 1;
    if (crmForm.all.new_businessunit_lead_id.DataValue != null) {        
        var fetch = &#39;&amp;lt;fetch mapping=&quot;logical&quot;&amp;gt;&#39;
    + &#39;&amp;lt;entity name=&quot;new_legal_entity&quot;&amp;gt;&#39;
    +&#39;&amp;lt;link-entity name=&quot;new_new_businessunit_new_legal_entity&quot; from=&quot;new_legal_entityid&quot; to=&quot;new_legal_entityid&quot;&amp;gt;&#39;
    + &#39;&amp;lt;link-entity name=&quot;new_businessunit&quot; from=&quot;new_businessunitid&quot; to=&quot;new_businessunitid&quot;&amp;gt;&#39;
    + &#39;&amp;lt;filter&amp;gt;&#39;
    + &#39;&amp;lt;condition attribute=&quot;new_businessunitid&quot; operator=&quot;eq&quot; value=&quot;&#39; + crmForm.all.new_businessunit_lead_id.DataValue[0].id + &#39;&quot; /&amp;gt;&#39;
    + &#39;&amp;lt;/filter&amp;gt;&#39;
    + &#39;&amp;lt;/link-entity&amp;gt;&#39;
    + &#39;&amp;lt;/link-entity&amp;gt;&#39;
    + &#39;&amp;lt;/entity&amp;gt;&#39;
    + &#39;&amp;lt;/fetch&amp;gt;&#39;;
        //alert(fetch);
        crmForm.all.new_legal_entity.AddParam(&quot;search&quot;, fetch);
    }
    else {
        crmForm.all.new_legal_entity.Disabled = true;
    }
}
FilterYurLico();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;syntax&quot;&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;8. Call WebService from JS&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;
At first check web config of your web service. It must support get and set tags:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;&amp;lt;webServices&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;protocols&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;HttpGet&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;HttpPost&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/protocols&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/webServices&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
After use one of the followings:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
function createXMLHttpRequest() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;try { return new XMLHttpRequest(); } catch(e) {}&lt;br /&gt;
&amp;nbsp; &amp;nbsp;try { return new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;); } catch (e) {}&lt;br /&gt;
&amp;nbsp; &amp;nbsp;try { return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;); } catch (e) {}&lt;br /&gt;
&amp;nbsp; &amp;nbsp;alert(&quot;XMLHttpRequest not supported&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;return null;&lt;br /&gt;
&amp;nbsp;}&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
var xmlHttpReq= createXMLHttpRequest();&lt;br /&gt;
xmlHttpReq.open(&quot;GET&quot;, &quot;http://servername:8013/JSHandler.ashx?task=makeActive&amp;amp;id=&quot;+crmForm.ObjectId, false);&lt;br /&gt;
xmlHttpReq.send(null);&lt;br /&gt;
var result = xmlHttpReq.responseText;&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
function GetDataFromWebService(func_name, query, ret_type) { &lt;br /&gt;
&amp;nbsp; &amp;nbsp; var xmlhttp = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; xmlhttp.open(&quot;post&quot;, &quot;/ISV/WSProjectClassification/ServiceProjectClassification.asmx/&quot; + func_name, false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; xmlhttp.setRequestHeader(&quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; xmlhttp.send(query);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var startTag = &quot;&amp;lt;&quot; + ret_type + &quot; xmlns=\&quot;http://tempuri.org/\&quot;&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var endTag = &quot;&amp;lt;/&quot; + ret_type + &quot;&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var exch;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var valueStart = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var valueEnd = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; valueStart = xmlhttp.responseXML.xml.indexOf(startTag, valueEnd) + startTag.length;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; valueEnd = xmlhttp.responseXml.xml.indexOf(endTag, valueEnd + 1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; exch = xmlhttp.responseXML.xml.substring(valueStart, valueEnd);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; return exch;&lt;br /&gt;
}&lt;br /&gt;
var planSobitihIsEmpty = GetDataFromWebService(&quot;TPlan_Sobytiy_MSPIsEmpty&quot;, &quot;&quot;, &quot;boolean&quot;);&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
More info in&amp;nbsp;&lt;a href=&quot;http://support.microsoft.com/default.aspx?scid=kb;en-us;819267&quot;&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;819267&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;&lt;b&gt;9. Show/Hide Fields&lt;/b&gt;&lt;/u&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
&lt;strong&gt;Hiding A Field&lt;/strong&gt;&lt;br /&gt;
To hide a field use the following code snippet:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
crmForm.all.&amp;lt;insert schema name of field&amp;gt;_c.style.visibility = ‘hidden’;&lt;br /&gt;
crmForm.all.&amp;lt;insert schema name of field&amp;gt;_d.style.visibility = ‘hidden’;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
OR&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
crmForm.all.&amp;lt;insert schema name of field&amp;gt;_c.style.display = ‘none’;&lt;br /&gt;
crmForm.all.&amp;lt;insert schema name of field&amp;gt;_d.style.display = ‘none’;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
You will have to hide both the “_c” and “_d” parts of the field.&amp;nbsp; The “_c” appended to the field is the label of the field, and “_d” is the data contained in the field.&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
&lt;strong&gt;Un-hiding A Field&lt;/strong&gt;&lt;br /&gt;
To un-hide a field, use the following code snippet:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
crmForm.all.&amp;lt;insert schema name of field&amp;gt;_c.style.visibility = ‘visible’;&lt;br /&gt;
crmForm.all.&amp;lt;insert schema name of field&amp;gt;_d.style.visibility = ‘visible’;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
OR&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
crmForm.all.&amp;lt;insert schema name of field&amp;gt;_c.style.display = ‘block’;&lt;br /&gt;
crmForm.all.&amp;lt;insert schema name of field&amp;gt;_d.style.display = ‘block’;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
&lt;strong&gt;Hiding A Section&lt;/strong&gt;&lt;br /&gt;
To hide a section (which will in turn, hide all fields in that section), use the code snippet below:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
crmForm.all.&amp;lt;insert schema name here&amp;gt;.parentElement.parentElement.parentElement.style.display = ‘none’;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
&lt;strong&gt;Un-hiding A Section&lt;/strong&gt;&lt;br /&gt;
To un-hide a section, use the code snippet below:&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; font-size: 12px; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
crmForm.all.&amp;lt;insert schema name here&amp;gt;.parentElement.parentElement.parentElement.style.display = ‘block’;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #555555; font-family: Arial, Tahoma, Verdana; line-height: 20px; padding: 0px 0px 15px;&quot;&gt;
&lt;div style=&quot;font-size: 12px;&quot;&gt;
More info in &lt;a href=&quot;http://varghesedanny.com/2011/01/04/showhide-fields-with-javascript/&quot;&gt;here&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;u style=&quot;color: black; font-family: &#39;Times New Roman&#39;; line-height: normal;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;10. Change field requirement level&lt;/b&gt;&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush: js&quot;&gt;// Set field to not required
crmForm.SetFieldReqLevel(&quot;fieldname&quot;, 0);
// Set field to business required
crmForm.SetFieldReqLevel(&quot;fieldname&quot;, 1);
// Set field to business recommended
crmForm.SetFieldReqLevel(&quot;fieldname&quot;, 2);
&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;11. Manage Picklist&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot;&gt;//Remove element from picklist
crmForm.all.new_fieldname.options.remove(1);
//Get picklist`s select value text
var selectedText = crmForm.all.new_fieldname.SelectedText;
&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/89137185381022443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/08/ms-crm-4-js-functions-for-every-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/89137185381022443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/89137185381022443'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/08/ms-crm-4-js-functions-for-every-day.html' title='MS CRM 4: JS Functions for every day'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-1770951267913469132</id><published>2012-07-25T03:29:00.004-07:00</published><updated>2012-07-25T03:30:01.341-07:00</updated><title type='text'>CRM 2011 Xrm.Utility Functions Notes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;&quot;&gt;The Xrm.Utility object provides a container for useful functions not directly related to the current page.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;&quot;&gt;These functions are available in every application page that supports scripting. You can use them in form scripts or in ribbon commands. For HTML web resources, they are available when you include the ClientGlobalContext.js.aspx page. For more information, see&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg328541.aspx#BKMK_ClientGlobalContext_js_aspx&quot; style=&quot;color: #0066dd; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; outline: none; text-decoration: none;&quot; title=&quot;ClientGlobalContext.js.aspx&quot;&gt;ClientGlobalContext.js.aspx&lt;/a&gt;&lt;span style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;&quot;&gt;.&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 1.35em; line-height: 20px;&quot;&gt;

Functions&lt;/h2&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
The following table lists the functions of Xrm.Utility.&lt;/div&gt;
&lt;table style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-left: 0px; max-width: 100%; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Function&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://blogs.msdn.com/b/crm/archive/2012/07/18/new-xrm-utility-functions-in-update-rollup-8-for-microsoft-dynamics-crm-2011-and-microsoft-dynamics-crm-online.aspx#openEntityForm&quot; style=&quot;color: #0066dd; outline: none; text-decoration: none;&quot;&gt;openEntityForm&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Opens an entity form.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://blogs.msdn.com/b/crm/archive/2012/07/18/new-xrm-utility-functions-in-update-rollup-8-for-microsoft-dynamics-crm-2011-and-microsoft-dynamics-crm-online.aspx#openWebResource&quot; style=&quot;color: #0066dd; outline: none; text-decoration: none;&quot;&gt;openWebResource&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Opens an HTML web resource.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;openEntityForm&quot; style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 1.15em; line-height: 18px;&quot;&gt;

openEntityForm&lt;/h3&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Opens an entity form.&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;Xrm.Utility.openEntityForm(name,id,parameters)&lt;/pre&gt;
&lt;h4 style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 1.1em; line-height: 22px;&quot;&gt;

Parameters&lt;/h4&gt;
&lt;ul style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; list-style: none;&quot;&gt;
&lt;li&gt;&lt;pre&gt;name&lt;/pre&gt;
&lt;ul style=&quot;list-style: none;&quot;&gt;
&lt;li&gt;&lt;strong&gt;Type&lt;/strong&gt;: String&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Required&lt;/strong&gt;: The logical name of an entity.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;pre&gt;id&lt;/pre&gt;
&lt;ul style=&quot;list-style: none;&quot;&gt;
&lt;li&gt;&lt;strong&gt;Type&lt;/strong&gt;: String&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optional&lt;/strong&gt;: The string representation of a unique identifier or the record to open in the form. If not set, a form to create a new record is opened.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;pre&gt;parameters&lt;/pre&gt;
&lt;ul style=&quot;list-style: none;&quot;&gt;
&lt;li&gt;&lt;strong&gt;Type&lt;/strong&gt;: Object&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-top: 12px;&quot;&gt;
&lt;strong&gt;Optional&lt;/strong&gt;: A dictionary object that passes extra query string parameters to the form. Invalid query string parameters will cause an error.&lt;/div&gt;
&lt;div style=&quot;margin-top: 12px;&quot;&gt;
Valid extra query string parameters are:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Form id&lt;/strong&gt;: To set the id value of the form to use when more than one form is available. The parameter is formid.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Default field ids&lt;/strong&gt;: To set default values for a new record form. For more information, see&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg334375.aspx&quot; style=&quot;color: #0066dd; outline: none; text-decoration: none;&quot; title=&quot;Set Field Values Using Parameters Passed to a Form&quot;&gt;Set Field Values Using Parameters Passed to a Form&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom query string parameters&lt;/strong&gt;: A form can be configured to accept custom query string parameters. For more information, see&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg334436.aspx&quot; style=&quot;color: #0066dd; outline: none; text-decoration: none;&quot; title=&quot;Configure a Form to Accept Custom Querystring Parameters&quot;&gt;Configure a Form to Accept Custom Querystring Parameters&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;strong&gt;Return Value&lt;/strong&gt;: Window object.&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;strong&gt;Remarks&lt;/strong&gt;: This function provides a better developer experience than the process of manipulating the URL passed to the window.open method described in&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg328483.aspx&quot; style=&quot;color: #0066dd; outline: none; text-decoration: none;&quot; title=&quot;Open Forms, Views, and Dialogs with a URL&quot;&gt;Open Forms, Views, and Dialogs with a URL&lt;/a&gt;. Using this function also helps ensure that users are not prompted to log in again under certain circumstances.&lt;/div&gt;
&lt;h4 style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 1.1em; line-height: 22px;&quot;&gt;

Examples:&lt;/h4&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Open a new account record&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;Xrm.Utility.openEntityForm(&quot;account&quot;);&lt;/pre&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Open an existing account record&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;Xrm.Utility.openEntityForm(&quot;account&quot;,&quot;A85C0252-DF8B-E111-997C-00155D8A8410&quot;);&lt;/pre&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Open a new account record with a specific form and setting default values&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;var parameters = {};
parameters[&quot;formid&quot;] = &quot;b053a39a-041a-4356-acef-ddf00182762b&quot;;
parameters[&quot;name&quot;] = &quot;Test&quot;;
parameters[&quot;telephone1&quot;] = &quot;(425) 555-1234&quot;;
Xrm.Utility.openEntityForm(&quot;account&quot;, null, parameters);
&lt;/pre&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Open a new contact record, move it to the top left corner of the screen, and set the size of the window&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;&quot;&gt;
&lt;div style=&quot;margin-top: 12px; padding-left: 30px;&quot;&gt;
&lt;strong&gt;Note&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;margin-top: 12px; padding-left: 30px;&quot;&gt;
You cannot use window object methods such as&amp;nbsp;&lt;strong&gt;moveTo&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong&gt;resizeTo&lt;/strong&gt;&amp;nbsp;in scripts that will run in Microsoft Dynamics CRM for Microsoft Office Outlook.&lt;/div&gt;
&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;var newWindow = Xrm.Utility.openEntityForm(&quot;contact&quot;);
newWindow.moveTo(0,0);
newWindow.resizeTo(800,600);
&lt;/pre&gt;
&lt;h3 id=&quot;openWebResource&quot; style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 1.15em; line-height: 18px;&quot;&gt;

openWebResource&lt;/h3&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Opens an HTML web resource.&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;Xrm.Utility.openWebResource(webResourceName,webResourceData,width, height)&lt;/pre&gt;
&lt;h4 style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 1.1em; line-height: 22px;&quot;&gt;

Parameters&lt;/h4&gt;
&lt;ul style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; list-style: none;&quot;&gt;
&lt;li&gt;&lt;pre&gt;webResourceName&lt;/pre&gt;
&lt;ul style=&quot;list-style: none;&quot;&gt;
&lt;li&gt;&lt;strong&gt;Type&lt;/strong&gt;: String&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Required&lt;/strong&gt;: The name of the HTML web resource to open.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;pre&gt;webResourceData&lt;/pre&gt;
&lt;ul style=&quot;list-style: none;&quot;&gt;
&lt;li&gt;&lt;strong&gt;Type&lt;/strong&gt;: String&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optional&lt;/strong&gt;: Data to be passed into the data parameter.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;pre&gt;width&lt;/pre&gt;
&lt;ul style=&quot;list-style: none;&quot;&gt;
&lt;li&gt;&lt;strong&gt;Type&lt;/strong&gt;: Number&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optional&lt;/strong&gt;: The width of the window to open in pixels.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;pre&gt;height&lt;/pre&gt;
&lt;ul style=&quot;list-style: none;&quot;&gt;
&lt;li&gt;&lt;strong&gt;Type&lt;/strong&gt;: Number&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Optional&lt;/strong&gt;: The height of the window to open in pixels.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;strong&gt;Return Value&lt;/strong&gt;: Window object.&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;strong&gt;Remarks&lt;/strong&gt;: An HTML web resource can accept the parameter values described in&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg309536.aspx#BKMK_PassingParametersToWebResources&quot; style=&quot;color: #0066dd; outline: none; text-decoration: none;&quot; title=&quot;Passing Parameters to HTML Web Resources&quot;&gt;Passing Parameters to HTML Web Resources&lt;/a&gt;&amp;nbsp;. This function only provides for passing in the optional data parameter. To pass values for the other valid parameters, you must append them to the&amp;nbsp;&lt;strong&gt;webResourceName&lt;/strong&gt;parameter.&lt;/div&gt;
&lt;h4 style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 1.1em; line-height: 22px;&quot;&gt;

Examples:&lt;/h4&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Open an HTML web resource named “new_webResource.htm”:&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;Xrm.Utility.openWebResource(&quot;new_webResource.htm&quot;);&lt;/pre&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Open an HTML web resource including a single item of data for the data parameter”&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;Xrm.Utility.openWebResource(&quot;new_webResource.htm&quot;,&quot;dataItemValue&quot;);&lt;/pre&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Open an HTML web resource passing multiple values through the data parameter&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;var customParameters = encodeURIComponent(&quot;first=First Value&amp;amp;second=Second Value&amp;amp;third=Third Value&quot;);
Xrm.Utility.openWebResource(&quot;new_webResource.htm&quot;,customParameters);
&lt;/pre&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px;&quot;&gt;
&lt;div style=&quot;margin-top: 12px; padding-left: 30px;&quot;&gt;
&lt;strong&gt;Note&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;margin-top: 12px; padding-left: 30px;&quot;&gt;
These values have to be extracted from the value of the data parameter in the HTML web resource. For more information, see&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg327945.aspx&quot; style=&quot;color: #0066dd; outline: none; text-decoration: none;&quot; title=&quot;Sample: Pass Multiple Values to a Web Resource Through the Data Parameter&quot;&gt;Sample: Pass Multiple Values to a Web Resource Through the Data Parameter&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Open an HTML web resource with the parameters expected by HTML web resources:&lt;/div&gt;
&lt;pre style=&quot;color: #3b3b3b; line-height: 22px;&quot;&gt;Xrm.Utility.openWebResource(&quot;new_webResource.htm?typename=account&amp;amp;userlcid=1033&quot;);&lt;/pre&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
For more information, see&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/gg309536.aspx#BKMK_PassingParametersToWebResources&quot; style=&quot;color: #0066dd; outline: none; text-decoration: none;&quot; title=&quot;Passing Parameters to HTML Web Resources&quot;&gt;Passing Parameters to HTML Web Resources&lt;/a&gt;&amp;nbsp;.&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: #3b3b3b; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22px; margin-top: 12px;&quot;&gt;
Source:&amp;nbsp;&lt;a href=&quot;http://blogs.msdn.com/b/crm/archive/2012/07/18/new-xrm-utility-functions-in-update-rollup-8-for-microsoft-dynamics-crm-2011-and-microsoft-dynamics-crm-online.aspx&quot; style=&quot;background-color: white;&quot;&gt;http://blogs.msdn.com/b/crm/archive/2012/07/18/new-xrm-utility-functions-in-update-rollup-8-for-microsoft-dynamics-crm-2011-and-microsoft-dynamics-crm-online.aspx&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/1770951267913469132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/07/xrmutility-functions-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1770951267913469132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/1770951267913469132'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/07/xrmutility-functions-notes.html' title='CRM 2011 Xrm.Utility Functions Notes'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-4782953081040480571</id><published>2012-06-18T06:43:00.001-07:00</published><updated>2012-06-18T06:43:07.312-07:00</updated><title type='text'>CredentialCache.DefaultCredentials does not work</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I am facing this error second time and now there is no way to bypass it.&lt;br /&gt;
Suppose you are creating an ASPX application and there is need to call a web service using credentials of the user loged in to your web site.&lt;br /&gt;
To do this, you need to assign&amp;nbsp;&lt;b&gt;CredentialCache.DefaultCredentials&lt;/b&gt; to the service, you want to call.&lt;br /&gt;
How to do it, you can find in&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/ru-ru/library/system.net.credentialcache.defaultcredentials.aspx&quot;&gt;http://msdn.microsoft.com/ru-ru/library/system.net.credentialcache.defaultcredentials.aspx&lt;/a&gt;.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;The difficulites with this method are:&lt;br /&gt;
1. You can`t see the username and password stored in&amp;nbsp;&lt;b&gt;CredentialCache&lt;/b&gt;&lt;br /&gt;
2. Sometimes you are getting the following error &quot;&lt;b&gt;Сбой запроса с состоянием HTTP 401: Unauthorized.&lt;/b&gt;&quot;&lt;br /&gt;
&lt;br /&gt;
I tried to change the target framework of my solution, played with all the configurations in the IIS. No result.&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;Impersonation on IIS was working fine (To set the impersonation you can via&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;WindowsIdentity).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Ex.&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;WindowsIdentity winId = (WindowsIdentity)HttpContext.Current.User.Identity;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;winId.Impersonate();&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
After long time searches I have found these 2 greate articles:&lt;br /&gt;
&lt;a href=&quot;http://odetocode.com/blogs/scott/archive/2005/02/24/roadmap-to-delegation.aspx&quot;&gt;http://odetocode.com/blogs/scott/archive/2005/02/24/roadmap-to-delegation.aspx&lt;/a&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blogs.msdn.com/b/larryosterman/archive/2004/06/29/169085.aspx&quot;&gt;http://blogs.msdn.com/b/larryosterman/archive/2004/06/29/169085.aspx&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So, for sequrity reasons windows is not allowing you to use user credentials to call web service from other service, if they are in different machines.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Tahoma;&quot;&gt;One question that keeps on coming up when you’re writing a server in NT is: “Why can’t I access remote resources from my server when impersonating my client?”&amp;nbsp; It shows up on our internal aliases about once a month in one form or another.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;This situation is also known as “delegation.”&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;There are actually two different answers to the question.&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;The first answer applies if you’re not running with the active directory; the other applies if you’re using AD.&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;If you’re not using the active directory, then your clients are typically authenticated via the NTLM or DIGEST authentication mechanism.&amp;nbsp; Both of these mechanisms work in similar fashions:&amp;nbsp; When the user logs into the client machine, the machine logging the user on computes a one-way hash of the user’s credentials.&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;When the client connects to the server, the server computes a “challenge”, which is tailored to the client, and sends the challenge to the client.&amp;nbsp; The client then encrypts the challenge using the one-way hash as a key, and sends the encrypted challenge to the server.&amp;nbsp; The server, in turn hands the challenge and the encrypted result to the domain controller to validate that the challenge and the response could only have been generated by the user (if the user’s a local user, it uses the local security authority (LSA)).&amp;nbsp; Note that the server doesn’t ever see the user’s password OR the hash of the users password.&amp;nbsp; The server just knows the challenge and the response to the challenge, neither of which contains the user’s password.&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;When the domain controller responds to the client, it includes enough information to allow the local machine to create the token for the user.&amp;nbsp; So far so good.&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Now let’s consider what happens when the server tries to access a remote resource, say a file on another machine.&amp;nbsp; The server impersonates the user, and attempts to open the file.&amp;nbsp; The remote machine sees the new connection, computes the challenge, and sends it to the client.&amp;nbsp; Now the server needs to encrypt the challenge with the hash of the user’s password.&amp;nbsp; But the server doesn’t KNOW the hash of the user’s password.&amp;nbsp; It was never told that information.&amp;nbsp; The domain controller does, and so does the client, but the server doesn’t. All the server could know is the challenge and the encrypted challenge.&amp;nbsp; And thus, since the server has no way of responding to the challenge, the delegation fails.&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;Now for the other case, when you use Kerberos, if the client authenticated with the server using the Kerberos authentication package (which requires the active directory), then the picture’s a bit brighter.&amp;nbsp; It turns out that one of the design criteria of Kerberos was supporting delegation.&amp;nbsp; In Kerberos authentication, the domain controller gives the server a “ticket” that identifies the client.&amp;nbsp; The cool thing about the ticket is that it can be handed to a remote machine, which can then validate the ticket against the domain controller.&amp;nbsp; So if you’re using the active directory, then it’s POSSIBLE for the client to be authenticated with the remote machine.&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma;&quot;&gt;But, as always, there’s a catch.&amp;nbsp; NT wants to limit the number of services that can do delegation, since it’s conceivable that such a service could be used to mount an attack (since a ticket can be saved and re-used for several hours after it’s been granted, a service that can do delegation can act as if it was the client user for several hours beyond when the user actually connected).&amp;nbsp; So you need to mark the service account for your service (or the machine account if the service’s running as LOCALSYSTEM, LOCALSERVICE, NETWORKSERVICE, or if you’re using a named pipe).&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod19.asp&quot; style=&quot;color: #0066dd; font-weight: bold; outline: none; text-decoration: none;&quot;&gt;This&lt;/a&gt;&amp;nbsp;KB article shows how to do this in Win2K, the same techniques work for Win2K3.&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/4782953081040480571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/06/credentialcachedefaultcredentials-does.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/4782953081040480571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/4782953081040480571'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/06/credentialcachedefaultcredentials-does.html' title='CredentialCache.DefaultCredentials does not work'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-529185597626869052</id><published>2012-06-16T00:09:00.002-07:00</published><updated>2012-06-16T00:09:14.431-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Process Explorer"/><category scheme="http://www.blogger.com/atom/ns#" term="Replace Task Manager"/><title type='text'>Restore task manager on windows 7</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Few days ago I installed a program&amp;nbsp;named &lt;a href=&quot;http://download.cnet.com/Process-Explorer/3000-2094_4-10223605.html&quot;&gt;Process Explorer&lt;/a&gt;&amp;nbsp;&amp;nbsp;on my computer&amp;nbsp;. The program was really&amp;nbsp;helpful, like the advanced version of the task manager, which you can find in windows.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuu7c4egw_ZuWxXUHQRLXfY5Cgp4Yhy-gGLeo8g_0SkU1jiyJPVCxIrL84xHlFfRbXdA2jFOE0Ud0P-PHIbYH7o3aHyCbEG3LXM5sYVk3rlx3Uwv5W4iB7ncl7TL3eT-DHEPnBJAhanKqi/s1600/Process+Explorer.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuu7c4egw_ZuWxXUHQRLXfY5Cgp4Yhy-gGLeo8g_0SkU1jiyJPVCxIrL84xHlFfRbXdA2jFOE0Ud0P-PHIbYH7o3aHyCbEG3LXM5sYVk3rlx3Uwv5W4iB7ncl7TL3eT-DHEPnBJAhanKqi/s320/Process+Explorer.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
In this program there was an option - &quot;&lt;b&gt;Replace Task Manager&lt;/b&gt;&quot;, which was replacing your task manager with this program, aftet which every time pressing &lt;b&gt;ctrl-alt-del &lt;/b&gt;or &lt;b&gt;ctrl-shift-esc&lt;/b&gt;, this program was opening.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmYGrmwlkFXfravmd8Q9eVnil3GtlxFNP-n1lx3ViY-xp0hdMN-TwIRvfDXHI2prRm2ln40oyJJJkL4tsn_foItgcM5yRXQ9n_v0biYtakJPC6c3vjFC9dFX7ZWq4_qwSpNP-82GogmgaS/s1600/Process+Explorer+Insted+Task+Manager.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;247&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmYGrmwlkFXfravmd8Q9eVnil3GtlxFNP-n1lx3ViY-xp0hdMN-TwIRvfDXHI2prRm2ln40oyJJJkL4tsn_foItgcM5yRXQ9n_v0biYtakJPC6c3vjFC9dFX7ZWq4_qwSpNP-82GogmgaS/s320/Process+Explorer+Insted+Task+Manager.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Program was working fine few days and after, accidentaly it stoped work. I couldn`t open even the native task manager of the windows.&lt;br /&gt;
Finnaly I have found the reason of the problem. The problem was, that after the button click &quot;Replace Task manager&quot; the registry key of my computer was set to the path of the temporary version of the program &quot;Process Explorer&quot; (somewhere in the AppData).&lt;br /&gt;
&lt;br /&gt;
I corrected this problem by repplacing the registry key, which is showing the path of the task manager, with the real program path.&lt;br /&gt;
The registry key you can find in&lt;b&gt;&amp;nbsp;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe&lt;/b&gt;. The name of the key is &lt;b&gt;Debugger&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Just change the value of this key with a program path, which you need to be opened when you press &lt;b&gt;ctrl-alt-del&lt;/b&gt;.&lt;br /&gt;
In my case I copied the program &quot;ProcExpr.exe&quot; to the C:\ disk, and set registry key value to&amp;nbsp;&quot;C:\PROCEXP.EXE&quot;.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4lzUOGTGaI61hzjWJ1pXA6FVNdFBn0hykb6rbquSlNpuSE0Uoerd791TSVxhERpgz3VQjH_og2sVvTFeX9ykVZqgmjsVCz5MwzTqHsiS87aQg2nWpd6ma1dXAn8XnIa5oLuYCc80N3BAa/s1600/task+manager.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;156&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4lzUOGTGaI61hzjWJ1pXA6FVNdFBn0hykb6rbquSlNpuSE0Uoerd791TSVxhERpgz3VQjH_og2sVvTFeX9ykVZqgmjsVCz5MwzTqHsiS87aQg2nWpd6ma1dXAn8XnIa5oLuYCc80N3BAa/s400/task+manager.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Hope this will help someone of you.&lt;br /&gt;
Vahagn&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/529185597626869052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/06/restore-task-manager-on-windows-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/529185597626869052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/529185597626869052'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/06/restore-task-manager-on-windows-7.html' title='Restore task manager on windows 7'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuu7c4egw_ZuWxXUHQRLXfY5Cgp4Yhy-gGLeo8g_0SkU1jiyJPVCxIrL84xHlFfRbXdA2jFOE0Ud0P-PHIbYH7o3aHyCbEG3LXM5sYVk3rlx3Uwv5W4iB7ncl7TL3eT-DHEPnBJAhanKqi/s72-c/Process+Explorer.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-8288268179962114728</id><published>2012-06-14T04:28:00.001-07:00</published><updated>2012-06-14T04:28:12.049-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="logedin user"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Some SQL functions you can need</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h1 class=&quot;title&quot; style=&quot;color: #3f529c; font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 1.769em; margin: 0px 0px 10px;&quot;&gt;
SUSER_SNAME&lt;/h1&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;Returns the login identification name from a user&#39;s security identification number (SID).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h6 style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial;&quot;&gt;
A. Use SUSER_SNAME&lt;/h6&gt;
&lt;div style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;
This example returns the login name for the security identification number with a value of 0x01.&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;SELECT SUSER_SNAME(0x01)&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h6 style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial;&quot;&gt;
B. Use SUSER_SNAME with a Windows NT user&#39;s security identification number&lt;/h6&gt;
&lt;div style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;
This example returns the login name for the Windows NT user&#39;s security identification number, obtained by using SUSER_SID.&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;SELECT SUSER_SNAME(0x010500000000000515000000a065cf7e784b9b5fe77c87705a2e0000)
&lt;/code&gt;&lt;/pre&gt;
&lt;h6 style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial;&quot;&gt;
C. Use SUSER_SNAME as a DEFAULT constraint&lt;/h6&gt;
&lt;div style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;
This example uses SUSER_SNAME as a DEFAULT constraint in a CREATE TABLE statement.&lt;/div&gt;
&lt;pre&gt;&lt;code&gt;USE pubs
GO
CREATE TABLE sname_example
(
login_sname sysname DEFAULT SUSER_SNAME(),
employee_id uniqueidentifier DEFAULT NEWID(),
login_date  datetime DEFAULT GETDATE()
) 
GO
INSERT sname_example DEFAULT VALUES
GO&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;h1 class=&quot;title&quot; style=&quot;color: #3f529c; font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 1.769em; margin: 0px 0px 10px;&quot;&gt;
CONTEXT_INFO&lt;/h1&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;Returns the&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;context_info&lt;/strong&gt;&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;value that was set for the current session or batch by using the&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms187768.aspx&quot; style=&quot;color: #960bb4; font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px; text-decoration: none;&quot;&gt;SET CONTEXT_INFO&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;statement.&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;The value of&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;context_info&lt;/strong&gt;&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;, or NULL if&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;context_info&lt;/strong&gt;&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&amp;nbsp;was not set.&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Segoe UI&#39;, Verdana, Arial; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Consolas, Courier, monospace; font-size: 13px; overflow: auto; padding: 5px; word-break: break-all; word-wrap: break-word;&quot;&gt;SET CONTEXT_INFO 0x1256698456
GO
SELECT CONTEXT_INFO()
GO&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/8288268179962114728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/06/some-sql-functions-you-can-need.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/8288268179962114728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/8288268179962114728'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/06/some-sql-functions-you-can-need.html' title='Some SQL functions you can need'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2146358158958580173.post-649912307416701197</id><published>2012-05-21T05:08:00.001-07:00</published><updated>2012-05-21T05:08:36.588-07:00</updated><title type='text'>CRM 2011 Format Text Field as a number</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Sometimes there is a need to format text as a number. The JS code for that:&lt;br /&gt;
&lt;blockquote&gt;
function CheckFieldFormat(context)&lt;br /&gt;{&lt;br /&gt;var text = Xrm.Page.getAttribute(&quot;new_percent&quot;).getValue();&lt;br /&gt;var template = &quot;0123456789&quot;;&lt;br /&gt;for(i = 0; i &amp;lt; text.length;i++)&lt;br /&gt;{&lt;br /&gt;var keychar = text.substring(i, i+1);&lt;br /&gt;if(template.indexOf(keychar) == -1)&lt;br /&gt;{&lt;br /&gt;alert (&#39;Допускается ввод только цифр от 1 до 100 .&#39;)&lt;br /&gt;&amp;nbsp;Xrm.Page.getAttribute(&quot;new_percent&quot;).setValue(null);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;if(parseInt(text ) &amp;lt; 1 || parseInt(text ) &amp;gt; 100)&lt;br /&gt;{&lt;br /&gt;alert (&#39;Допускается ввод только цифр от 1 до 100 .&#39;)&lt;br /&gt;&amp;nbsp;Xrm.Page.getAttribute(&quot;new_percent&quot;).setValue(null);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch(error)&lt;br /&gt;{&lt;br /&gt;alert (&#39;Допускается ввод только цифр от 1 до 100 .&#39;)&lt;br /&gt;&amp;nbsp;Xrm.Page.getAttribute(&quot;new_percent&quot;).setValue(null);&lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vh4u.blogspot.com/feeds/649912307416701197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vh4u.blogspot.com/2012/05/crm-2011-format-text-field-as-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/649912307416701197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2146358158958580173/posts/default/649912307416701197'/><link rel='alternate' type='text/html' href='http://vh4u.blogspot.com/2012/05/crm-2011-format-text-field-as-number.html' title='CRM 2011 Format Text Field as a number'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13641902970178997063</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>