Posts

CRM 2011 - Add many to many relationship + checking if relationship exists between entities (N:N)

Hi all, Using service context AddLink, you can create N:N relationship in CRM. However you still need to check if the relationship has already been created between the two entities, otherwise you would get 'Insert duplicate key' error. Thanks to this blog  I don't have to create helper functions to check the existing relationship. Rather than using AddLink method that is tied to a service context, I just use the normal Associate method of the IOrganisationService: HTH, Andreas

SharePoint GlobalNavSiteMapProvider get visible items - hidden page issue

Hi all, If you happen to grab structured navigation items from GlobalNavSiteMapProvider in the code when it has 'show all pages' enabled, you would find that it will return all pages including the ones that are hidden. I debugged the code and interestingly the IsVisible property of the PortalSiteMapNode always returns true.  One workaround is to not show pages in the global navigation, and manually add/remove links in the navigation. The other workaround (easier) is to check if the page description has 'hidden' in it, if so then you exclude it: HTH, Andreas

SharePoint 2013 Add an app Loading forever - Master page issue

Hi all, If you build your custom master page and use it in System pages, you might find that you will get the Loading message forever when you do Site Contents - Add an App. Reading Randy's blog  some tags are required. In the end I just copy pasted the required tags from his Starter master page   to include them in my master page: Make sure you put it inside the SharePointForm tag. HTH, Andreas

Google Geocode JavaScript Address Validation

Image
I got a chance to play around with address validation using Google geocode API v3. In my case I use the client side geocoding technique to submit full address (street address + suburb + state + postcode) to find out whether the results returned. The suburb, state and postcode is coming from a proper list. What I found out with Google geocode is that when you submit full address, it also returns result with partial_match and they don't give an easy filter to exclude these results. Since I will always submit a full string address, I will just get the address when there is no partial_match property in the returned results. So far it works quite well for my situation. HTH, Andreas

SharePoint 2013 list form headings using JSLink and jQuery

Image
In SharePoint, when you want to modify the list forms, there are couple of ways that you can go about it such as modifying the form or creating custom form using SP Designer or Infopath, or creating custom aspx using Visual Studio. All those approaches can take a while to implement. With SP2013 with the JSLink functionality, we can quickly inject the headings using jQuery if you just need simple headings or HTML like this: In this case, I have a solution created in my VS2012 to create the site columns, content type and then the list itself for easy deployment. I then created a JavaScript file to be deployed to my Style Library (or you can choose other location) that contains the jQuery code: In the schema.xml of my list, inside the Forms tag you just have to add your JSLink attributes pointing to your jQuery file and the JSLink file: And there you go :) HTH, Andreas

CRM 2011 SharePoint 2013 integration ADFS setup for Single Sign On (SSO)

Hi All, After several hours trying to make this work with the help from technet articles, forums and the help from my colleagues, I managed to get this working. My configuration: 1. CRM 2011 has been configured as IFD using ADFS  (see here ) 2. My original site is in Default zone (can be either http/https) with Windows Auth 3. I configured ADFS + map LDAP attributes 4. Web application is extended to other zone (in my case Intranet) to be the ADFS site The reason we can't have 1 site for both Default and ADFS is because the CRM List component does not like the Sign In page when hitting 'Documents' section inside CRM. The reason we want Windows Auth as well is to be able to crawl the site as well as for admin purposes. -------------------------------------------------------------------------------------------------------------------- SETTING UP ADFS: Go to your ADFS Server, open your ADFS management: 1. Add relying Party Trusts with this configuration • En...

SharePoint Event Receiver ItemAdded assign permission

Hi, Sometimes we want to remove permissions and only assign permission to the user who uploaded the document in the document library. Here is the snippet: HTH, Andreas