×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Functions available in AssetCenter v3.6

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

RE: Functions available in AssetCenter v3.6

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

RE: Functions available in AssetCenter v3.6

(OP)

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

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

RE: Functions available in AssetCenter v3.6

(OP)
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("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

Shazza

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

Cheers

Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close