ADODB AGS RQ10 Call

 4 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
ridjayc
Veteran Member
Posts: 191
Veteran Member
    I am attempting to do an AGS call on RQ10. I have tried several different things. It seems to want to have me inquire first however this is going to be a brand new requisition. I have used ADODB to do updates of APVENMAST however those are just updates and not inserts. Does someone have an example? Here is what I am trying right now. . . . 'Create a blank requisition cmdLAW = New ADODB.Command rsLAW = New ADODB.Recordset strAGS = "ags:_PDL=" & constPRODLine & "&_TKN=RQ10.1&FC=A&RQH-REQUESTER=" & Me.strRequester cmdLAW.ActiveConnection = connLAW cmdLAW.CommandText = strAGS rsLAW = cmdLAW.Execute . . .
    John Henley
    Posts: 3353
      Do you get an error message?
      What version of Env/LSF9?
      What version of apps?
      Thanks for using the LawsonGuru.com forums!
      John
      ridjayc
      Veteran Member
      Posts: 191
      Veteran Member
        The error message I am currently getting is

        "The Function Code was not valid for Cammand Execution. The Function Code needs to be an Inquire or Next type Function Code.".

        I have tried adding in more fields. I can get a RQ10(Add) ags call to work by doing a Process Flow call in the Process Flow AGS build so I think the AGS string should be close to being correct. The process flow AGS builder version of this is

        _PDL=DEV&_TKN=RQ10.1&_EVT=ADD&_RTN=DATA&_LFN=ALL&_TDS=IGNORE&FC=Add&RQH-REQUESTER=ridjayc&_DELIM=%09&_OUT=TEXT&_EOT=TRUE

        The version on Environment is 8.0.3ESP7
        The apps are 8.1.0 ESP5
        RQ10 is RQ10PD 197.1.39
        John Henley
        Posts: 3353
          What version of the OLEDB connector are you using? I tried with the OLEDB 9.0.4 version against LSF9 and 9.0 apps, and found the same result. It worked OK from the MS addins. You might want to try adding the &EVT=ADD and see if that helps. Otherwise, I'd suggest you might want to start a case with Lawson...
          Thanks for using the LawsonGuru.com forums!
          John
          ridjayc
          Veteran Member
          Posts: 191
          Veteran Member
            I found a way I can create the Requisition Header by using a XMLTextReader call in vb.net.

            Dim strUrl As String = "http://law-dev-web1.prod.bcidaho.loc/servlet/ags?_PDL=DEV&_TKN=RQ10.1.....
            . . .
            oXML = New XmlTextReader(strUrl)
            resolver.Credentials = New NetworkCredential("myUserName", "myPassword")
            dS.ReadXml(oXML)
            dS.ReadXml(oXML)
            dT = dS.Tables(0)
            dR = dT.Rows(0)
            strRet = dR("Message").ToString

            However when it comes to line creation it really seems to have a problem. When I use this string it returns with sucess however it does not create the line

            __PDL=DEV&_TKN=RQ10.1&_EVT=CHG&_RTN=DATA&_LFN=ALL&_TDS=IGNORE&FC=Change&RQH-REQUESTER=ridjayc&RQH-REQ-NUMBER=17742&RLN-ITEM1=MagicWand&RLN-QUANTITY1=1&RLN-ENTERED-UOM1=EA&MMD-ACCOUNT1=1000&MMD-ACCOUNT-UNIT1=1&RLN-DESCRIPTION1=MagicWandofTesting&RLN-ITEM-TYPE1=X&RLN-TRAN-UNIT-COST1=199.37&LINE-FC1=A&_DELIM=%09&_OUT=XML&_EOT=TRUE

            If I change the OUT from xml to text as in "_OUT=TEXT" then it works perfectly. Any ideas on this?