Hi there,
Does anyone know what VBA code i could use to open the Code File maintenance screen (PACFM) from a button added on the Project Controller screen (PAPRJ)?
Thanks
*This post is locked for comments
Don't worry - figured out what to do!!
Thanks again!
Another question :- am i able to run a quick query from from a button on the Project Controller screen?
Hi,
You can't do add another parameter to the DBNav store procedure, because the call that load the data on the screen is on the standard level.
Maybe you could try to delete the rows from de memory array after the data is loaded on the screen. To do that you could try using the functions GetGridHandle, MNext, MDelete, but i'm not sure if that works ok.
Instead of that I recommend you develop another window with that use the two parameters.
Juan Carlos, were you able to help me with this extra customisation on this screen please?
Hi Juan Carlos,
I would now like to only load some of the lines in the grid on the Code File Maintenance screen depending on a second parameter passed across. The field on the table PJCODE i need to filter on is Data1 ie. i don't want all records for the control_code passed across loaded in the grid - only the ones where data1 = the second parameter i am passing across. Hope this makes sense and that you are able to help!
I'm glad to hear that.
Yes, acctually the erroris that the name of the parameter must be the same on the ApplSetParmValue and ApplGetParmValue.
Error:
Call ApplSetParmValue(PRMSECTION_VBRDT, "control_code", Trim(Scode))
sCode = Trim(ApplGetParmValue(PRMSECTION_VBRDT, "ccode_type"))
OK:
Call ApplSetParmValue(PRMSECTION_VBRDT, "control_code", Trim(Scode))
sCode = Trim(ApplGetParmValue(PRMSECTION_VBRDT, "control_code"))
Don't worry Juan, I have figured out my problem! Thanks for your help
Hi Juan,
Thank you for your reply.
I have added code which is now opening Code File maintenance screen from the Project Controller screen successfully. The only think i am having a problem with is the parameter i am trying to pass is not working. Are you able to advise please.
Here is my code:-
Original window
Private Sub Button1_Click()
Dim Scode As String
Scode = "REVT"
Call Edit_Save
Call ApplSetParmValue(PRMSECTION_VBRDT, "control_code", Trim(Scode))
serr1 = Launch("PACFM00.exe", True, True, 0)
Call Edit_Cancel
End Sub
Receiving window
Option Explicit
Dim sCode As String
Private Sub Form1_Display()
MsgBox "display " & sCode
If Trim(sCode) <> "" Then
Call SetObjectValue("ccode_type", Trim(sCode))
End If
End Sub
Private Sub Form1_Load()
MsgBox "load " & sCode
sCode = ApplGetParmValue(PRMSECTION_VBRDT, "ccode_type")
sCode = Trim(ApplGetParmValue(PRMSECTION_VBRDT, "ccode_type"))
If Trim(sCode) <> "" Then
Call SetObjectValue("ccode_type", sCode)
End If
End Sub
Hi,
If you wanna pass data to the other screen you can use something like this:
--Pasa valores de una pantalla a otra
--Pantalla origen
Dim sCustID As String
Call GetBufferValue("bCustomer.CustID", sCustID)
If Trim(sCustID) <> "" Then
Call Edit_Save
Call ApplSetParmValue(PRMSECTION_VBRDT, "CustID", Trim(sCustID))
Call ApplSetParmValue(PRMSECTION_VBRDT, "ShipToID", "DEFAULT")
serr1 = Launch("xUsr_Screen\xFE0200.exe", True, True, 0)
Call Edit_Cancel
End If
--SL 7
Call ApplSetParmValue(PRMSECTION_VBRDT, "BatNbr", bxINPedidoInterCoH.BatNbr)
Call CallApplicWait("xUsr_Screen\xIN1900.exe", String.Empty)
Call Edit_Cancel()
--Pantalla destino
Option Explicit
Dim sCustID As String
Dim sShipToID As String
Private Sub Form1_Display()
If Trim(sCustID) <> "" Then
Call SetObjectValue("cCustID_0", Trim(sCustID))
Call SetObjectValue("cShipToID_0", Trim(sShipToID))
End If
End Sub
Private Sub Form1_Load()
sCustID = ApplGetParmValue(PRMSECTION_VBRDT, "CustID")
sShipToID = ApplGetParmValue(PRMSECTION_VBRDT, "ShipToID")
o
Dim custId as String = trim(ApplGetParmValue(PRMSECTION_VBRDT, "CustID"))
IF String.IsNullOrEmpty(custid) = false then
call setobjectvalue("txtCustID_0", custiID)
end if
End Sub
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156