This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Manually promote an Item by checking some conditions

meenu - Wednesday, February 13, 2013 1:39 AM:

Hi all,

    I want to promote my item manually, If I click on  'Promote' then a method should be called and validate some conditions. If the item satisfies all the conditions then it should get promoted.  

  Where can I add a method with some conditions that will be called before promoting? And what are permissions to be given?  Where can i find Sample code ?

Thank you, M.K



Eric Domke - Wednesday, February 13, 2013 8:52 AM:

Each transition in a life cycle allows for the attachment of a pre and post method.  You should attach a method to the pre method of the promotion you want to conditionally block.  In that method, return an error (e.g. Me.getInnovator.newError("You can't do this")) when you decide that you want to block the promotion.  Otherwise, return a valid item (e.g. Me).

Permissions are based on the identity associated with the life cycle transition.  Only individuals in that identity are allowed to execute the promotion.



meenu - Friday, February 15, 2013 3:36 AM:

 Thanks Eric, that worked.