SPLookupAddNew

Aug 24, 2010 at 12:37 AM

Marc

I'm interested in combining SPLookupAddNew and SPDisplayRelatedInfo. Why, you ask. My customer has an additional column that they are using for the ID. I would like to display their ID column for SPLookupAddNew and hide SharePoint's.

Let me know what you think. Hope life has been treating you well and you haven't been working to hard.

 

Marcus

Coordinator
Aug 25, 2010 at 1:30 AM

Marcus,

Marc is actually on vacation in Turkey. I've been attempting to pseudo-cover for him (though I don't think anyone can live up to Marc's level). I saw this post this morning but didn't reply as it looked like you've had a lot of dialog with Marc in the past, and he sometimes logs on to answer some of the posts (despite the fact that he's supposed to separate himself from the phone and laptop on a vacation!!).

I'm trying to more fully understand what you're doing so I can try and point you in the right direction. You're never going to replace the SharePoint ID field. You can certainly create a new column for IDs, but SharePoint is never going to use that column as the primary key; lookups and such are always going to resolve back to the SharePoint ID column.

Are we talking form/data entry type uses for your wanting to use the other ID, or more the displaying of the data?

The reason I ask is that I would think you could accomplish the form stuff without the use of SPDisplayRelatedInfo (unless I'm misunderstanding your goals). Simply add a new lookup column back to your real ID list, and use some simple jQuery to hide the old SharePoint fields (as applicable). If you're looking for more the displaying of data, with a large result set, repeated web service calls probably aren't very efficient. You'd probably be better off linking the data sources and using a DVWP to display the data.

If you'd like to post some more information I'll reply with some updated options for you.

Mike

Aug 25, 2010 at 2:42 PM

Mike

Thanks for responding and you kinda hinted as to my direction. Hopefully I can clarify.

All I want is to display a addtional corresponding field (column) along side the ID SPLookupAddNew field. Similiar to how SPDisplayRelatedInfo works and hopefully hide the ID column that is used for SPLookupAddNew. I love the way SPLookupAddNew works, I just want to display a more meaningful field to the customer. They have no clue about the ID column.

Hope this helps

Marcus

Coordinator
Aug 26, 2010 at 6:02 AM

Marcus:

It sounds like your situation is a bit unique. Usually with a Lookup column, you'd be displaying something meaningful rather than some sort of ID; that's sort of the point of a Lookup column. You probably will have to add some additional custom script to do what you need.

M.