How do I perform an action on a document in a library, before my Event Receiver is fired?

My scenario:
Currently when a document is uploaded into a document library, it gets its metadata from the document. But then there is a need to change the title property to satisfy a naming convention which basically concatenates a combination of the information in
other columns in the document library...right now, there is already a SP designer workflow that is doing this and updating the title field (this was done previously by someone else). Now I want to add an event receiver to the library which will change
the "name" property of the document. The name will be changed to match the title field (I think I already know how to do this part).
Here is my problem...if I create an Event Receiver (ItemAdded), my code will not work cause the workflow needs to fire and complete its task before my code can grab the value from the title and copy it into the name. So my question is this....is there
a way in SP that i can maybe write custom code to address the entire scenario? If so, how do I do this? I read somewhere that I cannot or should not combine a workflow and an Event Receiver...I really appreciate it if I can be pointed in the right direction.

I think you can use ItemAdding event to update your fields. This works better for you instead of ItemAdded event.
Bala

Similar Messages

  • How do I perform an action on return key press in an inputListOfValues?

    I know about the autoSubmit attribute, but I do not want to perform an action on a tab character or when exiting focus. Instead, I want to perform the same action as pressing a button when the user presses the return key in the input field. For example, an inputListOfValues for a search input, and a search button. When the user presses the return key, I would like the search to be performed. I'm sure that this can be done, I'm just not sure how. Thanks for any info.

    I did something similar, on an input box, not on an inputListOfValues, but I assume it should work the same way more or less. I got it from
    http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/af_event.htm#DAFBJGAH
    I used it for my login page so the user doesn't have to click on Login, just press enter after entering the password. I just had to map the corresponding method binding.
    BTW, the link above doesn't tell you have to add the javascript to the page. What I did was add an af:resource element inside of af:document.
    Hope this helps.

  • How to force a new document to check in using an event receiver

    Hello,
    I need someone to guide me how to achieve using an event receiver or any other method how to force a document to check in. I have some users that forget to check in their documents. I have a workflow that runs every time a new document is uploaded and check
    in to run an approval process. Hope anyone can help me with this.
    Best Regards,
    Fer

    You can check-in document in the ItemAdded event
    Example:
    namespace MultipleFileUpload.MultipleItemsAdded
    /// <summary>
    /// List Item Events
    /// </summary>
    public class MultipleItemsAdded : SPItemEventReceiver
    /// <summary>
    /// An item was added.
    /// </summary>
    private Guid siteID;
    private SPFile file;
    public override void ItemAdded(SPItemEventProperties properties)
    siteID = properties.SiteId;
    file = properties.ListItem.File;
    using (SPSite site = new SPSite(siteID))
    using (SPWeb web = site.OpenWeb())
    base.ItemAdding(properties);
    SPListItem oItem = properties.ListItem;
    oItem["Title"] = "Please add a title.";
    oItem["Description"] = "Please add a description.";
    oItem.Update();
    if (file.CheckOutType != SPFile.SPCheckOutType.None)
    file.CheckIn("Automatic Check In");
    [custom.development]

  • How do I perform an action just before someone saves a data block?

    Hi,
    I need a trigger to attach to a datablock to perform some processing before the record is saved. I can't find anything suitable - I can see WHEN-VALIDATE-RECORD but this can run without you saving can't it? The code must only be executed when the user saves.
    Can anyone help?
    (Forms 6i)
    Thanks Adam

    Whatever you do, DO NOT use a KEY-COMMIT trigger !
    There are many ways a commit can be performed without firing that trigger.
    There is also POST-FORMS-COMMIT, which despite its name, fires before commit, ie if form_trigger failure is raised in it, then the commit does not happen.

  • How to send an email notification if no document in a library has been touched in 6 months

    The customer wants to receive an email notification if not a single document inside a document library has been not updated in 6 months. They don't want to get notifications based on single documents. They care only about the document library
    as a whole. I know you can use the list settings to send notifications or start workflows if a single document but how would you do this on an entire library?
    Get it?
    Is it possible?

    You could run something like this in powershell to check the last modified date and send an email if nothing has been modified in the previous 6 months.
    if (!(Get-PSSnapin Microsoft.sharepoint.powershell -ErrorAction SilentlyContinue))
    { Add-PSSnapin Microsoft.Sharepoint.powershell }
    $web = <website>
    $list = <document library>
    $items = ((get-spweb $web).lists[$list]).items | where {$_['Modified'] -gt (get-date).AddMonths(-6)}
    $folders = ((get-spweb $web).lists[$list]).folders | where {$_['Modified'] -gt (get-date).AddMonths(-6)}
    if (($items.count -eq 0) -and ($folders.count -eq 0)) {
    Send-MailMessage -SmtpServer 'smtpserver' -from '[email protected]' -to '[email protected]' `
    -Subject 'List items not modified in previous 6 months' -BodyAsHtml `
    -Body "List $($list) has not had any files updated in previous 6 months"

  • How to use's mail's "perform mail action with message"

    I can't for the life of me figure out how to use "perform mail action with message", I basically want to create a script that get's used on a rule from Mail, but nothing I try will work.
    This is what I started with...
    tell application "Mail"
    perform mail action with message msgs for rule theRule
    end
    end
    This doesn't compile i've seen an example of it being used like this...
    using terms from application "Mail"
    perform mail action with message msgs for rule theRule
    end perform
    end using
    this also doesn't compile, so I'm not sure what it's wanting

    This is one of those annoying things about programming - you have to arrange and spell things exactly right (this gets worse if you have fat fingers). You can look at the dictionary for Mail to see the specifics - in your example you are missing an "s" at the end of the word "message":
    <pre title="this text can be pasted into the Script Editor" style="font-family: Monaco, 'Courier New', Courier, monospace; font-size: 10px; padding: 5px; width: 720px; color: #000000; background-color: #E0E0E0; overflow: auto">tell application "Mail"
    perform mail action with messages msgs for rule theRule
    end tell
    </pre>

  • How to "Performing an Action on Multiple Selected Records" using Struts-JSP

    Hi all:
    How to do "Performing an Action on Multiple Selected Records" through using Struts/JSP solution that is original MVC/UIX customizing example by Jheadstart.
    I know how to reason by analogy through tutorial guide on
    Model and Control layer of MVC , but for View layer that is torment to me !
    have any idea ?
    thanks a lot .

    Ting Rung,
    In the table in the JSP page you add a checkbox like this:
    <td class="fixed">
    <input type="checkbox" name="multiselect" value="<%=index%>"/>
    </td>
    This will render a checkbox in each row, with index number of that row as value.
    When you submit the page the request contains the multiselect parameter when at least one row has the checkbox checked.
    You can get the value of the multiselect parameter by calling sessionData.getRequestParameterValues("multiselect") in your action. The value is a string array containing the index numbers of the rows that have the checkboc checked.
    Steven Davelaar,
    JHeadstart Team.

  • In sqlserver 2005 there short cut ctrl+N, how can i perform same thing in sqlserver 2008 r2

    In sqlserver 2005 there was short cut ctrl+N, how can i perform same action in sqlserver 2008 r2

    In sqlserver 2005 there short cut ctrl+N, how can i perform same action in sqlserver 2008 r2
    ctrl+N still available in SQL Server 2008 R2, please refer below article for list of shortcut keys.
    http://technet.microsoft.com/en-us/library/ms174205.aspx
    Also refer below article for how to customize shortcut keys.
    http://technet.microsoft.com/en-us/library/ms174178(v=sql.105).aspx
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page

  • How can i transfer my photos from my documents to the iTunes library (...and then to iPad2)?

    how can i transfer my photos from my documents to iTunes library and ,later,
    from there to the iPad?

    See Here
    How to transfer or sync content to your computer
    From Here
    http://www.apple.com/support/iphone/syncing/

  • When using the measure tool the imputed scale resets to 1to1 as soon as you perform another action. How do you get the scale to lock?

    When using the measure tool the imputed scale resets to 1to1 as soon as you perform another action. How do you get the scale to lock?

    Hi there - I think I am having problems associated withg Cause 9 in that in google mail I have another pop email address associated so that I can send using this email address, but then I have both addresses setup seperately in BIS. When I receive a mail from GMAIL I receive a duplicate with "received by: unknown" in the header. I had gmail setup so that it would send using by pop email address as default.
    In your answer the settings for the two filters you recommend creating are broken links and I canot actually see them. What are they?
    Also What do you recommend setup wise with gmail and a pop account. Some people say it is better to get gmail to receive the pop mail account and run the whole account from there. Blackberry doesn't seem to like this setup very much. Should I completely dissociate the pop account and to try and clarify the distinction between the two? Or should I setup a second gmail account and have that poll my pop account and then have the blackberry feed off these two gmail accounts? The reason I am considering this option is gmail provides a lot of storage and online continuity and this would effectively persist my account.
    Your help would be much appreciated.. I have had blackberry woes now for over a month and I have spent hours with various support personel, tried deleteing and sending down new service books etc etc but had no luck yet.
    thanks,
    Nathan 

  • Getting this error while opening a folder : This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel

    Hi,
    While trying to open a folder on my Windows 7 Home Premium, an error comes "This file does not have a program associated with it for performing this
    action.  Please install a program or, if one is already installed, create an association in the Default Programs control panel." I tried searching on the net but did not get great support for the issue when it happens with folder opening.

    Hi Nikunj Shah,
    First, I suggest you download
    Microsoft Safety Scanner or
    Malicious Software Removal Tool to run a full scan.
    The error messages here seems to be caused by the corrupted registries, which related with the folder association.
    You may take a try to merge the following registry settings to reset the folder association, before that, remember to backup your registry settings first:
    How to back up and restore the registry in Windows
    Copy and paste the following commands into Notepad, and save it to a .reg file:
    =================
    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\Folder]
    "ContentViewModeLayoutPatternForBrowse"="delta"
    "ContentViewModeForBrowse"="prop:~System.ItemNameDisplay;~System.LayoutPattern.PlaceHolder;~System.LayoutPattern.PlaceHolder;~System.LayoutPattern.PlaceHolder;System.DateModified"
    "ContentViewModeLayoutPatternForSearch"="alpha"
    "ContentViewModeForSearch"="prop:~System.ItemNameDisplay;System.DateModified;~System.ItemFolderPathDisplay"
    @="Folder"
    "EditFlags"=hex:d2,03,00,00
    "FullDetails"="prop:System.PropGroup.Description;System.ItemNameDisplay;System.ItemTypeText;System.Size"
    "NoRecentDocs"=""
    "ThumbnailCutoff"=dword:00000000
    "TileInfo"="prop:System.Title;System.ItemTypeText"
    [HKEY_CLASSES_ROOT\Folder\DefaultIcon]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
      65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,00,00
    [HKEY_CLASSES_ROOT\Folder\shell\explore]
    "MultiSelectModel"="Document"
    "ProgrammaticAccessOnly"=""
    "LaunchExplorerFlags"=dword:00000018
    [HKEY_CLASSES_ROOT\Folder\shell\explore\command]
    "DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"
    [HKEY_CLASSES_ROOT\Folder\shell\open]
    "MultiSelectModel"="Document"
    [HKEY_CLASSES_ROOT\Folder\shell\open\command]
    "DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,78,00,\
      65,00,00,00
    [HKEY_CLASSES_ROOT\Folder\shell\opennewprocess]
    "MUIVerb"="@shell32.dll,-8518"
    "MultiSelectModel"="Document"
    "Extended"=""
    "LaunchExplorerFlags"=dword:00000003
    "ExplorerHost"="{ceff45ee-c862-41de-aee2-a022c81eda92}"
    [HKEY_CLASSES_ROOT\Folder\shell\opennewprocess\command]
    "DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"
    [HKEY_CLASSES_ROOT\Folder\shell\opennewwindow]
    "MUIVerb"="@shell32.dll,-8517"
    "MultiSelectModel"="Document"
    "OnlyInBrowserWindow"=""
    "LaunchExplorerFlags"=dword:00000001
    [HKEY_CLASSES_ROOT\Folder\shell\opennewwindow\command]
    "DelegateExecute"="{11dbb47c-a525-400b-9e80-a54615a090c0}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\BriefcaseMenu]
    @="{85BBD920-42A0-1069-A2E4-08002B30309D}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Library Location]
    @="{3dad6c5d-2167-4cae-9914-f99e41c12cfa}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\ContextMenuHandlers\Offline Files]
    @="{474C98EE-CF3D-41f5-80E3-4AAB0AB04301}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\DragDropHandlers\{BD472F60-27FA-11cf-B8B4-444553540000}]
    @=""
    [HKEY_CLASSES_ROOT\Folder\ShellEx\PropertySheetHandlers\BriefcasePage]
    @="{85BBD920-42A0-1069-A2E4-08002B30309D}"
    [HKEY_CLASSES_ROOT\Folder\ShellEx\PropertySheetHandlers\Offline Files]
    @="{7EFA68C6-086B-43e1-A2D2-55A113531240}"
    [-HKEY_CLASSES_ROOT\Folder\ShellNew]
    [HKEY_CLASSES_ROOT\Folder\ShellNew]
    "Directory"=""
    "IconPath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
      74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,\
      00,68,00,65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,\
      00,00
    "ItemName"="@shell32.dll,-30396"
    "MenuText"="@shell32.dll,-30317"
    "NonLFNFileSpec"="@shell32.dll,-30319"
    [HKEY_CLASSES_ROOT\Folder\ShellNew\Config]
    "AllDrives"=""
    "IsFolder"=""
    "NoExtension"=""
    ==================
    Once done, right-click the REG file and choose Merge. Alternately, you can open the Registry Editor and then using the
    Import option from the File menu, to merge the REG file contents.
    Let me know if you need any further help.
    Best regards
    Michael Shao
    TechNet Community Support

  • How do I perform a "Suite Product Activation" so that Acrobat will start working on my new Retina MacBook Pro?

    How do I perform a "Suite Product Activation" so that Acrobat will start working on my new Retina MacBook Pro?
    Like others, I have recently upgraded my MacBook Pro to the next generation and migrated all my information from old to new. Everything works seamlessly EXCEPT Acrobat. Photoshop, Indesign, Bridge and Lightroom all seem functional. Acrobat hangs with an error message "Suite Product Activation Needed. Acrobat was installed as part of a suite. To enable Acrobat, please start another element of the suite (such as Photoshop)." Needless to say, starting another element of the suite has NO impact on Acrobat.
    This has to be a common problem. Now that Apple has made it really easy to migrate information from old to new machines, it has to come up all the time. What surprises me greatly is that I can't find any coherent answer in these forums.
    So how do I get Acrobat running again?

    Hi Anubha,
    I do not understand what you said below.
    I am running Adobe Acrobat Pro Version 9.5.5. I do not remember whether it came with Photoshop or InDesign.
    When I open Photoshop, it opens without my having to follow any instructions to activate the software. As a matter of fact, I cannot find my Photoshop serial number anywhere in the Photoshop program itself. I do know it from my profile at Adobe.com. Are you suggesting I deactivate Photoshop on the new computer and then reactivate it using my serial number? Will it reactivate?
    When you say
    "/Library/Application Support/Adobe" at the root level of the startup disk (not the Library folder inside a user's Home folder)
    what do you mean? I do not have a startup disk. I have the original installation disk but that version of Photoshop has been updated a few times.
    After staring at your instructions for a while, I realized that you might be talking about the Library/Application Support folders resident on my Macintosh HD, although why you called it a startup disk is unclear to me. IAC, I went into those folders and duly moved the three folders into a new folder I called “Acrob1” and restarted Adobe Acrobat 9 and got the following error message: “AMT Subsystem Failure  The licensing subsystem has failed catastrophically. You must reinstall of call customer support.” with a small (6).
    By undoing my actions I am back to the staus quo ante.
    Now what?
    Regards, Robert

  • Root cause of error " Access denied. You do not have permission to perform this action or access this resource" - workflow - SharePoint 2013

    Good evening, technet community
    I hope you are doing well.
    When configuring my SharePoint workflow, I encounter the problem below:
    Problem Description:
    Let's say my domain is: test.com, my group user is: test\group , my user is: test\user1
    Except an admin account with full control at both "Web Application" and "Site Collection", all others account all have problem when creating a list item. After creating a list item, the workflow status is "cancelled" immediately
    with the following message:
    RequestorId: 262a35e4-99f4-40f0-929b-5d04b415f147. Details: System.ApplicationException: HTTP 401 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["10"],"SPRequestGuid":["262a35e4-99f4-40f0-929b-5d04b415f147"],"request-id":["262a35e4-99f4-40f0-929b-5d04b415f147"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1;
    RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Thu, 06 Nov 2014 12:14:28 GMT"],"Server":["Microsoft-IIS\/7.5"],"WWW-Authenticate":["NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]}
    {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform
    this action or access this resource."}}} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor,
    BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
    - The workflow is still fail even I assign "full control" to my users group "test\group" – at Site Collection level.
    Surprisingly, I have successfully found a solution for this error message. However, I still have some points that I do not clearly understand. Let's start with my solution first.
    Solution:
    *** i. Assign permission policy at Web Application level – Central Admin site ***
    1. Central Administration ==> Application management
    ==> Manage Web application 
    2. Go to "permission policy", then create a new permission level. This permission level contains all "edit item" permission.
    3. Select "user policy", then I assign it directly to my user account: test\user1.
    *** ii. Assign "edit item" permission at Site Collection level ***
    1. Site Setting ==> Site permission
    2. Assign "Edit" permission to my test\group.
    (Actually I removed all permissions of my user group at Site Collection level. It seem my group has inherited permission from Web Application level, is that correct? )
    *** iii. Create a new list item and workflow runs ……. ***
    ==> My question is:
    1. Why I cannot assign permission to my users group - "test\group" -
     at "Web Application" level? Instead I have to assign permission policy for each users, one by one?
    2. Could you please let me know how to collect full detail error message of workflow status?
    Thank you very much! Have a nice weekend.

    Thank you for your very detail response.
    Point 1: Yes my 2 service: user profile & profile sync service are running. I performed "full synchronization" as well. Actually i've tried 3 another action plans before coming up with the solution i posted:
    *** Actions completed ***
    1. Activate the feature: workflow can use app permissions.
    Site actions > Site Settings > Site features >activate the feature below:
     Workflows can use app permissions
    2.
    Refresh trusted security token services metadata feed
    Get-SPTimerJob
    "RefreshMetadataFeed"
    | Start-SPTimerJob
    - then restart the machine.
    3. Start full user profile synchronization.
    Point 2:
    - Yes my user had Edit permission at workflow task list + list affected by workflow.
    I have just remove all permissions of my user at "Site Collection" level. However, when i show my user permissions at my workflow task list and my users still have "Edit" Permission ( assigned at Web Application level. These permissions
    still exist even after my workflow task list stop inheriting permission).
    ==> the problems probably belongs to "permission" at "Site Collection level". It seems "permission level at my Site Collection does not work". All users accounts are also suffer from the same issues except farm admin account
    ( which has full control at Web Application level).
    I would appreciate if your guys can guide me how to make "permission" at my "Site Collection level" work again?
    Thank you very much.

  • How to define a Custom Action in VC 6.0 ?

    Hi all
    I want to know how to define a custom action like for a check box UI Element, I want particular action to be performed when it is checked ? How can I achieve this in VC 6.0
    Please feel free to ask me if my question is unclear ?
    Regards
    Kapil

    Hi,
    Try adding an expression element on your form.
    Go to the Expression control properties and in the Expression attribute enter
    IF(@Selected==true,"X"," ")
    @Selected is the checkbox. For your function call input use the expression element and not the checkbox.
    Hope this helps. Let me know if it works.
    Thanks.

  • Can not access CRM from outside the office network - Access denied You do not have sufficient access rights or privileges to perform this action.

    Hi,
    I can not access CRM from outside the office network - Access denied You do not have sufficient access rights or privileges to perform this action.  I can access CRM with same user id and password from our office inside the network.  I can get
    the page to give login details once I have login details I got below error. Please help me to solve this issue.  It was working before.
    Access denied You do not have sufficient access rights or privileges to perform this action. 
    Regards,
    Noushad
    [email protected]

    On Premise system Configured with AD FS server for claims-based authentication you need to update your host file with server url to access it from outside office network.
    Refer
    this on how to update host file.
    Regards, Saad

Maybe you are looking for