Welcome to Good Training Sign in | Become a member - FREE!
 

Function not working properly

Last post 08-19-2009, 11:14 AM by Kris Halsrud. 2 replies.
Sort Posts:
  •  08-19-2009, 2:11 AM 2012

    Function not working properly

    Hi All, Below is a function i wrote to clear the tick box and complete date of a sales process step if the action is cancelled. However when a user cancels a step (say step 3 for example) it removes the complete date and tick from step 1 instead of the step that was cancelled. Any other cancels following this then do not remove anything at all. Any ideas why?

    function removeChecks()
        Dim strKeyField, strReqStepID, strRegStepName
        dim result
           strKeyField = grdSalesProcess.GetCurrentField
           result = DoUnCompleteStep(strKeyField)
           grdSalesProcess.Refresh
           grdSalesProcess.ExpandAll
           UpdateStats(gstrSalesProcessID)
           PostOppDetailView
           RefreshOppDetailView
    end function

  •  08-19-2009, 2:47 AM 2013 in reply to 2012

    Re: Function not working properly

    After some testing i have found that it is not a problem whereby "Any other cancels following this then do not remove anything at all". It is that for somen reason it is always the first step being cancelled! As it was already empty i didnt notice originally.
  •  08-19-2009, 11:14 AM 2014 in reply to 2012

    Re: Function not working properly

    I would check the result of the GetCurrentField to make sure that is returning what you would expect.  Also is the DoUnCompleteStep a built in function or is that something you also created?

    function removeChecks()
        Dim strKeyField, strReqStepID, strRegStepName
        dim result
           strKeyField = grdSalesProcess.GetCurrentField

                   msgbox strKeyField


           result = DoUnCompleteStep(strKeyField)
           grdSalesProcess.Refresh
           grdSalesProcess.ExpandAll
           UpdateStats(gstrSalesProcessID)
           PostOppDetailView
           RefreshOppDetailView
    end function

View as RSS news feed in XML