Un poco de C#,JScript,VB, y CRM, Drupal, SQL , MSDCRM y MSDSL VBTools, developer, project lider, Social Media Activist, BlackBerry developer, telerik tools. (MCITP)
martes, 29 de mayo de 2012
Adding custom table in standard screen SL Dynamics 6.5
Private Sub Form1_Load()
Call VBA_SetAddr("bxtEquipment", bxtEquipment, nxtEquipment, LenB(bxtEquipment))
Call SqlCursorEx(Csr_xtEquipment, NOLEVEL, "Csr_xtEquipment", "xtEquipment", "xtEquipment")
End Sub
Private Sub cEquipID_Chk(ChkStrg As String, retval As Integer)
Dim CpnyID As String
CpnyID = GetObjectValue("cCpnyId")
SqlStr = "SELECT * FROM xtEquipment WHERE EquipmentID = " + SParm(Trim(ChkStrg))
serr1 = SqlFetch1(Csr_xtEquipment, SqlStr, bxtEquipment, LenB(bxtEquipment))
If serr1 = NOTFOUND Then
bxtEquipment = nxtEquipment
bxtEquipment.EquipmentID = ChkStrg
bxtEquipment.CpnyID = CpnyID
bxtEquipment.StatusNew = "N"
End If
End Sub
Private Sub Update1_OnDelete(Level As Integer, retval As Integer)
Dim EquipID As String
If Level = LEVEL0 Then
EquipID = Trim(GetObjectValue("cEquipID"))
SqlStr = "Delete xtEquipment WHERE EquipmentID = " + SParm(Trim(EquipID))
Call sql(c1, SqlStr)
Call SqlFree(c1)
End If
End Sub
Private Sub Update1_OnUpdate(Level As Integer, InsertFlg As Integer, retval As Integer)
Dim CpnyID As String
CpnyID = GetObjectValue("cCpnyId")
If Level = 0 Then 'If Level = Finished Then
Dim Equipment As String
Dim EquipmentNE As String
Dim EquipNEType As String
Dim StatusNew As String
Equipment = GetObjectValue("cEquipID")
EquipmentNE = GetObjectValue("xEquipNE")
EquipNEType = GetObjectValue("xEquipNEType")
StatusNew = bxtEquipment.StatusNew
SqlStr = "xsUPDate_Equipment " + _ 'Update Procedure
SParm(Trim(CpnyID)) + _
SParm(Trim(Equipment)) + _
SParm(Trim(EquipmentNE)) + _
SParm(Trim(EquipNEType)) + _
SParm(Trim(StatusNew))
Call sql(c1, SqlStr)
Call SqlFree(c1)
SqlStr = "SELECT * FROM xtEquipment WHERE EquipmentID = " + SParm(Trim(Equipment))
serr1 = SqlFetch1(Csr_xtEquipment, SqlStr, bxtEquipment, LenB(bxtEquipment))
Call DispFields("Form1", "cEquipID")
Call DispFields("Form1", "xEquipNE")
Call DispFields("Form1", "xEquipNEType")
End If
End Sub
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario