Get ListItemID from which workflow task was started

In SharePoint 2013 in event receiver (item added) I need to get List item id from which was task started...I have custom list when I add new list item the workflow starts and create new task in task list...After new item is created in task list I need
to get ID(List item id of item which start the workflow) in event receiver of Task list... Hmm...In sharepoint 2010 this work
SPListItem currentTask = properties.ListItem;
Guid sourceListID = new Guid(currentTask["WorkflowListId"].ToString());
SPList sourceList = properties.Web.Lists.GetList(sourceListID, true);
int sourceListItemID = Convert.ToInt32(currentTask["WorkflowItemId"]);
SPListItem sourceListItem = sourceList.GetItemById(sourceListItemID);
but in sharepoint 2013 not...Thank you

hi
try this
SPListItem currentListItem = properties.ListItem;
 if(currentListItem != null)
  object associatedWfListId = currentListItem["ows_WorkflowListId"];
  object associatedWfItemId = currentListItem["ows_WorkflowItemId"];
  if (associatedWfItemId != null && associatedWfListId != null)
    SPListItem item = web.Lists.GetList(new Guid(associatedWfListId.ToString()), false).GetItemById(int.Parse(associatedWfItemId.ToString()));
    // THE ABOVE ITEM IS THE ASSOCIATED LIST ITEM
https://blogs.blackmarble.co.uk/blogs/jmann/post/2008/03/10/get-the-item-a-workflow-task-is-associated-with.aspx
Regards,
Rajendra Singh
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
http://sharepointundefind.wordpress.com/

Similar Messages

  • I have had my iphoto crash twice whilst nearing the end of making a photo book. Are these books lost and do I have to start again? ):  I cant find the folder in iphoto on the time capsule. Folder from which the book was being made is now empty? help pleas

    I have had my iphoto crash twice whilst nearing the end of making a photo book. Are these books lost and do I have to start again? ):  I cant find the folder in iphoto on the time capsule. Folder from which the book was being made is now empty? help please Using IMAC OSx

    Hi shldr2thewheel,
         it has been a while since we have last spoke, I would like to let you know, I am still working on getting used to the switch from windows to a Mac/Apple system. I do have a new question for you, I did purchase In Design CS5.5 through journeyed.com through Cuyahoga Community College of which I attend as a student, is there a way to purchase an online book through iTunes to learn that as well? Also, you know me, the struggling student, I would also, when and if the book can be purchased through the iTunes, would need to know if you do know of a much easier book for struggling students like myself and at a reasonable price as well for the In Design CS5.5 program. Our campus bookstore had closed early, and, so did the colleges library and our local library here where I do live, so, I cannot go to either place to purchase a book or to take out a book, plus cash funds are low at this moment as well but, I do have money left on the iTunes account to use, if it can be used. So, can it be used, the iTunes money, towards finding a low priced online book? I am in great need of assistance as I have a project due for my one course for this Tuesday, September 4, 2012.
    Sincerely in need of help once again,
    Kim

  • Call enhancement class method from Bus. workflow task

    Hi all,
    I recently enhanced a global class from SAP (add a new method). Now I would like to call it from a workflow task (ABAP Class object used in the task). So it seems that only "native" methods from the class itself can be selected for the object method of the task.
    Same issue if I try to call it via secondary methods options...
    Last idea I have before the repair is: retrieve the instance saved into the WF container via a custom class interfacing IF_IFS_SWF_CONTAINER_EXIT (program exit) and call the enhanced method from the method proposed in this interface.
    Maybe someone had the same issue? Anyone could help or propose solution?
    Many thanks in advance for your help,
    KR,
    Olivier

    I think it might qualify for an OSS message.
    There was simmilar note for BADIs which was corrected: https://service.sap.com/sap/support/notes/1156392
    CL_SWF_UTL_DEF_SERVICES which is used in PFTC to determine callable methods doesn't include enhancements when calling  function SEO_CLASS_TYPEINFO_GET (parameter WITH_ENHANCEMENTS is default FALSE)

  • I cannot get mail from my sister who was hacked

    I cannot get mail from my sister who was hacked

    If your sister's e-mail account was used to send large quantities of spam, and it has been blocked somewhere as a spammer - which may or may not be what happened - it may be difficult to tell where.  As I said, any e-mail server between you and your sister could be blocking her messages.  A reasonable place to start would be to check with your own e-mail provider and see if their servers are blocking her e-mail.  If that is not the problem, she will need to talk to her own e-mail provider about the problem, and they should be able to assist her.  Alternately, she could switch to a new e-mail address, which might not be a bad idea, since the after-effects of getting hacked and having her account sending out spam could linger for years.

  • How to get component from which PropertyChange is activated

    I have a PropertyChangeListener on JInternalFrames. The frames are added using same method. I need to know from which component (frame) the 'close'-property is changed. I cannot figure out how to get it.
    When a propertychange is fired, how do i know from which componen (frame) it is fired?
    Common method to create frames is as follows:
             private void createPanel(JInternalFrame myFrame) {
            myDeskTop.add(myFrame);
                myFrame.pack();
            myFrame.setClosable(true);
                try {
                    myFrame.setMaximum(true);
                } catch (PropertyVetoException e){}
            myFrame.addPropertyChangeListener(new PropertyChangeHandler());
        }Code to execute handler is as follows:
        class PropertyChangeHandler implements PropertyChangeListener {
            public void propertyChange(PropertyChangeEvent e) {
              if (((String)e.getPropertyName()).equals("closed")){
                  if (myActiveApplication.equals("myPanelTestje")){
                      myPanelTestje = null;
                  if (myActiveApplication.equals("myFrameTestje")){
                      myFrameTestje = null;
                  if (myActiveApplication.equals("myHolidays")){
                      myHolidays = null;
                  if (myActiveApplication.equals("myInsurance")){
                      myInsurance = null;
            }

    Indeed no need to cast.
    When i click 'close' in the upper right corner of the JInternalFrame, the handler is executed and e.getPropertyName results in "closed". So, the correct property is activated but the problem was, how to detect from which JInternalFrame it was originated? The only way to find out from which panel the 'close'property is activated seems to be a test on the 'instance' (as in the example). Don't know if there is any way to check the panelname itself? It would be something like: e.getSource().getComponentName()
    class PropertyChangeHandler implements PropertyChangeListener {
    public void propertyChange(PropertyChangeEvent e) {
    if (e.getPropertyName().equals("closed")){
    if ((e.getSource() instanceof testApp)){
    myPanelTestje = null;
    if ((e.getSource() instanceof testInternalFrame)){
    myFrameTestje = null;
    if ((e.getSource() instanceof HolidayMenu)){
    myHolidays = null;
    if ((e.getSource() instanceof Insurance)){
    myInsurance = null;
    }If someone has a better way, please let me know. Otherwise consider this question closed.
    Thanks for the replies.

  • HT3939 I got my Iphone 5 as a gift and want to check from which country it was purchased.

    I got my Iphone 5 as a gift and want to check from which country it was purchased. Is there any way we can check it ??

    I don't think so. You can go here: https://selfsolve.apple.com/agreementWarrantyDynamic.do and see when it was purchased by decreasing the end time by one year.

  • Could Apple provide info about IP addresses from which my iPhone was tracked?

    Hello, i've been attacked by two people in the street from the back and my bag with documents and money has been stolen. and now i'm guessing who was it. So i have a question about Find My iPhone app: could Apple provide info about IP addresses from which my iPhone was tracked?

    Welcome to the Apple Community.
    could Apple provide info about IP addresses from which my iPhone was tracked?
    Unfortunately not.

  • How do I get music from my PC, that was originally from CDs, to the iPod touch?  I think you have to get them on iTunes 1st, then sync them over to the iPod?  How do you do this whole process?  Thanks, I'm very NEW at this.

    How do I get music from my PC, that was originally from CDs, to the iPod touch?  I think you have to get them on iTunes 1st, then sync them over to the iPod?  How do you do this whole process?  Thanks, I'm very NEW at this.

    To import music into your iTunes library on the computer go to iTunes>Help>iTunes Help>Add items to iTunes and follow the instructions
    The sync the music to your iPod by:
    iTunes 11 for Windows: Set up syncing for iPod, iPhone, or iPad
    Message was edited by: lllaass, I first thought she wanted iPod to computer.

  • Get URL from which Flash was downloaded into browser

    Hello buddies,
    Is there any API in ActionScript to identify the URL from
    which Flash was downloaded into browser?
    Thanks

    example (
    http://www.flashkit.com/tutorials/Actionscripting/Basic/Easy_to_-Tiran_Da-674/index.php):

  • Complete workflow tasks before starting another workflow.

    Hello everyone
    I have a requirement in my project and i am not sure how to do that task in best possible way.
    I have a reviewer workflow where i will be creating approval tasks for 'n' number of reviewers (the reviewers we get it from initiation form).
    For example
    I have 4 reviewers and there will be 4 approval tasks (1 for each) that will be created and if I have a reply percentage (the people who reviewed
    the tasks assigned to them) set to say 50%. 
    Then if at least 2 reviewers are sending reply for the tasks assigned to them then
    we can start another workflow manually and when that new workflow is starting we should complete all the tasks that are in progress for the review workflow
    If there are only 1 reviewer or no one is sending reply then we should not allow
    the new workflow to start and if anyone try to execute the workflow manually we should say “Minimum number of reviewers had not replied to the tasks assigned to them so we cannot start the workflow now. Retry later”.
    How to achieve this requirement? I already developed the 2 workflows that I discussed here and it is working correctly. I simply need to create this dependency condition
    between the 2 workflows as I discussed here. Please suggest me the proper way for achieving my requirement.
    Thanks
    K.Anantha rengan

    Hi K, the only way I can see this working is if you make the second workflow automatic, and have it start when the number of approvals reaches a certain number. This number would have to be in another column (possibly a calculated column).
    cameron rautmann

  • Trace the machine from which a user was locked

    Is there a dictionary view to find out from which machine (ip) , a user was locked, by entering wrong passwords?
    thanks,
    Hari.

    dba_aiudit_session
    provided
    a) you did enable auditing by setting audit_trail = db and bounced the database
    b) issued AUDIT CONNECT WHENEVER NOT SUCCESFUL
    Sybrand Bakker
    Senior Oracle DBA

  • I need to deauthorize the original computer that home share was created on.  Will I lose everything by deauthorizing the original computer from which home sharing was created?

    My home share was created on my original computer which we wish to disconnect. Can I deauthorize this original computer without losing everything? I am not all that savy with this and don't really understand where the home share is actually stored.

    Hey tswer,
    Thanks for the question. Home Sharing allows you to share music between multiple computers if you continue to use both, but it doesn't create a lasting backup. Considering that you wish to discontinue use of the original computer, it'll be best to transfer your iTunes library to the new computer via an external drive. For information on doing so, please see this article:
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/HT4527
    (For best results, you may want to use the external drive section of the above resource)
    As far as deauthorizing the original computer, see the following:
    iTunes Store: About authorization and deauthorization
    http://support.apple.com/kb/HT1420
    Thanks,
    Matt M.

  • This is oceans804, I sent my question earlier and set up account for your response, but get msg from you that something was wrong.

    ''Your question is over here - https://support.mozilla.com/en-US/questions/829698''
    You sent email to my account and I clicked the link you sent but your msg. indicated a problem and that you didn't set up my account.

    I'm waiting for your response to my question.

  • How to get name of class that the JVM was started with ?

    Assume I have class foo with the standard main method.
    I also have classes ding and dong, they extend foo.
    The JVM is started with either ding or dong as the 'main' class. Since neither ding nor dong directly implement main, the actual main method being executed is foo's.
    In the main method of foo I want to construct an instance of either ding or dong, depending on which the JVM was started with. Since I'm in a static context, I can't do anything with 'this'. Is there another way to get the name of the 'main' class from the JVM so that I can construct an instance of it ?

    The idea behind all of this is that the developer of
    Ding and Dong should not have to know anything about
    foo, in particular it's constructors. But if Ding and Dong are subclasses of Foo, then developers must know about Foo. If you expect developers to extend a framework without having a well-defined interface to that framework, you are probably heading for trouble.
    To be able to
    privatize the constructors, construction of the
    concrete class has to take place in foo.If Ding and Dong are subclasses of Foo, then you can not make all of Foo's constructors private.
    Of course I could have a method in Ding and Dong that
    calls a static method in foo into which the Ding and
    Dong instance pass their class, but then I'd have
    identical implementations of this method in Ding and
    Dong. Yes you would (well, not identical, but very similar). Like I said, you could do this programmatically with AOP, or you could probably do it dirtily using stack traces (though with it being a single hit at startup, you might not consider it being quite so dirty).
    But: the point of inheritance is that common
    functionality goes into superclasses. I disagree. The important thing about inheritance is that classes share an interface, and that methods can be polymorphically inherited, allowing new functionality to be 'plugged in' in the future, and even at runtime.
    Also, in
    general one wouldn't make methods static if a class
    reference is needed (or one would make it an
    argument), but Sun didn't consult me when they
    designed the main method :-(I still don't see why you need to do what you want to do. It appears that all you are after is the ability to start your program using a command line like
        java com.mypackage.Ding
    instead of
        java com.mypackage.Foo com.mypackage.Ding
    or
        java com.mypackage.Foo Ding.properties
    or something else along these lines.
    Since you must know the name of the class you want to use at the time you want to use it, why can't you just pass the name as an argument, or start up using some properties file, or a shell script?

  • MSS Approval Report Links to Busines Workflow Task in UWL

    Hello All,
    I have a scenario below that I'm hoping you can help.
    I copied the standard business workflow task "TS31000007: CATS Approval by Supervisor" to create our own task (general task) and link the 'CatManagerApprove' application and 'sap.com/msscatapproval' package to this task in the Workflow Visualization Configuration.
    We then assigned this new task to the time data entry profile for the portal.  Once, employee released the working time, the task is created and send to the Universal Worklist. 
    The manager can then access the UWL and open this approve time workflow task. This task is open to the MSS Approval Report (similar to what appear under the MSS > Tasks > Approve Time by Manager).
    However, I have copied the Approve Time by Manager to our own and changed some of the  order of the column and header text and assigned to the MSS role. 
    I would like to have this CATS approval task open to the same approval report view/layout as in the MSS Approval Report.
    I've tried to change the layout (column order) through portal contents of the standard MSS Approval Report because I thought it was reading from there, but it's not.
    Does anyone know how this can be done or where to point to the MSS Approval Report on the portal.
    Any help would be appreciated!
    Tam

    Hi Karri,
    We were able to use the launch iview task to launch our specific iview but I cannot seem to get it to recognize the workitem. In other words, when I click on the task in the UWL, my approve working time iview appears but it does not have the data that is from the workflow task item. Attached is the XML code that I used:
    <ItemType name="uwl.task.webflow.TS93000001.SAP_ECC_Financials" connector="WebFlowConnector" defaultView="DefaultView" defaultAction="launchIView" executionMode="default">
          <ItemTypeCriteria systemId="SAP_ECC_Financials" externalType="TS93000001" connector="WebFlowConnector"/>
          <Actions>
            <Action name="launchIView" groupAction="" handler="IViewLauncher" returnToDetailViewAllowed="yes" launchInNewWindow="yes" launchNewWindowFeatures="resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,directories=no">
              <Properties>
                <Property name="newWindowFeatures" value="resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no,directories=no"/>
                <Property name="page" value="pcd:portal_content/net.saccounty.SacCounty/net.saccounty.approve_ts_data"/>
                <Property name="openInNewWindow" value="yes"/>
                <Property name="display_order_priority" value="5"/>
                <Property name="workitemId" value="${item.externalId}"/>
              </Properties>
              <Descriptions default=""/>
            </Action>
          </Actions>
        </ItemType>
    I thought the line <Property name="workitemId" value="${item.externalId}"/> would pick up the work item ID, but it is not working. Any suggestions?
    TS93000001 is our task. approve_ts_data is our iview. It opens in a new window correctly and goes to the correct iview, just is not the actual task data.
    Thank you,
    Mark.

Maybe you are looking for

  • Portfolios: Review, Commenting, and Approval possible?

    Is it possible to do reviewing, commenting, and approval for a PDF portfolio document?  We were wanting to send out our deliverables to a client using the Portfolio feature to create one crisp document with all of our items inside of it, but it seems

  • VAT or CST or Service Tax

    Hi I have to put only one tax among VAT,CST and Service tax at a time for a line item. I am using TAXINN procedure and planned to use P.org / vendor  -  VAT and CST ( Since only one will be applicable fr a vendor). bur for service tax i though of usi

  • How do I change the default country Safari uses to search?

    I am living in China, but I am an English speaking Canadian. Safari's omnibar search defaults to google.hk.  I would prefer it to use google.ca. How can I change this without an extension or plug in? Thanks.

  • Operation Not Supported on Socket/Backup disc wont mount

    For a few months I have been wirelessly backing on a G5 iMac and Intel Macbook to a partition on a G4 mac mini with no problems. All are on Leopard and all updates applied. I now cant: connect to the Time Machine backup back up mount the sparesbundle

  • Sloppy text ... in numeric control

    Our software validation folks are banging on my latest app. One of them went to a numeric control and tried to input text. He said it's"weird". I think it looks like garbage. I have never noticed this before. Any way I can get rid of it? PaulG. "I en