tech9merge
Programmer
In AC 4.3.2,When Assignment status is modified , the assignment date will be set to sysdate incase the user forgets to update the same.If the user updates the date , then the assignemtn date should get accordingly.
This works fine , if the user modifies the assignment status and hits modify , the assignment date resets to sysdate automatically, but if the user performs the following in order ,change the assignment status, then the assignment date and then hit the modify button , still the assignment date defaults to sysdate automatically and does not accept the user specified date.I have written a worflow which monitors the assignment status, location , user changes etc and then the action would udpate the assignment date.Has anyone come across this???
AC Experts any suggestions/ideas ?????
In Ac 4.4 , this can be handled easily by making use of the "Old" virtual link in the Parameter Script of your Start Event.Any ideas in Ac4.3.2.Following is the code in the second activity right after the Start activity.
Dim lErr As Long
Dim dAssign As Date
Dim hq as Long
Dim Mydate as Date
Dim hr as Long
dAssign=[dAssignment]
AmMsgBox(dAssign)
hq=amQueryCreate()
lErr = AmQueryExec( hq, "SELECT lPortfolioItemId ,dAssignment FROM amPortfolio WHERE lPortfolioItemId="&[lPortfolioItemId])
hr=amGetRecordHandle(hq)
MyDate=amGetFieldDateValue(hr,1)
AmMsgBox("MyDatebeforeupdate")
AmMsgBox(MyDate)
AmDbExecAQL("Update amPortfolio set dAssignment=getdate() WHERE lPortfolioItemId =" &[lPortfolioItemId] & " AND dAssignment = #"& MyDate &"#")
AmMsgBox("Afterupdate")
AmMsgBox([dAssignment])
AmMsgBox("AfterupdateMyDateValue")
AmMsgBox(MyDate)
This works fine , if the user modifies the assignment status and hits modify , the assignment date resets to sysdate automatically, but if the user performs the following in order ,change the assignment status, then the assignment date and then hit the modify button , still the assignment date defaults to sysdate automatically and does not accept the user specified date.I have written a worflow which monitors the assignment status, location , user changes etc and then the action would udpate the assignment date.Has anyone come across this???
AC Experts any suggestions/ideas ?????
In Ac 4.4 , this can be handled easily by making use of the "Old" virtual link in the Parameter Script of your Start Event.Any ideas in Ac4.3.2.Following is the code in the second activity right after the Start activity.
Dim lErr As Long
Dim dAssign As Date
Dim hq as Long
Dim Mydate as Date
Dim hr as Long
dAssign=[dAssignment]
AmMsgBox(dAssign)
hq=amQueryCreate()
lErr = AmQueryExec( hq, "SELECT lPortfolioItemId ,dAssignment FROM amPortfolio WHERE lPortfolioItemId="&[lPortfolioItemId])
hr=amGetRecordHandle(hq)
MyDate=amGetFieldDateValue(hr,1)
AmMsgBox("MyDatebeforeupdate")
AmMsgBox(MyDate)
AmDbExecAQL("Update amPortfolio set dAssignment=getdate() WHERE lPortfolioItemId =" &[lPortfolioItemId] & " AND dAssignment = #"& MyDate &"#")
AmMsgBox("Afterupdate")
AmMsgBox([dAssignment])
AmMsgBox("AfterupdateMyDateValue")
AmMsgBox(MyDate)