Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In my development I just recently noticed the attribute "doGUIDFixUp = TRUE|FALSE".

I tried to google more about this attribute but couldn't find anything useful. The MSDN site doesn't explain this either.

Can someone shed some light as to what this field would be used for?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Setting DoGuidFixUp="TRUE" for a <File> tag allows you to use tokens {$ListId: WebRelativeListUrl;} inside the deployed file. Those tokens will be replaced with the GUID of the list defined by the "WebRelativeListUrl" URL. Very useful when deploying webparts, pages with webparts, etc.

Example:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
  <Module Name="Calendar" List="113" Url="_catalogs/wp">
    <File Path="Calendar\Calendar.webpart" Url="Calendar.webpart" Type="GhostableInLibrary" DoGUIDFixUp="TRUE" >
      <Property Name="Group" Value="Custom" />
    </File>
  </Module>
</Elements>

This code will deploy "Calendar.webpart" file to the site webparts gallery.

Inside the Calendar.webpart, I have the following code:

<webParts>
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
    <metaData>
      <type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
    </metaData>
    <data>
      <properties>
        ...
        <property name="ListName" type="string">{$ListId: Lists/Calendar;}</property>
        ...
      </properties>
    </data>
  </webPart>
</webParts>

After it is provisioned, I can see the token is replaced with correct list GUID.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.