Goal
You have a SL Dynamics custom screen with a grid. You want to pass parameters to this screen from another screen and, if values are passed, you want to insert a new line in the grid, put the values in it but Not save the line unless the user hits save.
I recently had to do this where there was a bank feed that had vendor sometimes missing from the file but had a vendor name. So I created a cross walk table that has the bank feed vendor and name and the user selected vendor id that it should walk to. The user would select the line with the issue and click a button to add the vendor passed and the vendor name to the cross walk table.
Environment
SQL 2008, Windows Server 2008 for SL and SQL
Server, Windows 7 workstations, and Dynamics SL 2011.
We are developing in Visual Studio 2010. Please
see my other post on how to get around the 64 bit issue.
Issue
The problem is just figuring what code to use to perform these tasks:
1) check parameters if passed
2) insert new blank line into grid on the fly
3) place values passed into this new blank line
Resolution
The Resolution was as follows:
1) use ApplSetParmValue and ApplGetParmValue functions to pass and read the parameters.
2) use Edit_New() sub to insert new blank line into grid
3) use SetObjectValue functions to set the grid to have the values passed
Call ApplSetParmValue(PRMSECTION_VBRDT, "BankVendorID", sBank)
Call ApplSetParmValue(PRMSECTION_VBRDT, "VENDORName", sVendorName)
Dim sVendorID As String
Dim sVendorName As String
sVendorID = ApplGetParmValue(PRMSECTION_VBRDT, "BankVendorID")
sVendorName = ApplGetParmValue(PRMSECTION_VBRDT, "VENDORName")
Edit_New(LEVEL0)
serr9 = SetObjectValue(txtVendorID, Mid(sVendorID, 1, 10))
serr9 = SetObjectValue(txtVendorName, Mid(sVendorName, 1, 30))
End If
Conclusion
It is relatively easy to pass parameters and add to a grid on the fly, allowing the user to accept or reject the changes before they are saved using the Solomon RDT Toolkit.
No comments:
Post a Comment