Coding best practice display name vs internal name in itemUpdated event receiver

Hi,
In an itemupdated event receiver, when referring to list fields, is it better to use the field's internal name, or its display name?
Is there a clear guideline or best practice, or is this a subjective discussion?
Thanks in advance for your replies

Hi Jorge,
One of the best practice I follow is Repository pattern for list access, on that scenario I always use Internal Names.
The rational behind this decision is Fristly, I will have full control, Secondly I need not to worry about column names changes by business/endusers through SharePoint UI which I cannot control of. Though we had governance in place and trained
the users, still no avail, users will go and change the column names. 
Thirdly, My code will not break when there is a display name change. One of my client was too UI rather than business logic, since the enduser are high profile managers, spacing between columns and readabiltily are first class citizen.  Those changes
that we made to the list library did not affect our code and the application was running without code refactoring.
Backto your question, I will use Internal names in my CAML query to minimize error as follows
item["internalName"]
Your question is subjective, I have not seen any best practices on this subject, being said that, if you are looking for best practice and guidance I would suggest you to start here -
SharePoint 2010 Guidance
http://msdn.microsoft.com/en-us/library/ff770300.aspx ( no idea on SP 2013 guidance availablity)
Go through the code and doc, You will get the design rational behind each choice.
Hope this helps!
Ram - SharePoint Architect
Blog - SharePointDeveloper.in
Please vote or mark your question answered, if my reply helps you

Similar Messages

  • SOA Suite 11g Coding Best Practice Document

    Hello,
    I am looking for coding best practice dosument for SOA suite 11g. I have seen one document for "soa_best_practices_1013x_drop3" but this was for SOA 10g. I could not find any such document for SOA 11g. Please let me know if some one has document for best practice, coding standard, naming convention for BPEL,OSB,B2B etc.
    Regards,
    Prashant

    Now we need to publish our services on the internet. I am looking for the security mechanism that I should apply in order to make the services secure. I may even like to verify that the request invoking service A is only coming from specified context.One approach we followed at a customer :
    - SOA was installed within internal firewall zone
    - A F5 BigIP Load Balancer was setup in DMZ. This load balancer terminated one way SSL connections coming from service consumers over internet. The load balancer forwaded the request to a pool of apache of web servers within DMZ
    - The Apache web servers had a redirection rule which forwarded the request to the soa server ports within the internal firwall zone. The internal firewall was opened to allow connections between apache web servers and soa server ports.
    - WS Security Username token/plain text password was used for message level security at the soa services layer.
    Some alterations you can do :
    1. enforce 2 way ssl and make load balancer to validate the CN of the client certificate. This can make sure only authorized clients are to make calls to the service
    2. OR setup some sort of IP filtering at DMZ firewall i.e. allow traffic only from authorized clients IP addresses to the load balancers virtual address for this specific service.

  • Where to find coding best practices for j2se 5 specific features?

    The Coding conventions page seems to be out of date (http://java.sun.com/docs/codeconv/) since it was last updated in 1999. Where can I find the new dos and don'ts for the new J2se 5 features,

    Maybe
    Thinking InJava would be a nice place to start.I just checked my library to see whether I own Effective Java (just
    changed that). My first reaction was: "WTF? I have a J2ME book? And
    JDBC, of all things!?" :)lol! In a way I like the idea of a j2me technology stack; I just find the
    realization thereof a totally, dumb mess. Those telecom drones don't
    really want to be compliant so nor will their implementations they
    provide either.
    JDBC is just a necessary evil, no more no less. xml is an invention of
    the devil's bad and nasty sister though ;-)
    kind regards,
    Jos

  • Event Receiver to get folder Names from List View Web Part

    Hi,
    We have a requirement i.e.
    On one of the page,there are some folders on the list view web part.
    Now through event receiver i should pick the folder names from list view web part and
    update the same in the list.
    If that names already exists in the list then we should leave without updating,if not we have to add folder name in the list.
    Please share your ideas regarding the same.
    Regards,
    Naga Sudheer M
    Thanks & Regards, Sudheer

    Hello,
    LVWP is just for displaying content of site so you need to associate your event receiver with actual list/library. You can create ItemAdded event receiver to check existing folder and create new if not existing. "sk2014" links are good to start.
    http://sharepoint.stackexchange.com/questions/59788/change-name-in-itemadding-event-receiver-or-create-a-new-item
    Let us know in case any doubt
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • SAP PI conceptual best practice for synchronous scenarios

    Hi,
    <br /><br />Apologies for the length of this post but I'm sure this is an area most of you have thought about in your journey with SAP PI.
    <br /><br />We have recently upgraded our SAP PI system from 7.0 to 7.1 and I'd like to document  best practice guidelines for our internal development team to follow.
    I'd be grateful for any feedback related to my thoughts below which may help to consolidate my knowledge to date.
    <br /><br />Prior to the upgrade we have implemented a number of synchronous and asynchronous scenarios using SAP PI as the hub at runtime using the Integration Directory configuration.
    No interfaces to date are exposes directly from our backend systems using transaction SOAMANAGER.
    <br /><br />Our asynchronous scenarios operate through the SAP PI hub at runtime which builds in resilience and harnesses the benefits of the queue-based approach.
    <br /><br />My queries relate to the implementation of synchronous scenarios where there is no mapping or routing requirement.  Perhaps it's best that I outline my experience/thoughts on the 3 options and summarise my queries/concerns that people may be able to advise upon afterwards.
    <br /><br />1) Use SAP PI Integration Directory.  I appreciate going through SAP PI at runtime is not necessary and adds latency to the process but the monitoring capability in transaction SXMB_MONI provide full access for audit purposes and we have implemented alerting running hourly so all process errors are raised and we handle accordingly.  In our SAP PI Production system we have a full record of sync messages recorded while these don't show in the backend system as we don't have propogation turned on.  When we first looked at this, the reduction in speed seemed to be outweighed by the quality of the monitoring/alerting given none of the processes are particularly intensive and don't require instant responses.  We have some inbound interfaces called by two sender systems so we have the overhead of maintaing the Integration Repository/Directory design/configuration twice for these systems but the nice thing is SXMB_MONI shows which system sent the message.  Extra work but seemingly for improved visibility of the process.  I'm not suggesting this is the correct long term approach but states where we are currently.
    <br /><br />2) Use the Advanced Adapter Engine.  I've heard mixed reviews about this functionaslity, there areh obvious improvements in speed by avoiding the ABAP stack on the SAP PI server at runtime, but some people have complained about the lack of SXMB_MONI support.  I don't know if this is still the case as we're at SAP PI 7.1 EHP1 but I plan to test and evaluate once Basis have set up the pre-requisite RFC etc. 
    <br /><br />3) Use the backend system's SOAP runtime and SOAMANAGER.  Using this option I can still model inbound interfaces in SAP PI but expose these using transaction SOAMANAGER in the backend ABAP system.  [I would have tested out the direct P2P connection option but our backend systems are still at Netweaver 7.0 and this option is not supported until 7.1 so that's out for now.]  The clear benefits of exposing the service directly from the backend system is obviously performance which in some of our planned processes would be desirable.  My understanding is that the logging/tracing options in SOAMANAGER have to be switched on while you investigate so there is no automatic recording of interface detail for retrospective review. 
    <br /><br />Queries:
    <br /><br />I have the feeling that there is no clear cut answer to which of the options you select from above but the decision should be based upon the requirements.
    <br /><br />I'm curious to understand SAPs intention with these options  -
    <br /><br />- For synchronous scenarios is it assumed that the client should always handle errors therefore the lack of monitoring should be less of a concern and option 3 desirable when no mapping/routing is required? 
    <br /><br />- Not only does option 3 offer the best performance, but the generated WSDL is ready once built for any further system to implement thereby offering the maximum benefit of SOA, therefore should we always use option 3 whenever possible?
    <br /><br />- Is it intended that the AAE runtime should be used when available but only for asynchronous scenarios or those requiring SAP PI functionality like mapping/routing otherwise customers should use option 3?  I accept there are some areas of functionality not yet supported with the AAE so that would be another factor.
    <br /><br />Thanks for any advice, it is much appreciated.
    <br /><br />Alan
    Edited by: Alan Cecchini on Aug 19, 2010 11:48 AM
    Edited by: Alan Cecchini on Aug 19, 2010 11:50 AM
    Edited by: Alan Cecchini on Aug 20, 2010 12:11 PM

    Hi Aaron,
    I was hoping for a better more concrete answer to my questions.
    I've had discussion with a number of experienced SAP developers and read many articles.
    There is no definitive paper that sets out the best approach here but I have gleaned the following key points:
    - Make interfaces asynchronous whenever possible to reduce system dependencies and improve the user experience (e.g. by eliminating wait times when they are not essential, such as by sending them an email with confirmation details rather than waiting for the server to respond)
    - It is the responsibility of the client to handle errors in synchronous scenarios hence monitoring lost through P-P services compared to the details information in transaction SXMB_MONI for PI services is not such a big issue.  You can always turn on monitoring in SOAMANAGER to trace errors if need be.
    - Choice of integration technique varies considerably by release level (for PI and Netweaver) so system landscape will be a significant factor.  For example, we have some systems on Netweaver 7.0 and other on 7.1.  As you need 7.1 for direction connection PI services we'd rather wait until all systems are at the higher level than have mixed usage in our landscape - it is already complex enough.
    - We've not tried the AAE option in a Production scenarios yet but this is only really important for high volume interfaces, something that is not a concern at the moment.  Obviously cumulative performance may be an issue in time so we plan to start looking at AAE soon.
    Hope these comments may be useful.
    Alan

  • Number ranges - Import of Legacy Data - best practice

    Hi,
    we are planning to move legacy data objects to our SAP CRM.
    These Objects have an external key (Numeric, 6 digit) in a number range that is relatively full and highly fragmented.
    Is there a best practice how to implement internal number assignment for this kind of pre filled number range?
    The internal key in SAP would be different and under our control, the external key is the interesting one.
    Cheers,
    Andreas

    Hi Luís,
    The scenario is in the context of insurance business.
    The setup: SAP CRM as central Business Partner system. And in the CRM we keep the policy numbers of the surrounding (non SAP) policy systems as references (I'm talking about insurance policies...).
    For each policy we create a one order object, containing, among others, LOB, policy type and the policy number.
    These policy number ranges are to be maintained in the central CRM system in the future.
    And in one of these Systems they have the situation described above:
    6 digit key in a number range that is relatively full and highly fragmented. They are managing their numbers in an xls right now, but we would also have them migrated into our system.
    And after the migration we would be responisble to find a unused number, whenever a new policy is to be created.
    Cheers,
    Andreas

  • Change document name in event receiver

    I need to rename a document during an ItemUpdating or an ItemUpdated event. Either one would be fine. When my user changes the file name, I want my code to set it to something else. In the examples below, I am trying to set it to a silly constant value.
    If I can get this to work, I'll change it to use something meaningful.
    Is there any way to change a document's name in an event receiver? I have tried using ItemUpdated (with <Synchronization>Synchronous</Synchronization> in elements.xml). I have tried this:
    public override void ItemUpdated(SPItemEventProperties properties)
    using (DisabledEventsScope scope = new DisabledEventsScope())
    base.ItemUpdated(properties);
    try
    properties.Web.AllowUnsafeUpdates = true;
    properties.ListItem.File.Properties["FileLeafRef"] = "FOOFOO.docx";
    properties.ListItem.File.Update();
    properties.Web.AllowUnsafeUpdates = false;
    catch (Exception ex)
    properties.ErrorMessage = "Document cannot be renamed." + ex.Message;
    properties.Status = SPEventReceiverStatus.CancelWithError;
    //base.ItemUpdated(properties);
    I have also tried this:
    public override void ItemUpdated(SPItemEventProperties properties)
    using (DisabledEventsScope scope = new DisabledEventsScope())
    base.ItemUpdated(properties);
    try
    properties.Web.AllowUnsafeUpdates = true;
    properties.AfterProperties["FileLeafRef"] = "FOOFOO.docx";
    properties.ListItem.Update();
    properties.Web.AllowUnsafeUpdates = false;
    catch (Exception ex)
    properties.ErrorMessage = "Document cannot be renamed." + ex.Message;
    properties.Status = SPEventReceiverStatus.CancelWithError;
    //base.ItemUpdated(properties);
    And in that last one, I also tried setting properties.ListItem["FileLeafRef"]. I have also tried putting the base.ItemUpdated line after my logic (where you see it commented out above).
    Nothing works. No errors are thrown, but the document name stays the way the user set it.
    Leigh Webber

    There's three things you have to do in order to update the name properties:
    Assign properties.ListItem to a variable
    Update the BaseName field
    Update the Type field (if you wish to change the extension)
    public override void ItemUpdated(SPItemEventProperties properties)
    EventFiringEnabled = false;
    base.ItemUpdated(properties);
    var item = properties.ListItem; item["BaseName"] = "BarBar";
    item["Type"] = "docx"; //If you need to change the extension
    item.Update();
    EventFiringEnabled = true;
    This should fix your issue

  • Best practice for searching on surname/lastname/name in Dutch

    I'm looking for a best practice to store names of persons, but also names of companies, in my database.
    I always store them as is (seems logical since you need to be able to display the original input-name) but I also want to store them transformed in some sort of way so I can easily search on them with LIKE! (Soundex, Metaphone, Q-Gram, ...)
    I know SOUNDEX and DIFFERENCE are included in SQLServer, but they don't do the trick.
    If somebody searches for the phrase "BAKKER", you should find names like "Backer", "Bakker", ... but also "De Backer", "Debecker", ... and this is where SOUNDEX fails ...
    Does someone know some websites to visit, or someone already wrote a good function to transform a string that I can use to store the names but also to transform my search data?
    (Example:  (Pseudo lang :-))
    function MakeSearchable (sString)
      sString = sString.Replace(" ", ""); //Remove spaces
      sString = sString.Replace("CK", "K");
      sString = sString.Replace("KK", "K");
      sString = sString.Replace("C", "S");
      sString = sString.Replace("SS", "S");
      return sString;
    Greetz,
    Tim

    Thanks for the response, but unfortunately the provided links are not much help:
    - The first link is about an article I don't have access to (i'm not a registered user)
    - The second link is about Integration Services. This is nice for Integration stuff, but I need to have a functionality within a frontend. 
    - The third link is for use in Excel.
    Maybe I'm looking for the wrong thing when wanting to create an extra column with "cleaned" up data. Maybe there's another solution from within my frontend or business layer, but I simply want a textbox on a form where users can type a search-value like
    "BAKKER". The result of the search should return names like "DEBACKER", "DE BEKKER", "BACKER", "BAKRE", ...
    I used to work in a hospital where they wrote their own SQL-function (on an Interbase database) to do this: They had a column with the original name, and a column with a converted name:
    => DEBACKER => Converted = DEBAKKER
    => DE BEKKER => Converted = DEBEKKER
    => BACKER => Converted = BAKKER
    => BAKRE => Converted = BAKKER
    When you searched for "BAKKER", you did a LIKE operation on the converted column ...
    What I am looking for is a good function to convert my data as above.
    Greetz,
    Tim

  • Best practice on how to handle employees who do not have a last name?

    We are a Canadian based company with some International employees. We have recently begun to enter the International employees into the HR module. This has led to some problems for employees from India who do not have both a first name and a last name as many of our downstream systems require both names.
    I'm wondering what other companies with International employees have done in this circumstance. Can someone recommend a Best Practice?  We want to ensure that whatever we do is not offensive to anyone.
    Thanks.

    Dear,
    Indian names vary from region to region. Sometimes Names also influence by religion and caste. Different languages spoken in India in different regions. This variety makes confusing differences in names and their styles.
    Now come to the point, since you are international company, while entering the names of your international employees - i would like to suggest to consider the employees names as mentioned in their passport (If they hold valid passport). In case of non availability of passports consider their bank information or any other available information so that they didnt face any further problems like visa, banking transactions etc etc.
    1. Maddepalli Venkata Ramana Rao
    In this case Maddepalli will be his surname, Venkata Ramana can be his first name and Rao can be mentioned as Second / last name.
    2. Hardev Singh
    In this case you didnt find a surname... Singh will be considered as Surname or his ethinic recognition. In this case you can enter Hardev as First name and Singh as last name.
    Make some entry fields are optional depending on the situation. Take help of an Indian origin employees help exists in your office.
    Regards,
    Syed Hussain.

  • How do I get the List REST method to return the results with the display name and not the internal name. I also need the hyperlink to the attached document.

    FileSystemObjectType: 0
    Id: 2
    ContentTypeId: "0x010100517BCCBD1C63034A8C1141184DAB12C5"
    Title: null
    OData__dlc_DocId: null
    OData__dlc_DocIdUrl: null
    zopv: "Paint Specification"
    s2ue: "J"
    We'd prefer to make a single call. It's too bad the REST Api doesn't return the data in the same format as the WCF service, which uses the Display Name and not Internal Name. It also includes the hyperlink to the document.

    Hi,
    You can get the display name of fields with typedisplayname property.For more information,you can refer to the article:
    http://msdn.microsoft.com/en-us/library/office/dn600182(v=office.15).aspx#bk_Field
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Best Practice : how 2 fetch tables, views, ... names and schema

    hi,
    I am looking for the best practice about getting the catalog of a database.
    I have seen that I can make some select in system-tables(or views) such as DBA_TABLES and DBA_VIEWS, or DBA_CATALOG, but is that the best way to grab thses informations ?
    (I ask this question because It seems a strange way to me to get the table names using a simple select, but getting column info using a specialized function, OCIDescribeAny(). this does not look like a coherent API...)
    thanks for your advice
    cd

    in the same idea, why use OCIDescribeAny instead of doing an appropriate select in DBA_TAB_COLUMNS ?
    cd

  • Account Name Transition - Best Practices

    Hey all.
    I am about to upgrade my dual proc G5 from 10.4 to 10.5. I have a legacy account which I wish to change the login for, short name, as I've moved our home systems to a new (better, I hope!) naming convention. My plan for the upgrade is an "Erase and Install" followed by transfer of my old install data via the Setup Assistant (I have several bootable Carbon Copy Clones of the my original drive).
    However, it strikes me that this is an excellent time to change my login, short name. The question becomes, what's the best practice for doing so?
    I've been reading about DanKrakes "ChangeShortName" script which doesn't yet work under 10.5 (Leopard). But then there's the idea of just making a new user on my fresh install of 10.5 and moving my old home directory into the new user space. Problem with that is that the UID probably won't be the same.
    Fortunately, I don't do that much complex. My keychain is pretty empty and the most "linked" item I know of is probably my Palm stuff (Palm desktop upgraded to The Missing Sync) and my iTunes (no purchases, just a lot of media).
    My thinking is this:
    1.) On my 10.4 install, run the "ChangeShortName" script and change the short name.
    2.) Do a fresh back up of home directory and do two more clones of my 10.4 install.
    3.) Run the "Erase and Install" from the 10.5 DVD and then do the transfer of files via the Setup Assistant.
    Does that seem to make sense? Any "gotchas" to look out for? Anything I'm forgetting?
    thxs much in advance!
    cp root
    POST: Hope this is a good place to post this note. Sorta crosses a few boundaries so please let me know if this is not the case!

    Sounds like a good plan. For details on the various install options,
    see:
    http://discussions.apple.com/thread.jspa?messageID=5757385
    http://discussions.apple.com/thread.jspa?messageID=5666369
    http://discussions.apple.com/thread.jspa?messageID=5646414
    I used E&I and migrated.

  • Is it possible to have 2 display names (one for internal use; the other for external use) in Active Directory?

    The idea:
    When communicating amongst our own staff via email we'd like to see our display names in this format:
    Firstname Lastname (Division/Department/Branch/Unit)
    Whereas, when we send emails to people outside the company, we'd like to be seen as:
    Firstname Lastname (Company Name)
    Is this technically possible?
    Regards,
    Anthony

    Please read about Exchange Simple Display Name if you are using Exchange in your environment. It should be suitable for your needs, but as far I know not every Exchange version support it.
    In Exchange 2003 this Simple Display Name was at Advanced tab of user, but now..
    With Exchange 2013, SimpleDisplayName is configured using Exchange Management Shell (EMS)
    Example:
    Set-Mailbox ALIAS -SimpleDisplayName $True
    ..and as with Exchange 2007/2010, you will need to enable UseSimpleDisplayName on RemoteDomain.
    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer.

  • Email Sender's display name not displaying/resolving on internal emails with POP/IMAP clients

    Here's the scenario. I have two 2013 test accounts setup in Outlook as POP/SMTP accounts. I have their name setup as initials in the outlook account (the "Your Name" field).  If I send an email (Through SMTP) to a 2013 Exchange(Outlook
    Anywhere) client, their names resolve to their actual Display Name in the GAL which is correct.  Now if I send an email to another 2013 POP/IMAP user, their name shows what is setup in Outlook which is their initials which is not correct.
    Now we are currently in the process of a 2007 to 2013 migration.  I do not see this behavior on the Exchange 2007 side with POP/IMAP clients.  If I run the same test setup with a 2007 mailbox as the recipient, the sender's name resolves to
    their GAL display name and NOT the name configured in the Outlook Account settings.  It doesn't matter whether the sender is a 2007 or 2013 account.  As long as the recipient is on 2007 it works fine.
    This is all tested using authenticated SMTP.  The only difference I can tell is that the 2007 servers resolve the name before delivering it to the inbox where the 2013 servers don't.
    There aren't any GAL or Address Book related issues on the 2013 side.  Full exchange clients or OWA work correctly.

    Hi,
    It seems to be related to the permission settings on the receive connector. For example, using a Receive Connector for Anonymous Relay. We can refer to this article:
    http://technet.microsoft.com/en-us/library/aa996395(v=exchg.141).aspx
    And we can use the tool Dsacls to check the permissions:
    http://technet.microsoft.com/en-us/library/cc771151(v=ws.10).aspx
    Receive Connector Permissions
    http://technet.microsoft.com/en-us/library/jj673053(v=exchg.150).aspx

  • Best practices of having a different external/internal domain

    In the midst of migrating from a joint Windows/Mac server environment to a completely Apple one. Previously, DNS was hosted on the Windows machine using the companyname.local internal domain. When we set up the Apple server, our Apple contact created a new internal domain, called companyname.ltd. (Supposedly there was some conflict in having a 10.5 server be part of a .local domain - either way it was no worries either way.) Companyname.net is our website.
    The goal now is to have the Leopard server run everything - DNS, Kerio mailserver, website, the works. In setting up the DNS on the Mac server this go around, we were advised to just use companyname.net as the internal domain name instead of .ltd or .local or something like that. I happen to like having a separate local domain just for clarity's sake - users know if they are internal/external, but supposedly the Kerio setup would respond much better to just the one companyname.net.
    So after all that - what's the best practice of what I should do? Is it ok to have companyname.net be the local domain, even when companyname.net is also the address to our external website? Or should the local domain be something different from that public URL? Or does it really not matter one way or the other? I've been running companyname.net as the local domain for a week or so now with pretty much no issues, I'd just hate to hit a point where something breaks long term because of an initial setup mixup.
    Thanks in advance for any advice you all can offer!

    Part of this is personal preference, but there are some technical elements to it, too.
    You may find that your decision is swayed by the number of mobile users in your network. If your internal machines are all stationary then it doesn't matter if they're configured for companyname.local (or any other internal-only domain), but if you're a mobile user (e.g. on a laptop that you take to/from work/home/clients/starbucks, etc.) then you'll find it a huge PITA to have to reconfigure things like your mail client to get mail from mail.companyname.local when you're in the office but mail.companyname.net when you're outside.
    For this reason we opted to use the same domain name internally as well as externally. Everyone can set their mail client (and other apps) to use one hostname and DNS controls where they go - e.g. if they're in the office or on VPN, the office DNS server hands out the internal address of the mail server, but if they're remote they get the public address.
    For the most part, users don't know the difference - most of them wouldn't know how to tell anyway - and using one domain name puts the onus on the network administrator to make sure it's correct which IMHO certainly raises the chance of it working correctly when compared to hoping/expecting/praying that all company employees understand your network and know which server name to use when.
    Now one of the downsides of this is that you need to maintain two copies of your companyname.net domain zone data - one for the internal view and one for external (but that's not much more effort than maintaining companyname.net and companyname.local) and make sure you edit the right one.
    It also means you cannot use Apple's Server Admin to manage your DNS on a single machine - Server Admin only understands one view (either internal or external, but not both at the same time). If you have two DNS servers (one for public use and one for internal-only use) then that's not so much of an issue.
    Of course, you can always drive DNS manually by editing the zone files directly.

Maybe you are looking for