Variables available in the “Current Item” are frustratingly incomplete

[Rant Coming…]

I wish I wish I WISH there was an easier way to do this… but every time I need to create a URL (link) to a list item, I have to build it manually in the Workflow. There are simply no properties available that you can just "use".

Here are all of the OTB properties, not including the columns (in my case, I had a "Title" column).

Approval status – (0;#Approved)
Approver Comments – (?????)
Attachments – (False)
Content Type – (Item)
Content Type id – (0x01000A6DA9AE04C6EC49A86D68039C7C52E4)
Created – (28/01/2009 3:33:17 PM)
Created By – (DOMAIN_NAME\USER_ID)
Encoded absolute URL – (http://yourdomain/bta/Lists/TestEmailCheck/2_.000I MEAN, COME ON! HOW USELESS IS THIS!!
File Name – (2_)
File type – (?????)
GUID – {10A35B6E-E36C-4BCA-B996-D21BF7F03BCF}()
HTML file type – (?????)
ID – (2)
Is Current Version – True()
Item type – (0)
Level – (1)
Modified – (28/01/2009 3:33:17 PM)
Modify by – (DOMAIN_NAME\USER_ID)
Name, for use in forms – (2_.000)
Order – (200)
Path – (bta/Lists/TestEmailCheck)
Server relative URL – (/bta/Lists/TestEmailCheck/2_.000)
Type, Icon linked to document – (?????)
UI version – (512)
URL Path (/bta/Lists/TestEmailCheck/2_.000)
Version – (1.0)

So to build one, we have to use the following process:

http://HardcodedURL/[Path]/DispForm.aspx?ID=[ID]

Hardcoded url makes AAM’s useless (but then so does the Infrastructure Update, so who’s counting).

The hope is that dispform.aspx location or filename is never change, because the url breaks again.

How hard would it be to have one of the URL fields actually contain a working URL that took you to the list item! Aaaargh!

[Rant complete.]

Brad

Advertisements

About Brad Saide

I'm a SharePoint consultant. I'm also slowly going bald, seem to have a permanent spare tyre around my waist and enjoy socialising with friends over a beer or 10. The last 2 may possibly be related. Started working with SharePoint when the first version was in limited beta release (participated in the Technology Adoption Program while at Woolworths) and have been committed to the adoption of the technology as a business enabler ever since.
This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to Variables available in the “Current Item” are frustratingly incomplete

  1. Yaohan says:

    Hey mate, you should\’ve just called me about this. You don\’t really have to hardcode the url. What you can do is manipulate the encoded abs url. So, in your example, instead of http://yourdomain/bta/Lists/TestEmailCheck/2_.000, you can strip the last string to get the item ID and put the previous string with /DispForm.aspx?ID= plus the ID, and bang, bob\’s your uncle 🙂 So if the path changed, at least your code is still working. In some situation, you don\’t even need to use abs url, you can use server relative url, and when the string is rendered in the page, sharepoint is smart enough to put them together (this is important if you have AAM to ensure users browse through consistent url path).Yaohan.

  2. Brad says:

    That\’s not a bad idea, my man. It gets rid of the hardcoded URL and adds a bit more reliability to the code. Relative URL\’s are out in my case because I was writing to an email message, but I can see how it would work in a metadata field.

  3. Brad says:

    It would be great to develop a "helper" workflow task that pulled the "Edit" and "View\’ links out of a known list item and assigned it to a workflow variable. This could be a useful addition to the http://www.codeplex.com/SPDActivities project

  4. Yaohan says:

    which workflow are you talking about? if it\’s a simple SPD workflow, you might be able to build a string from the relative url and put it into workflow variable before you send the email, but of course you may have to hard code a friendly url of some sorts. i can\’t really say much without knowing the whole scenario. let\’s talk about it when we catch up.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s