



This post applies to Microsoft Office SharePoint Server 2007 and WSS 3.0
Scenario: You have built a Custom .aspx page using SharePoint Designer that is stored in a Document Library. You have added the Default Master page to the Custom page so that your css is consistent with the rest of the SharePoint pages on your site. You have added a data source that is a SharePoint list that will be displayed on the page as a single item data view. When viewing the Custom .aspx page you are unable to view the links that would be included as the attachments. The attachment links are normally viewable on a standard DispForm.aspx that is generated by a list, but not in this case. HOW DO YOU DISPLAY THE ATTACHMENT LINKS?
Solution: I’ve done a lot of searching blogs and documentation on this problem. I’ve given up on it several times. However, after finding some hints and information on some blogs I’ve been using the following solution. You will have to open the Custom .aspx page in code view. When SharePoint Designer adds the “Single Item View” it generates an xsl tag coded as <xsl:template name=”dvt_1.rowview”> . This can be found at the top of the view inserted. Once you locate this tag, immediately after it insert the following code:
<tr>
<td width=”190px” valign=”top” class=”ms-formlabel”>
<h3 class=”ms-standardheader” style=”width: 163px; height: 12px”>
<nobr>Attachments</nobr>
</h3>
</td>
</tr>
<tr>
<td width=”400px” valign=”top” class=”ms-formbody”>
<SharePoint:AttachmentsField ControlMode=”Display” FieldName=”Attachments” runat=”server” Visible=”true”/>
</td>
</tr>
Save the file and reload it in your browser. You should now see the attachments link in your Single item view.




This post applies to Microsoft Office SharePoint Server 2007 or WSS 3.0.
Scenario: You are creating a workflow (in SharePoint Designer 2007) that you want to send an e-mail to multiple individuals that are listed in a SharePoint “People Picker” control (Person or Group field) in a SharePoint list. By default, the Person or Group field sets “Allow multiple selections” to No. You change this to “Yes” so that the workflow could possibly send an e-mail to multiple people. This sounds logical – but oops! It didn’t work. WHY?
Solution: Given the senario above, lets say that you want this workflow to execute when a user adds a new item to a list and the user has permissions to execute the workflow as well as permssions to send the e-mail. For some reason, when you change the Person or Group field (Peope Picker) property to “Allow multiple selections” = “Yes” the workflow will not send the e-mail. First, you should try to get a successful test with the workflow using the setting “Allow multiple selections” = “No”. If you are able to get a successful test where the workflow sends an e-mail to a single person who was selected in the People Picker then you know you have all the security setup correctly. Now, once you have executed the workflow at least once with the setting to “No” – go back into the List settings and modify the Person or Group field property of “Allow multiple selections” to “Yes” (without modifying the workflow). Now, re-execute the workflow by adding another item to the list. Make sure that you seleted multiple people in the People Picker. You should now have a successful e-mail to multiple individuals. If you create another Person or Group field on the same list and you want a workflow to do this same thing, you will have to go through this process again.
I’m not sure exactl why this happens except I believe that it is a bug with SharePoint Designer. Obviously the SharePoint services allow this workflow behavior – so its not a problem with SharePoint. Either way, I found this to be an irritating experience – so hopefully this information will help someone else.




This post applies to Microsoft Office SharePoint Server 2007 or WSS 3.0.
Scenario: You want to setup a SharePoint Workflow that sends an e-mail to a SharePoint group based on a certain condition. Example: When a new item gets added to a SharePoint list –> Send an – e-mail to SharePoint Group “Supervisors”. After installing the Workflow on the list, you are unsuccessful in getting the workflow to send the e-mail when a user adds data to a list – WHY?
Solution: SharePoint security groups work a lot like Active Directory Groups or Distribution Groups created on Exchange. They require an owner to use the group. For instance – lets say that you had an Exchange Distribution group in your company that is used by management to send a Memorandum out to All company employees. Lets say that the company has 2000 employees and they all have an e-mail address. Well, you wouldn’t want to have just anyone send an e-mail out to the whole company. So… you would need to have a group of people that have permissions to send an e-mail to this specific Distribution group.
It works the same way with SharePoint groups. If you setup a workflow to send an e-mail out to a SharePoint Group when a new item gets added to the list – you have to make sure that the person who is executing the workfow (ie. the person adding the item to the list) has the permissions to e-mail the SharePoint group. In other words, when you setup the SharePoint group – you have to make the owner of the group another SharePoint group instead of an individual. By default, SharePoint puts the person who creates a group as the owner. A best practice on how to handle this is to create a “Manage Group” SharePoint group with individuals added into it that would need to execute the workflow. Then make this “Manage Group” the owner of the group that is used in the workflow.
Whew!!! Confusing huh!. Try it and you’ll have better success.




The following post applies to WSS 3.0 or MOSS 2007:
Scenario: When you click the “New” button on a List to add a new item to the list, you want to hide some of the fields displayed to the user. This is useful when you have fields that you only want accessible to the user who has “Add” privileges (to add a new item). I found this in a post from a blog about a year ago. Very useful.
Solution: This can be performed in SharePoint Designer 2007. I recommend that you make a copy of your NewForm.aspx page and re-name it as a backup in case you mess this up. Then you can always save over it and try again.
Scroll down the NewForm.aspx page and look for the end of the </table> tag at the end of the </WebPart>.
#### INSERT javascript after these lines ###################
</WebPart>
</WebPartPages:ListFormWebPart>
</ZoneTemplate></WebPartPages:WebPartZone>
<IMG SRC=”/_layouts/images/blank.gif” width=590 height=1 alt=”">
</td>
</tr>
</table>
################################################
##### HERE IS YOUR JAVASCRIPT CODE TO ADD #############
<script language=”javascript” type=”text/javascript”>
_spBodyOnLoadFunctionNames.push(”hideRows”);
function hideRows()
{
var pageTables = document.getElementsByTagName(’table’);
var cName = null;
var formTables = null;
for(var i=0; i < pageTables.length; i++){
cName = pageTables[i].className;
if (cName == “ms-formtable”){
formTables = pageTables[i];
}
}
var rows = formTables.rows;
rows[rows.length-2].style.display = “none”;
rows[rows.length-3].style.display = “none”;
}
</script>
Save this and you will see a row disappear from the NewForm.aspx page.
Note: You will need to have JavaScript enable on the browser and make sure that the fields you are hiding are not “Required”. To hide more fields, just add another line in the sequence of the last line: rows[rows.length-3].style.display = “none”;




Thank you for checking out my blog.


More Options ...

Categories
Tag Cloud
Blog RSS
Comments RSS

Void
Life « Default
Earth
Wind
Water
Fire
Light 