Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

old virtual link function in AC4.4

Status
Not open for further replies.

tech9merge

Programmer
Jun 7, 2005
9
US
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)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top