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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Functions available in AssetCenter v3.6

Status
Not open for further replies.

Shazza

Technical User
Aug 21, 2000
38
NZ
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
 
Shazza

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
:)
 

Thanks Jason,

The function amExecuteActionByName is not available from a wizard script .. or am I reading the documentation wrong?
 
Shazza

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
:)
 
Basically my boss has written a wizard that keeps coming up with the following error:
"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(&quot;SELECT Count(lPOrdId) From amPOrder WHERE lReqId=&quot; & lReq)
hqPO=amQueryCreate()
lErrPO=amQueryExec(hqPO,&quot;Select lPOrdId From amPOrder WHERE lReqId=&quot; & lReq)
Do While lErrPO <>12004
lCV=AmStartTransaction()
hrPO=amGetRecordHandle(hqPO)
lPO=amGetFieldLongValue(hrPO,0)
lRc = AmSetFieldStrValue(hrPO, &quot;PONumber&quot;, {PARAMS.sOrder} & &quot;/&quot; & 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,&quot;Select lAstId From amAsset WHERE ReqLine.lReqId=&quot; & lReq & &quot;&quot;)
Do While lErr<12004
lRc=AmStartTransaction()
hrAst=amGetRecordHandle(hqAst)
lErr=amSetFieldStrValue(hrAst,&quot;Field1&quot;,UCase({PARAMS.sRequest}))
lErr=amSetFieldLongValue(hrAst,&quot;lLocaID&quot;,{PARAMS.lLoc})
lErr=AmSetFieldLongvalue(hrAst,&quot;lLicCntrId&quot;,{PARAMS.lContract})
lErr=amUpdateRecord(hrAst)
lRc=AmCommit()
lRc=AmReleasehandle(hrAst)
lErr=amQueryNext(hqAst)

Loop
lErr=amQueryExec(hq,&quot;Select lReqId From amRequest WHERE lReqId=&quot; & lReq & &quot;&quot;)
If lErr<>12004 then
lRc=AmStartTransaction()
hr=amGetRecordHandle(hq)
lRc = AmSetFieldDoubleValue(hr, &quot;seApprStatus&quot;, &quot;1&quot;)
lRc = amSetFieldDoubleValue(hr, &quot;bSatisfied&quot;, &quot;1&quot;)
lErr = AmUpdateRecord(hr)
lRc=AmCommit()
End IF


lErr=AmSetProperty(&quot;PARAMS.sReqLineVal.Value&quot;,AmDbGetList(&quot;SELECT Brand,Product.Model,lQty,lQtyReceived,FV_geniBuy,FV_ClientBuy,pDiscount,mNetCost FROM amReqLine WHERE lReqId=&quot; & {pgRequest.dblRequest} & &quot;&quot;,&quot;|&quot;,&quot;,&quot;, &quot;=&quot;))
lErr=amMsgBox(&quot;Assets Created&quot;)
Exit Function
ErrorHandler:
On Error Goto 0
lErr = AmLog(AmLastError() & &quot; - &quot; & AmLastErrorMsg(), LOG_ERROR)
lErr = AmLog(FormatResString(&quot;The transaction $1 has been canceled&quot;, &quot;&quot;) , LOG_ERROR)
lErr = AmRollBack()
RetVal = 1
Exit Function
 
Shazza

Please send the whole wizard to my Hotmail account
thomaj3@hotmail.com

Cheers

Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top