What fired off this workflow? User? Item added? or Item changed?

As a workflow can be set to trigger when a new document is Added to the library, when an existing document is changed OR by a manual start by a user ( OR any combination of the above ).....
Can you test programmatically to find out what the trigger was for the workflow in a c# coded workflow? 

As you will no doubt be aware, when a document is added to a library that has additional columns needing to be filled in, the Item added workflow starts as soon as the user clicks OK after browsing for the document and then the Item Updated workflow fires
AFTER they have completed the dialog for the metadata. 
We have to simply capture certain information ONLY the first time the document is added, not on further changes.
If only the ItemAdded fired AFTER you had finished adding ALL the content!

Similar Messages

  • Event firing at item added and item updated in event receiver?

    Hi All,
    I have created event receiver on item added & item updated on document library.
    1) On Item Added i am updating document library Title column with document Name and i have metadata for the file.
    2) On Item Updated i am move that file with metadata to another document library.
    Now the issue is the event is triggering is twice when an item is added it automatically calls the item updated event
    Need to help please...
    Thanks
    Balaji More

    Hi Thanks for reply.
    I have also write Workflow on Source doc library for document approval.
    In Source doc library i have choice column fields[Status]. Pending,Approved Default is Pending
    when approvers approve the task then i want to update Status: pending to Approved in source doc library using workflow it worked but that time i also want to update destination doc library Status column using Item updated Event receiver but not successed.
    Following is code on Item Added.
    try
    using (SPWeb oWeb = properties.OpenWeb())
    oWeb.AllowUnsafeUpdates = true;
    string UpdateStatus= string.Empty;
    UpdateStatus= properties.ListItem["Status"].ToString();
    SPFile File = properties.ListItem.File;
    SPDocumentLibrary destLib = (SPDocumentLibrary)properties.ListItem.Web.Lists["documents"];
    SPFolder mylibrary = oWeb.GetFolder("Temp");
    SPFile spfile = mylibrary.Files.Add(File, streamWriter, true);
    SPFile newfile = spfile;
    SPListItem item = file.Item;
    item["Status"] = UpdateStatus;
    item.Update();
    oWeb.AllowUnsafeUpdates = true;
    Catch()
    Item Updated when workflow is approved status is changed Pending to Approved
    then i have write a following code but status is not updated when workflow is completed
    try
    using (SPWeb oWeb = properties.OpenWeb())
    oWeb.AllowUnsafeUpdates = true;
    string UpdateStatus= string.Empty;
    SPFile File = properties.ListItem.File;
    if (properties.ListItem["Status"] != null)
    UpdateStatus = properties.ListItem["Status"].ToString();
    SPDocumentLibrary destLib = (SPDocumentLibrary)properties.ListItem.Web.Lists["documents"];
    SPFolder mylibrary = oWeb.GetFolder("Temp");
    SPFile spfile = mylibrary.Files.Add(File, streamWriter, true);
    SPFile newfile = spfile;
    SPListItem item = file.Item;
    item["Status"] = UpdateStatus;
    item.Update();
    oWeb.AllowUnsafeUpdates = true;
    Catch()
    Thanks
    Balaji More

  • In what part of this workflow will Mac Pro actully save us a lot of time?

    Although the nMP is really tempting, I'm starting to get second thoughts in terms of how much time it will actually save us......
    In our studio, we do a daily, 30 min. 3 camera technews show in 1080p for YouTube.
    Until now, we've been using a 2010 MacPro 8 core 2.4ghz and a MacBook Pro i7 2013.
    In our workflow, we record the show in less than an hour. Importing/transcoding is roughly 30 minutes. Multicam editing takes 2-3 hours in Final Cut Pro X. Exporting / encoding takes around 30 minutes. Upload it yet again around 30 minutes.
    While waiting for the 6 core nMP D500 we ordered in January, the numbers I see, are starting to worry me.
    It seems that the real difference in day-to-day work on the nMP is considerably less that we expected. It's hard to put numbers on expectations, but we were assuming that the nMP with dual GPU would be more than twice as fast as our existing exporting on the old MP and MbP.
    The numbers we see in speed tests seems to be all like a few seconds faster here and there likewww.barefeats.com/tube05.html shows us. For us, it doesn't mean much if an export takes 2-4 minutes more or less - it takes longer to go for the toilet or a cup of coffee anyway.
    To me it seems that the parts of our workflow, where we can shave of time, is transcoding and encoding. The editing takes the time it takes anyway.
    So I'm getting a bit nervous that the investment is not worth it compared to the machines we already have.
    I'd really like to hear from you guys that actually tried the nMP - is it all about 14 seconds faster here end 57 seconds faster there or am I missing / misinterpreting the numbers in stuff like Barefeat.com ?
    Note: it almost seems to me that faster storage (like a Pegasus) for our existing tools, would give us the same speed boost as the nMP in itself???
    Note 2: it almost seems that putting a 7970 gpu (or two) in our MacPro tower instead of the Quadro 4000 we use now, will give the same speedbump as the nMP in itself???

    I have the new Mac Pro black cylinder (fully maxxed out) wiht a Pegasus2 R6 array atached ot it via the thunderbolt 2 port.  I also have an early 2008 Mac Pro 8-core machine that until recently I used for video editing in both FCP X and Adobe Premeire Pro CC as well as a high end mid-2012 Macbook Pro with Retina Display..  On the 2008 Mac Pro I used a two disk array in raid 0 for high speed access to video files.  My 2008 Mac Pro was outfitted a couple of years ago with an nVidia GTX285 graphics card and the old system is in good shape and is still being used for some tasks. On the 2012 Macbook Pro with Retina Display I have a six TB raid 0 array. 
    My experience with the new Mac Pro has been that for any software that makes good use of multiple cores and the powerful Open CL architecture of the AMD W700 graphics cards in the new Mac Pro, this machine is much much faster than my older Mac Pro  A thorough review of the New Mac Pro with many benchmarks in the latest issue of Mac World bears this out with specific numbers comparing the new Mac Pro to the latest Macbook Pro with Retina Display and the latest high end iMac.  In every case the new Mac Pro was significantly faster than those machines for multiple core or graphics intensive tasks.  I have no regrets about purchasing the new Mac Pro and in fact, I love it!
    However, the new Mac Pro is designed to excel at specific tasks, e.g., 4K video editing, 3D modeling and animation, editing very large photo files, and motion graphics such as Motion 5.  To fully realize the speed of the new Mac Pro it must be paired with a suitable high speed raid array.  If you do those kinds of activities and if you have the resources to purchase a high speed disk array like the Pegasus2, then you will see that the new Mac Pro is in a league of its own.
    Tom

  • How do I do this?: users are not able to change how the calendar interface looks, a central authority (admin or other) must be able to shedule events into the calendars of all users.

     

    First off my advice is not to use your Mac as an Administrator only provide Admin Password when your Mac requests and only when your "Child" is not in the room!!!
    It is all to do with Permissions:  Login as an Administrator click on Go in the menu bar, Select Computer, Select Macintosh HD, Select Users Select the User Folders you want to look at you will see a series of folders with red circles highlight each one in turn and Get Info unlock the Padlock in the Info pane then add Administrator to Read/Write
    After this I hope you and your Son stay friends for many years

  • Item added & item updated events fired twice.

    Hello everyone, 
    I have item added and item updated events and both sends e-mails twice cos they are fired twice. 
    I tried the below method but the problem still continues. Any suggessions?
    base.EventFiringEnabled=false;
    base.EventFiringEnabled=true;
    note: my list is custom list. (not document lib)

    If you have required checkout enabled the events can be triggered twice. See this post for more information and how to bypass it:
    Managing ItemUpdating and ItemUpdated Events Firing Twice in a SharePoint Item Event Receiver

  • Using Bapi_salesorder_change adding a item, deleting a  item,Quanty change

    I need help on Bapi_salesorder_change.
    I have a table control in which there will be data of a particular sales document no, items, quantity, sales unit. When user changes the quantity, or adds a line item or deletes a line item and the press the save button bapi_salesorder_change should trigger and should change the order as the user changes.
    Can u help how to write code for this three conditions
    1> adding line item.
    2> deleting a line item.
    3> changing the quantity.
    using bapi_salesorder_change
    Can i use the same bapi for three conditions?
    Please help me in this as soon as possible.
    I thank them in advance

    Hello Geeks,
              i am using this bapi  for updating my item quantity no....
              but the bapi return msg say tat its not changing....
              i think i may did some mistake pls anyone can rectify it....
              i hv attached my code below......
    *For line item
    TYPES :BEGIN OF y_t_vbap,
            vbeln TYPE vbeln_va,  "sales Document
            posnr TYPE posnr_va,  "Item no of SD document
            matnr TYPE matnr,     "Material No
            zmeng TYPE dzmeng ,   "Target qty in Sales unit
            spart TYPE spart,     "division
            message TYPE BAPI_MSG,
           kwmeng type kwmeng,   "cummulative order qty
           END OF y_t_vbap.
    TYPES : y_t_itemin TYPE bapisditm,
            y_t_return TYPE bapiret2,
            y_t_headerx TYPE bapisdh1x.
    TYPES: BEGIN OF y_t_logdata,
           lno             TYPE         lineno,         "Lineno
           field           TYPE         fieldname,      "Field Name
           value           TYPE         lmon_fvalue,    "Field Value
           message         TYPE         bapi_msg,       "Messages
           END OF y_t_logdata.
                     Internal table declaration
    DATA: "y_i_vbak      TYPE   STANDARD TABLE OF y_t_vbak,
          y_i_vbap      TYPE   STANDARD TABLE OF y_t_vbap,
          y_i_headerx   TYPE   STANDARD TABLE OF bapisdh1x,
          y_i_itemin    TYPE   STANDARD TABLE OF bapisditm ,
          y_i_iteminx   TYPE   STANDARD TABLE OF bapisditmx,
          y_i_return    TYPE   STANDARD TABLE OF y_t_return,
          y_i_logdata   TYPE   STANDARD TABLE OF y_t_logdata,
          y_i_bapiret   TYPE   STANDARD TABLE OF bapiret2.
                     Table type declaration
    TYPES: y_tt_vbap    TYPE   STANDARD TABLE OF y_t_vbap ,
           y_tt_logdata TYPE   STANDARD TABLE OF y_t_logdata.
                     Work Area declaration.
    DATA:   y_wa_vbap     TYPE   y_t_vbap,
          y_wa_itemin   TYPE   bapisditm ,
          y_wa_iteminx  TYPE   bapisditmx,
          y_wa_headerx  TYPE   bapisdh1x,
          y_wa_return   TYPE   y_t_return,
          y_wa_logdata  TYPE   y_t_logdata,
          y_wa_event    TYPE   slis_alv_event,
          y_wa_event1   TYPE   slis_t_event,
          y_wa_bapiret  TYPE   bapiret2.
                     Variables declaration.
    DATA: y_i_event     TYPE   slis_t_event,
          y_v_success   TYPE   i           , "For Success
          y_v_error     TYPE   i           , "For Error
          y_v_sno       TYPE   char30      ,
          y_v_eno       TYPE   char30      ,
          y_v_msg       TYPE   char100     . "error msg
                     Constants declaration.
    constants : y_k_x type char1 value 'X',
                    y_k_u type char1 value 'U',
                   y_k_e type char1 value 'E'.
                  SELECTION SCREEN LAYOUT
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 3(18) text-003.
    PARAMETERS   :    y_p_vbln TYPE vbak-vbeln OBLIGATORY.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN : END OF BLOCK b1.
                      START-OF-SELECTION.
    START-OF-SELECTION.
    WRITE: text-002.
                      END-OF-SELECTION.
    END-OF-SELECTION.
      SELECT  vbeln
              posnr
              matnr
              zmeng
              spart
              FROM vbap
                   INTO TABLE    y_i_vbap
                   WHERE vbeln = y_p_vbln.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        y_wa_vbap-zmeng = 2 + y_wa_vbap-zmeng.
        MODIFY y_i_vbap FROM y_wa_vbap INDEX sy-tabix.
      ENDLOOP.
      PERFORM y_f_update USING y_i_vbap.
    *&      Form  y_f_update
           POPULATE BAPI DATA AND RUN BAPI
    FORM y_f_update USING  y_p_vbap TYPE y_tt_vbap.
      CLEAR: y_i_headerx, y_i_itemin, y_i_iteminx,
             y_i_return, y_i_bapiret.
      REFRESH: y_i_itemin, y_i_iteminx, y_i_return, y_i_bapiret.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        MOVE y_wa_vbap-zmeng TO y_wa_itemin-target_qty.
        MOVE y_wa_vbap-posnr TO y_wa_itemin-itm_number.
        APPEND y_wa_itemin TO y_i_itemin.
      ENDLOOP.
    *Update the Bapi Itnernal tables
      y_wa_headerx-updateflag = y_k_u .
      APPEND y_wa_headerx TO y_i_headerx.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        y_wa_iteminx-itm_number = y_wa_vbap-posnr.
        y_wa_iteminx-target_qty = y_k_x .
        y_wa_iteminx-updateflag = y_k_u .
        APPEND y_wa_iteminx TO y_i_iteminx .
      ENDLOOP .
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = y_wa_vbap-vbeln
          order_header_inx = y_wa_headerx
        TABLES
          return           = y_i_return
          order_item_in    = y_i_itemin
          order_item_inx   = y_i_iteminx.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      CLEAR y_i_vbap.
    IF y_i_return is not initial.
      LOOP AT y_i_return INTO y_wa_return where TYPE = y_k_e .
        MOVE y_wa_return-message TO y_wa_vbap-message .
        Append  y_wa_vbap to y_i_vbap.
        y_v_success = y_v_success + 1.
      ENDLOOP.
    ENDIF.
      y_wa_event-name = 'TOP_OF_PAGE'.
      y_wa_event-form = 'Y_FD_TOP_OF_LIST'.
      APPEND y_wa_event TO y_i_event.
      CLEAR y_wa_event.
      CALL FUNCTION 'ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program         = sy-repid
          i_tabtypename1             = 'Y_T_VBAP'
          it_events1                 = y_i_event[]
        TABLES
          t_outtab1                  = y_i_vbap[]
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2
          OTHERS                     = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " y_f_vbap
    *&      Form  Y_FD_TOP_OF_LIST
    FORM y_fd_top_of_list.
      MOVE: y_v_success TO y_v_sno,
            y_v_error   TO y_v_eno.
      CONCATENATE text-002 y_v_sno '/' y_v_eno INTO y_v_msg SEPARATED BY
      space.
      CONDENSE y_v_msg.
      WRITE / y_v_msg .
      SKIP 1.
    ENDFORM.                    "Y_FD_TOP_OF_LIST

  • Problem with custom sharepoint designer approval workflow - check box: 'Start this workflow to approve publishing a major version of an item' is greyed out

    I wanted to create a simple approval workflow. Hence I opted to start from scratch rather than copy the OOTB approval WF. Using SharePoint Designer (not Visual studio) I created a reusable workflow and have added the built in 'Start approval process' action.
    It's saved and published globally.
    Everything works fine except that when associating the WF with a list the 'Start this workflow to approve publishing a major version of an item' check box is disabled.
    Major and minor versioning is enabled for the library.
    What am I missing here? Or do I have to start from the OOTB approval WF to get this to work?
    Regards
    Henning

    Again - new ideas pop up right after defining the issue as a problem. :-) Problem solved!
    I solved this by creating a new workflow from the original publishing approval workflow (copy and replace), but instead of tweaking the already defined approval process (WF action) I deleted it, then deleted all initiation form and local variables,
    and then added the 'Start approval process' action again. This re-installs all the necessary local variables without any initiation form involvement, which is just what I want.
    From here I can tweak the workflow to make it more user friendly, much like
    described by Bobby Chiang in his great blog.
    Remember to add action Set Workflow Variable 'EnableContentApproval' to Yes right before the Start Approval Process action, else the document's status won't be set to 'Approved' or 'Rejected' as an output of the workflow.
    Learning every day!
    Henning

  • Exchange Connector adds Workflow user as related Item to Review Activity

    We use Servcie Manager 2012 R2 with Exchange Connector 2.0
    For some reason, the Exchange Connector adds the workflow user to the review activity as a related config item. The sender of the email would make sence, but the workflow user does not.
    Does the Exchange Connector 3.0 Rerelease also add the workflow user?
    Is there a possibility to avoid this behavior?
    tia
    Patrick Wahlmüller

    Hi Patrik !
    Never saw that before, what i can say is that the upgrade/change to Exchange COnnector 3.0 is easy low-risk and you add MS-Support possibilities for it.
    Go for 3.0 !
    R.

  • Hi I do not want iTunes to open up automatically when I turn on my macbook pro.  I tried going to System Preferences Users and Groups Login Items and then I took iTunes off the list but it still opens up automatically when I turn on my laptop.

    Hi I do not want iTunes to open up automatically when I turn on my macbook pro.  I tried going to System Preferences>Users and Groups>Login Items and then I took iTunes off the list but it still opens up automatically when I turn on my laptop. What should I do?

    Hi r,
    Make sure you close iTunes before shutdown.  And you're quite welcome.

  • "Start this workflow to approve publishing a major version of an item" in Project Site templates

    Hi
    I created a document library with the "Start this workflow to approve publishing a major version of an item" on, and saved the site as a template. However when I create instances using that project site template, the document library doesn't
    have the "Start this workflow to approve publishing a major version of an item" option on, like the site that was used for the template have.
    Is this option not possible to save on a project site template?
    Here are the steps I did:
    On a document library I set the versioning for major and minor version
    I create an “Publishing approval” workflow and set it to “Start this workflow to approve publishing on a major version”.
    But when I create a project instance of this type, the document library on the project site has the “Start this workflow to approve publishing on a major version” turned off.
    Thanks!
    Best regards

    Hi,
    I recommend to create a  WebProvisioned event receiver.
    We need to create an event handler and register it with the Web Provisioned event. In the event, we need to find the specific Library and set SPList.DefaultContentApprovalWorkflowId property.
    When the site is provisioned, the event handler is activated. Then the "Start this workflow to approve publishing a major version of an item" option will be checked.
    More information:
    SPWebEventReceiver.WebProvisioned method (Microsoft.SharePoint)
    SPList.DefaultContentApprovalWorkflowId property (Microsoft.SharePoint)
    Attaching Web Event to perform operations after creating the web (Event Receiver Concept)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • I have a Mac Pro OS 10.7.5 and have a DVD+R disc with files on it, but it ejects the disk after about 10 seconds--what to do?  How can I get the data off this disc?  I can see it has been already burned, so files are on there?

    I have a Mac Pro OS 10.7.5 and have a DVD+R disc with files on it, but it ejects the disk after about 10 seconds--what to do?  How can I get the data off this disc?  I can see it has been already burned, so files are on there?

    Try cleaning the lens and see if that will restore functionality to the DVD drive.  Use a DVD lens cleaning disk, if you have a can of compressed air, shoot some into the slot or wrap a fine microfiber cloth (eyeglasses cleaning cloth)  around a business card and insert it gently inside the slot.
    If no success, make an appointment at an Apple store genius bar and get a free diagnosis from them.
    Ciao.

  • I try to sync my nano and get:  the ipod cant be synced because there is not enough free space to hold all of the items in the items library (need 100MB) - I have a new computer?? can you help me understand this message: what to do?

    I try to sync my nano and get:  the ipod cant be synced because there is not enough free space to hold all of the items in the items library (need 100MB) - I have a new computer?? can you help me understand this message: what to do?

    Hello pryan1012,
    What this message means is that you have more music in your itunes library than there is free space in your ipod.
    I had this same issue at one time. This is what helped me put my music on the ipod. I used manually manage.
    Learn how to sync muisc here.
    Hope this helps.
    ~Julian

  • Start this workflow to approve publishing a major version of an item is disabled in SharePoint Online

    Hi there,
    Despite turning on the require content approval for submitted items in the version setting.  Start this workflow to approve publishing a major version of an item is still disabled in the workflow settings.
    Anyone one know how to enable this option.
    Thanks
    Regards,
    Ravi

    Hi Wendy,
    I tried to copy and modify the Globally Reusable Workflow->Approval-SharePoint 2010 but the problem
    that I am facing is, I cant seems to find the Assign a task in the Actions list and also when I am setting the approver variable to a value, I am missing a column name( how can I get a column which is used in a list?).
    But “Start this workflow to approve publishing a major version” is enabled now using this workflow
    but saying that I am unable to complete the workflow due to the action and column missing. 
    Previously the work flow that I created was for a specific list.
    Is there any work around to this issue?
    Thanks
    Regards,
    Ravi

  • Hi im new apple user ..Bought a mac 3 weeks before my mac does not show serial number on screen .Also I am unable to sign in imessage n facetime it gives network error like .! What can be this issue n how to solve it??

    hi im new apple  ,ac book pro user ..Bought a mac 3 weeks before my mac does not show serial number on screen .Also I am unable to sign in imessage n facetime it gives network error like though i can access web site n etc  .! What can be this issue n how to solve it??

    Hi,
    If the machine is brand new I don't see why the serial Number is missing (it is entered on to a special chip at the factory)
    However if the machine is a return and has been refurbished then the Logic/mother board may have been changed and someone forgot to put the info back to the new board.
    for the   Points
    7:44 pm      Thursday; January 16, 2014
      iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • I get this message:This computer's local hostname "x-8.local" is already in use on this network. The name has been changed to "x-9.local" I have turned off sharing and it continues to upgrade name. What is the fix?

    I get this message: This computer’s local hostname “x-8.local” is already in use on this network. The name has been changed to “x-9.local” I have turned off sharing and it continues to upgrade name. What is the fix?

    Hi, this is a common problem, mostly just irksome though.
    It can have many cause, like using more than one Interface for connections, Router temporarily losing x.local & seeing a new connection with x.local already used, insists it must be x-1.local, x-2.local, etc..
    What all Sharing do you have enabled?
    Some possible fixes...
    http://forums.macrumors.com/showthread.php?t=542899
    https://discussions.apple.com/thread/3941367

Maybe you are looking for