Accessing 'Modified By' field in a reusable workflow - sharepoint-2010

I'm creating a reusable workflow in SharePoint designer 2010. I've created a custom content type with all the necessary fields that I'll be used in the workflow. But I'm not able to get the Modified By field (Editor) inside the workflow.
<FieldRef ID="{d31655d1-1d5b-4511-95a1-7a09e9b75bf2}" ReadOnly="TRUE" Name="Editor" DisplayName="Last Updated By" FromBaseType="TRUE" Required="FALSE" PITarget="" PrimaryPITarget="" PIAttribute="" PrimaryPIAttribute="" Aggregation="" Node="" />
I really doubt whether the ID is matching with the inbuilt editor field. How can I cross-verify this? Any ideas?

Not sure but do you really need to include it explicitly? Editor is part of base content type : Item, and down the hierarchy all other content types should be inheriting it without the need to explicitly include it.
Regards,
Nitin Rastogi

Related

how to make condition to a specific groups

I want to add a condition to one group access to no open and no create_edit just for normal people, but when I use the code below the admin have no access to edit I give to him all access right to file security
<field name="name" domain="[('person_id', '=', person_id), ]"
options='{"no_open":True,"no_create_edit": True}' readonly="1"
/>
No way to get it done without Odoo core extension to provide that features or by overriding the method fields_view_get to dynamically change the view definition based on the user groups.

Create small datasource with only 3 items

I was handed a legacy app built a few years back in VB.Net. I am modifying a DevExpress ASPxRadioButtonList and would like to use a small list of only 3 items that will never change as the datasource. It would be great if I could do the ds in the webform. It will basically be a list of "option 1", "option 2" or "both options". I dont need an SqlDataSource because there is no db call, these can be hard coded. What would be the best object to create that can be used as a datasource, and how would I manually add the 3 items to it in the webform? Most examples of things only show how to add items from the code behind.
Thanx so much in advance, I have learned so much from this site.
Use the ITEMS property to add static items. Maybe utilize their online help or search using google
<dx:ASPxRadioButtonList ID="ASPxRadioButtonList1" runat="server" SelectedIndex="0">
<Items>
<dx:ListEditItem Selected="True" Text="Option1" Value="Option1" />
<dx:ListEditItem Text="Option2" Value="Option2" />
<dx:ListEditItem Text="Both" Value="Both" />
</Items>
</dx:ASPxRadioButtonList>

Reporting Services Error?

When running a report in preview I get the following error The definition of the report is invalid , the tablix 'Tablix11' contains an invalid TablixMember. The sort Expressions element is not allowed if Group is omitted.
I have never come across this error before and cant understand what is causing it.
The error can be replicated by creating a simple Tablix and looking at the underlying XML.
When you create a Tablix with a group, the underlying RDL XML will include something like this:
<TablixRowHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember>
<Group Name="Group1">
<GroupExpressions>
<GroupExpression>=Fields!val.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!val.Value</Value>
</SortExpression>
</SortExpressions>
<TablixMembers>
<TablixMember>
<Group Name="Details3" />
</TablixMember>
</TablixMembers>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
If you remove the entire Group element, this will give the same error you're seeing:
If you also remove the SortExpressions element this will allow the report to render without error.
However - it's impossible for me to say how your RDL file got in this state in the first place. Given that hacking XML to get things running is seldom a good idea, my recommendation would be to start the tablix from scratch instead of hacking things to a working state - you might just be introducing more problems.
But at least hopefully now you can see why the error might be occurring.
I found that the Tablix header had a textbox property containing interactive sort. This text box is in the header, and not part of the detail. When I deleted the field from the detail of the tablix, the interactive sort remained on the textbox in the header.
Changing it on the header by right clicking on the header textbox of the tablix, then selecting textbox properties, then selecting "interactive sorting", and then correcting the "sort by" value to the correct field name did the trick.

When does SPMetal generate EntityRef properties for lookup fields?

I have a defined a content type called SPVideoDataItem containing those two fields:
<Field ID="{487F2AD6-D9D6-47AA-AA99-B3FFF893E689}" Name="LUVideoQuality" Group="Custom Columns" Type="Lookup" DisplayName="Video Quality" List="Lists/GlobalVideoQualityList" ShowField="Title" PrependId="TRUE" ShowInEditForm="TRUE" ShowInNewForm="TRUE"/>
<Field ID="{F348A825-764D-41EE-AF92-8CF1DC246E47}" Name="LUVideoTitle" Group="Custom Columns" Type="Lookup" DisplayName="Video Title" List="Lists/VideoItemList" ShowInEditForm="TRUE" ShowInNewForm="TRUE" ShowField="VideoItemTitle" PrependId="TRUE" Required="TRUE"/>
For LUVideoQuality I get a property in a class called VideoItemDataListSPVideoDataItem:
public SPVideoQualityItem VideoQuality
which exposes a EntityRef-Member, so I can access all properties of SPVideoQualityItem.
However, for LUVideoTitle spmetal just generates two properties in the parent class SPVideoDataItem
public string VideoTitleVideoItemTitle
public System.Nullable<int> VideoTitleId
where I can only access title and ID.
I wonder why spmetal handles this two lookups differently. Can anyone explain this behaviour? I would prefer that all lookups are handled like LUVideoQuality in my example.
I've encountered the same issue.
When I let go of the principle to create a separate content type and just created a list based on content type Item it did generate the entity refs.
Apparently it has something to do with the "WebId" property of the lookup fields. A colleague told me that they got it working by adding
WebId="~sitecollection"
to all lookup fields in the content type definitions (Elements.xml). Im not marking this as an answer because I did not check if it is working now because of this attribute or some other change in the definitions.

SharePoint 2010: RemoveFieldRef and Inherits="TRUE"

I have created a custom content type that inherits from the OOTB SharePoint Picture content type. The only customisations I have made is to add a simple URL field, and remove two of the fields on the base type. See below:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Picture (0x010102) -->
<ContentType ID="0x0101020027f16ab27e6e45a6848c25c47aaa7053"
Name="Custom Picture"
Description=""
Group="Custom"
Inherits="TRUE"
Version="0">
<FieldRefs>
<RemoveFieldRef ID="{b66e9b50-a28e-469b-b1a0-af0e45486874}" Name="Keywords" />
<RemoveFieldRef ID="{a5d2f824-bc53-422e-87fd-765939d863a5}" Name="ImageCreateDate" />
<FieldRef ID="{c29e077d-f466-4d8e-8bbe-72b66c5f205c}" Name="URL" DisplayName="URL" Required="FALSE" />
</FieldRefs>
</ContentType>
</Elements>
If I create a picture library based on my custom content type, the "URL" field that I added appears in the new/edit forms, however the two fields that I have attempted to remove are also displayed, i.e. the RemoveFieldRef's are being ignored. If I look at the content type in "Site Settings -> Content Type Gallery", these two fields are still listed there.
Setting Inherits="FALSE" on my custom content type (see MSDN definition) successfully removes just these two fields from the "Site Settings -> Content Type Gallery" page, however then none of the base fields are displayed in the new/edit forms -- only my custom "URL" field.
What can I do to ensure that all the fields from the base "Picture" content type are displayed on the new/edit forms of my picture library except the two fields that I have specifically removed?
I believe the nature of this issue to be the understanding of how content type inheritance works.
From MSDN (http://msdn.microsoft.com/en-us/library/aa544268.aspx)
If Inherits is TRUE, the child content type inherits all fields that are in the parent, >including fields that users have added.
If Inherits is FALSE or absent and the parent content type is a built-in type, the child >content type inherits only the fields that were in the parent content type when >SharePoint Foundation was installed. The child content type does not have any fields that >users have added to the parent content type.
If Inherits is FALSE or absent and the parent content type was provisioned by a sandboxed >solution, the child does not inherit any fields from the parent.
I think the key phrase above is "If Inherits is TRUE, the child content type inherits ALL fields that are in the parent including fields that users have added."
This means that in order to accomplish what you set out to do you will have inherits set to false and you will have to include FieldRef elements for all fields you wish to use in your content type.
You make no reference / don't include code for how the content type was added to your list instance. Make sure this has been updated to support the removal or setting of inherits to false.
These sites support what is described here.
http://kvdlinden.blogspot.com/2011/06/issues-with-removefieldref-and.html
http://nelsonlamprecht.wordpress.com/2010/08/25/sharepoint-2010-removefieldref-and-inherits%E2%80%9Dtrue%E2%80%9D/