×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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

AssetCenter 4.3.2 Problem with wizard chain

AssetCenter 4.3.2 Problem with wizard chain

AssetCenter 4.3.2 Problem with wizard chain

(OP)
Hi everybody,

I'm gaining my fist experiences with building wizards in AssetCenter. Now I'm having a problem, which I hope somebody can help me with.

I've already built up two wizards. Both wizards run without problems.
Now I've chained Wizard 'A' with Wizard 'B'and I want to push the value of a listbox from 'A' to 'B'.
I've tried to do this by using a string variable in the params knot (string1 = {page1.listbox1.values.column(2)}).
When I test the wizard(s) again, I receive an error message, saying that the feature 'page1.listbox1.values' in the params object is unknown.
I think this error occurs when I reached Wizard 'B', because here is no such 'page1.listbox1'.

Can somebody give me a hint what's wrong here.

Thanks

RE: AssetCenter 4.3.2 Problem with wizard chain

Can you post the code for wizard A please

Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited
[rolf]

RE: AssetCenter 4.3.2 Problem with wizard chain

(OP)
Hi Jason,

here is the code for wizard A
I'm looking forward to hear from you again:

CODE

NAME = "wz_StockReceive"
TITLE = "Eingabe des Wareneingangs"
VERSION = "3659"
WIDTH = 4000
{ PAGE pgOrder
  TITLE = "Auftrag"
  { LABEL LABEL1
    CAPTION = "<B>Wählen Sie hier den Auftrag aus:</B><BR> "
  }
  { TEXTBOX tbReqNoKon
    LABEL = "<B>Suche</B> nach Auftragsnummer Konzern:"
    LABELLEFT = 1
    VALUE = ""
    XOFFSET = 3000
    YOFFSET = 200
  }
  { TEXTBOX tbReqNoKom
    LABEL = "<B>Suche</B> nach Auftragsnummer Kommune:"
    LABELLEFT = 1
    VALUE = ""
    XOFFSET = 3000
  }
  { TEXTBOX tbSAPReqNo
    LABEL = "<B>Suche</B> nach SAP-Bestellnr.:"
    LABELLEFT = 1
    VALUE = ""
    XOFFSET = 3000
  }
  { TEXTBOX tbReqNoSup
    LABEL = "<B>Suche</B> nach Auftragsnummer Lieferant:"
    LABELLEFT = 1
    VALUE = ""
    XOFFSET = 3000
  }
  { DBLISTBOX dblbPortfolio
    COLNAME = "asset.RI10_ReqNoKon|asset.RI10_ReqNoKom|asset.RI10_SapReqNo|asset.RI10_ReqNoSup|AssetTag|Model.Nature|Model|seAssignment"
    { FILTER =
      Dim sReqNoKon as string
      Dim sReqNoKom as string
      Dim sSAPReqNo as string
      Dim sReqNoSup as string
      Dim default as string
      
      sReqNoKon = ("Upper(Asset.RI10_ReqNoKon) like '"& UCase({tbReqNoKon}) & "%'")
      sReqNoKom = ("Upper(Asset.RI10_ReqNoKom) like '"& UCase({tbReqNoKom}) & "%'")
      sSAPReqNo = ("Upper(Asset.RI10_SapReqNo) like '"& UCase({tbSAPReqNo}) & "%'")
      sReqNoSup = ("Upper(Asset.RI10_ReqNoSup) like '"& UCase({tbReqNoSup}) & "%'")
      default = "seAssignment = 3"
      
      If {tbReqNoKon} <> "" then
      RetVal = AppendOperand(default, " AND ", sReqNoKon)
      Elseif {tbReqNoKom} <> "" then
      RetVal = AppendOperand(default, " AND ", sReqNoKom)
      Elseif {tbSAPReqNo} <> "" then
      RetVal = AppendOperand(default, " AND ", sSAPReqNo)
      ElseIf {tbReqNoSup} <> "" then
      RetVal = AppendOperand(default, " AND ", sReqNoSup)
      Else
      RetVal = default
      End if
    }
    MULTISEL = 1
    TABLE = "amPortfolio"
    VALUE = "-1"
    YOFFSET = 200
    YOFFSET2 = 200
  }
  { TEXTBOX tbSerialNumber
    LABEL = "Seriennummer:"
    VALUE = ""
  }
  { COMBOBOX cobSeAssignment
    LABEL = "Situation:"
    VALUE = RetVal = 2
    VALUES = "In Betrieb,Lagerhaltig,Abgang (oder verbraucht),Ausstehende Lieferung,Rückgabe (Wartung),Rückgabe an Lieferanten,Fehlt"
  }
  { COMBOBOX cobStock
    LABEL = "Lager:"
    VALUE = RetVal = 3
    VALUES = "regio it,regio it - Schulen,regio it - Hauptlager,regio it - Reserve Stadt Aachen,regio it - Zwischenlager"
    XOFFSET = 0
    YOFFSET2 = 200
  }
  { COMMANDBUTTON cmdAdd
    CAPTION = "&Hinzuf."
    { CLICK =
      Dim lErr As Long    
      Dim lDuration as Long
      Dim lPortfolioItemID as Long     
      Dim StrLine, StrLine2 as Variant
      Dim sNature, sReqNoKon, sReqNoKom, sReqNoSup, sAssetTag, sModelname, sAssignment, sAssignment2, sStock, sStock2 as String
            
      lPortfolioItemID = {pgOrder.dblbPortfolio}
      
      sNature = amDBGetString("Select Model.Nature.Name from amPortfolio where lPortfolioItemID = " & {pgOrder.dblbPortfolio})
      sNature = Replace(sNature,",","-")      
      sReqNoKon = amDBGetString("Select Asset.RI10_ReqNoKon from amPortfolio where lPortfolioItemID = " & {pgOrder.dblbPortfolio})
      sReqNoKon = Replace(sReqNoKon,",","-")
      sReqNoKom = amDBGetString("Select Asset.RI10_ReqNoKom from amPortfolio where lPortfolioItemID = " & {pgOrder.dblbPortfolio})
      sReqNoKom = Replace(sReqNoKom,",","-")
      sReqNoSup = amDBGetString("Select Asset.RI10_ReqNoSup from amPortfolio where lPortfolioItemID = " & {pgOrder.dblbPortfolio})
      sReqNoSup = Replace(sReqNoSup,",","-")
      sAssetTag = amDBGetString("Select AssetTag from amPortfolio where lPortfolioItemID = " & {pgOrder.dblbPortfolio})
      sAssetTag = Replace(sAssetTag,",","-")      
      sModelname = amDBGetString("Select Model.Name from amPortfolio where lPortfolioItemID = " & {pgOrder.dblbPortfolio})
      sModelname = Replace(sModelname,",","-")      
      
      '### Übersetzung1 seAssignment aus Combobox ###
      If {pgOrder.cobSeAssignment.value} = 1 then
      sAssignment = "In Betrieb"
      Elseif {pgOrder.cobSeAssignment.value} = 2 then
      sAssignment = "Lagerhaltig"
      Elseif {pgOrder.cobSeAssignment.value} = 3 then
      sAssignment = "Abgang (oder verbraucht)"
      Elseif {pgOrder.cobSeAssignment.value} = 4 then
      sAssignment = "Ausstehende Lieferung"
      Elseif {pgOrder.cobSeAssignment.value} = 5 then
      sAssignment = "Rückgabe (Wartung)"
      Elseif {pgOrder.cobSeAssignment.value} = 6 then
      sAssignment = "Rückgabe an Lieferanten"
      Elseif {pgOrder.cobSeAssignment.value} = 7 then
      sAssignment = "Fehlt"
      End if
      
      '### Übersetzung2 seAssignment aus Combobox ###
      If {pgOrder.cobSeAssignment.value} = 1 then
      sAssignment2 = "0"
      Elseif {pgOrder.cobSeAssignment.value} = 2 then
      sAssignment2 = "1"
      Elseif {pgOrder.cobSeAssignment.value} = 3 then
      sAssignment2 = "2)"
      Elseif {pgOrder.cobSeAssignment.value} = 4 then
      sAssignment2 = "3"
      Elseif {pgOrder.cobSeAssignment.value} = 5 then
      sAssignment2 = "4"
      Elseif {pgOrder.cobSeAssignment.value} = 6 then
      sAssignment2 = "5"
      Elseif {pgOrder.cobSeAssignment.value} = 7 then
      sAssignment2 = "6"
      End if
      
      '### Übersetzung1 Stock aus Combobox ###
      If {pgOrder.cobStock.value} = 1 then
      sStock = "regio iT"
      Elseif {pgOrder.cobStock.value} = 2 then
      sStock = "regio iT - Schulen"
      Elseif {pgOrder.cobStock.value} = 3 then
      sStock = "regio iT - Hauptlager"
      Elseif {pgOrder.cobStock.value} = 4 then
      sStock = "regio iT - Reserve Stadt Aachen"
      Elseif {pgOrder.cobStock.value} = 5 then
      sStock = "regio iT - Zwischenlager"
      End if
      
      '### Übersetzung2 Stock aus Combobox ###
      If {pgOrder.cobStock.value} = 1 then
      sStock2 = "179930"
      Elseif {pgOrder.cobStock.value} = 2 then
      sStock2 = "179928"
      Elseif {pgOrder.cobStock.value} = 3 then
      sStock2 = "330995"
      Elseif {pgOrder.cobStock.value} = 4 then
      sStock2 = "765575"
      Elseif {pgOrder.cobStock.value} = 5 then
      sStock2 = "819963"
      End if
                  
      '##### Überprüfung ob die Listbox bereits gefüllt ist #####
      If LEN({pgOrder.lbReqAsset.VALUES}) > 0 Then
         StrLine = {pgOrder.lbReqAsset.VALUES} & ","
      End If
      
      '##### Schreiben der einzelnen Werte in die Listbox - Spaltentitel reqNoKon|reqNoKom|reqNoSup|AssetTag|Art|Modell|Seriennummer|Zuordnung|Lager#####
      StrLine = StrLine & sReqNoKon & "|" & sReqNoKom & "|" & sReqNoSup & "|" & sAssetTag & "|" & sNature & "|" & sModelname & "|" & {pgOrder.tbSerialNumber} & "|" & sAssignment & "|" & sStock
      lErr = AmSetProperty("pgOrder.lbReqAsset.VALUES", StrLine)
      
      ' Überprüfung ob die Listbox bereits gefüllt ist
        If LEN({pgOrder.lbSaveNewAssets.VALUES}) > 0 Then
           StrLine2 = {pgOrder.lbSaveNewAssets.VALUES} & ","
        End If
      
      '##### Schreiben der einzelnen Werte in die Listbox - Spalten der Listbox AssetTag|lPortfolioItemID|SerialNo|seAssignment|lStockId|RI10_ReqNoKon|RI10_ReqNoKom#####
        StrLine2 = StrLine2 & sAssetTag & "|"& lPortfolioItemId &"|" & {pgOrder.tbSerialNumber} & "|" & sAssignment2 & "|" & sstock2 & "|" & sReqNoKon & "|" & sReqNoKom
        lErr = AmSetProperty("pgOrder.lbSaveNewAssets.VALUES", StrLine2)
       
      
      'Zurücksetzen der Felder
      lErr = amSetProperty("pgOrder.tbSerialNumber.value","")
      LErr = amSetProperty("cmdRemove.enabled",1)
      StrLine = ""
      StrLine2 = ""
    }
    { ENABLED =
      If {dblbPortfolio} = -1 Then
      RetVal = 0
      else
      RetVal = 1
      End If
    }
  }
  { COMMANDBUTTON cmdRemove
    CAPTION = "&Rückgängig"
    { CLICK =
      Dim DeleteLine as String
      Dim DeleteLine2 as String
      
      Dim lErr as Long
      Dim i as Long
      Dim n as Long
      
      'Standardwerte
       i = 0
       n = 0
      
      'Löschen der Zeilen
      
        For n = 1 to {pgOrder.lbReqAsset.VALUES.Count()}
           IF instr(1,{pgOrder.lbReqAsset.VALUE},{pgOrder.lbReqAsset.VALUES.ID(n)}) = 0 Then
              deleteline2 = deleteline2 & {pgOrder.lbReqAsset.VALUES.LINE(n)} & "=" & {pgOrder.lbReqAsset.VALUES.ID(n)} & ","
              deleteline = deleteline & {pgOrder.lbSaveNewAssets.VALUES.LINE(n)} & "=" & {pgOrder.lbSaveNewAssets.VALUES.ID(n)} & ","      
           End If
        Next n
      
        deleteline2 = Left(deleteline2,Len(deleteline2)-1)
        LErr = AmSetProperty("pgOrder.lbReqAsset.VALUES", deleteline2)
      
        deleteline = Left(deleteline,Len(deleteline)-1)
        LErr = AmSetProperty("pgOrder.lbSaveNewAssets.VALUES", deleteline)
    }
    { ENABLED =
      If {lbSaveNewAssets.Values.Count()} = 0 then
      retval = 0
      else
      retval = 1
      end if
    }
    YOFFSET = 0
    YOFFSET2 = 200
  }
  { LISTBOX lbReqAsset
    COLNAME = "ReqNoKon|ReqNoKom|ReqNoSup|AssetTag|Nature|Model|SerialNumber|Zuordnung|Lager"
    VALUE = ""
    VALUES = RetVal = ""
  }
  { LISTBOX lbSaveNewAssets
    COLNAME = "AssetTag|lPortfolioItemId|SerialNo|seAssignment|lStockId|RI10_ReqNoKon|RI10_ReqNoKom"
    VALUE = ""
    VALUES = RetVal = ""
    VISIBLE = 0
  }
}

{ PARAMS PARAMS
  { STRING AssetIdList
    { VALUE =
      Dim strAssetIdList as string
      
      strAssetIdList={pgOrder.lbSaveNewAssets.Values}
      
      RetVal=strAssetIdList
    }
  }
}

{ FINISH FINISH
  CHAIN = "RI10_wzEmailStockReceipt"
  { DO =
    Dim lErr, i, j, lcount as Long
    Dim hrPortfolio, hrAsset as Long
    Dim hqry As Long
    Dim lAstID, lPortfolioitemID, PortfolioItemId as Long
        
    '###### Ist die Listbox der Geräte gefüllt? #####
      If LEN({pgOrder.lbSaveNewAssets.VALUES}) > 0 Then     
    '##### Zählen der Listboxeinträge #####
        lCount = CountValues({pgOrder.lbSaveNewAssets.VALUES}, ",", "\")
    '##### Schleife für die Zeilen in der Listbox #####
        For i = 1 To lCount
             
    '##### Abfrage der AssetID des Ausrüstungselement #####
            lErr = AmStartTransaction()
            hqry = AmQueryCreate()
            lErr = AmQueryExec(hqry,"Select lPortfolioItemId, lAstID from amPortfolio where lPortfolioitemID = " & {pgOrder.lbSaveNewAssets.Values.Cell(i,2})
            lAstID = AmGetFieldLongValue(hQry,1)
            lPortFolioItemId = AmGetFieldLongValue(hqry,0)
            lErr = AmReleaseHandle(hQry)
    
    '##### Aktualisieren der Ausrüstung mit Situation und Lager #####                      
            hrPortfolio=AmGetRecordFromMainId("amPortfolio", lPortfolioItemId)
            lErr = AmSetFieldLongValue(hrPortfolio, "lStockId",{pgOrder.lbSaveNewAssets.VALUES.Cell(i,5)})
            lErr = AmSetFieldStrValue (hrPortfolio, "seAssignment",{pgOrder.lbSaveNewAssets.VALUES.Cell(i,4)})           
            lErr = amUpdateRecord(hrPortfolio)
            lErr = AmLog("Daten wurden in der Tabelle Ausrüstungselement aktualisiert")
            lErr = AmReleaseHandle(hrPortfolio)
            lErr = AmCommit()
    
    '##### Abfrage der AssetID des Ausrüstungselement #####
            lErr = AmStartTransaction()
            hqry = AmQueryCreate()
            lErr = AmQueryExec(hqry,"Select lPortfolioItemId, lAstID from amPortfolio where lPortfolioitemID = " & {pgOrder.lbSaveNewAssets.Values.Cell(i,2})
            lAstID = AmGetFieldLongValue(hQry,1)
            lPortFolioItemId = AmGetFieldLongValue(hqry,0)
            lErr = AmReleaseHandle(hQry)
    
    '##### Aktualisieren des Vermögens mit der Seriennummer #####                      
            hrAsset = AmGetRecordFromMainId("amAsset", lAstID)        
            lErr = AmSetFieldStrValue (hrAsset,"SerialNo", {pgOrder.lbSaveNewAssets.VALUES.Cell(i,3)})                
            lErr = AmUpdateRecord(hrAsset)
            lErr = AmLog("Daten wurden in der Tabelle Vermögen aktualisiert")             
            lErr = AmReleaseHandle(hrAsset)
            lErr = AmCommit()                                
    
        Next i
    
    End If   
    
    lErr = AmLog("Aktualisierung abgeschlossen!")
    lErr = AmProgress(100)
     }
  SUMMARY = 1
}

RE: AssetCenter 4.3.2 Problem with wizard chain

Shac

Try changing your code to match the following code

CODE

{ PARAMS PARAMS
  { STRING AssetIdList
    { VALUE =
    }
  }
}

{ FINISH FINISH
  CHAIN = "RI10_wzEmailStockReceipt"
  { CONDITION =
    Dim lErr as Long
    
    lErr = amSetProperty("PARAMS.AssetIdList", PgOrder.lbSaveNewAssets.Values})
  }

Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited
[rolf]

RE: AssetCenter 4.3.2 Problem with wizard chain

(OP)
I've just tried your code example.

But now another problem appears.
After changing the code I do not have the button "finish" (Hope that's how it is named in english, actualy in german it is "Fertig stellen").

On the first wizard page I can still fill out the fields, but usually the "finish" button is activ from the beginning, now it is inactiv all the time.

I'm not sure, but as I understood it the condition should define whether the button "finish" is active or not.

By the way I changed your code a bit just because I had an syntax error message in the beginning due to a missing "{" (before pgOrder).
Hope that isn't the reason for not running now.

RE: AssetCenter 4.3.2 Problem with wizard chain

Add the following line

[Code]
{ FINISH FINISH
  CHAIN = "RI10_wzEmailStockReceipt"
  { CONDITION =
    Dim lErr as Long
    
    lErr = amSetProperty("PARAMS.AssetIdList", {PgOrder.lbSaveNewAssets.Values})

    RetVal = 1
  }

Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited
[rolf]

RE: AssetCenter 4.3.2 Problem with wizard chain

(OP)
I've tried it, and it works.
Thank you so much.

Think I still have to learn a lot.

Yours
Sabine Hagen


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