Functions available in AssetCenter v3.6
Functions available in AssetCenter v3.6
(OP)
I am trying to create a couple of wizards and would love to use the DaExecuteActionfromName function which according to documentation that I have is available in Version 1.0.
When I use this, I get an error message telling me that the function is not defined.
Can I use this function, or is there another function available for use from within a wizard script? not the finish.do portion.
Thanks
When I use this, I get an error message telling me that the function is not defined.
Can I use this function, or is there another function available for use from within a wizard script? not the finish.do portion.
Thanks
RE: Functions available in AssetCenter v3.6
Firstly, any action with Da*** is in AC 4.x and not available in earlier version (The da refers to Desktop Administration)
If you are trying to run another action then try amExecuteActionByName
I hope this helps
Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited
RE: Functions available in AssetCenter v3.6
Thanks Jason,
The function amExecuteActionByName is not available from a wizard script .. or am I reading the documentation wrong?
RE: Functions available in AssetCenter v3.6
What is it that you are trying to do?
If you send me the script, explaining what you are trying to do I can take a look at it.
Cheers
Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited
RE: Functions available in AssetCenter v3.6
"The script does not have the necessary access writes".
Here is a sample of his script ... it is quite a long wizard, but I can send you all if you wish.
On Error GOTO ErrorHandler
Dim lReq as Long
Dim lErr as Long
Dim lErrSup as Long
Dim hrErrSup as Long
Dim hqErrSup as Long
Dim lErrPO as Long
Dim lErrDel as long
Dim lRc as Long
Dim hr as Long
Dim lPO as Long
Dim lDel as Long
Dim lPOL as Long
Dim hqPO as Long
Dim hrPO as Long
Dim hqDel as Long
Dim hrDel as Long
Dim hrAst as Long
Dim hqASt as Long
Dim LAstL as Long
Dim hq as Long
Dim lCount as Long
Dim lCV as long
lCount=1
'get Current request
lReq={pgRequest.dblRequest}
hq=amQueryCreate()
lErr=amQueryExec(hq,"Select lReqId From amRequest WHERE lReqId=" & lReq & "")
If lErr<>12004 then
hr=amGetRecordHandle(hq)
lRc=AmCreatePOsFromAllReqLines(lReq,1,0)
lErrPO=AmDBGetLong("SELECT Count(lPOrdId) From amPOrder WHERE lReqId=" & lReq)
hqPO=amQueryCreate()
lErrPO=amQueryExec(hqPO,"Select lPOrdId From amPOrder WHERE lReqId=" & lReq)
Do While lErrPO <>12004
lCV=AmStartTransaction()
hrPO=amGetRecordHandle(hqPO)
lPO=amGetFieldLongValue(hrPO,0)
lRc = AmSetFieldStrValue(hrPO, "PONumber", {PARAMS.sOrder} & "/" & lCount)
lRc = AmUpdateRecord(hrPO)
lCount=lCount+1
lDel=AmCreateDelivfromPO(lPO)
lRc=amReceiveAllPOLines(lPO,lDel)
lCV=AmCommit()
lRc=AmReleaseHandle(hrPO)
lErrPO=amQueryNext(hqPO)
Loop
End If
hqAst=amQueryCreate()
lErr=amQueryExec(hqAst,"Select lAstId From amAsset WHERE ReqLine.lReqId=" & lReq & "")
Do While lErr<12004
lRc=AmStartTransaction()
hrAst=amGetRecordHandle(hqAst)
lErr=amSetFieldStrValue(hrAst,"Field1",UCase({PARAMS.sRequest}))
lErr=amSetFieldLongValue(hrAst,"lLocaID",{PARAMS.lLoc})
lErr=AmSetFieldLongvalue(hrAst,"lLicCntrId",{PARAMS.lContract})
lErr=amUpdateRecord(hrAst)
lRc=AmCommit()
lRc=AmReleasehandle(hrAst)
lErr=amQueryNext(hqAst)
Loop
lErr=amQueryExec(hq,"Select lReqId From amRequest WHERE lReqId=" & lReq & "")
If lErr<>12004 then
lRc=AmStartTransaction()
hr=amGetRecordHandle(hq)
lRc = AmSetFieldDoubleValue(hr, "seApprStatus", "1")
lRc = amSetFieldDoubleValue(hr, "bSatisfied", "1")
lErr = AmUpdateRecord(hr)
lRc=AmCommit()
End IF
lErr=AmSetProperty("PARAMS.sReqLineVal.Value",AmDbGetList("SELECT Brand,Product.Model,lQty,lQtyReceived,FV_geniBuy,FV_ClientBuy,pDiscount,mNetCost FROM amReqLine WHERE lReqId=" & {pgRequest.dblRequest} & "","|",",", "="))
lErr=amMsgBox("Assets Created")
Exit Function
ErrorHandler:
On Error Goto 0
lErr = AmLog(AmLastError() & " - " & AmLastErrorMsg(), LOG_ERROR)
lErr = AmLog(FormatResString("The transaction $1 has been canceled", "") , LOG_ERROR)
lErr = AmRollBack()
RetVal = 1
Exit Function
RE: Functions available in AssetCenter v3.6
Please send the whole wizard to my Hotmail account
thomaj3@hotmail.com
Cheers
Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited