I've modified the Payables Transaction Entry window adding a drop-down list with two options in it (see code below)
Option Explicit
Dim bolUserChnaged As Boolean
Private Sub ddlAllocation_Changed()
PurchaseOrderNumber.Value = ddlAllocation.Value
If PurchaseOrderNumber.Value = 2 Then
PurchaseOrderNumber.Value = "ICALLOC"
ElseIf PurchaseOrderNumber.Value = 1 Then
PurchaseOrderNumber.Value = "TRIREME"
End If
End Sub
The problem I have now is when the end user selects an option from the drop down and saves the transaction it's not saving the selected item in the DDL. I'm sure it's because of the save event not being called either from the save button on the form or modal dialog box. I know part of what I have to do is call this procedure:
Private Sub Window_AfterModalDialog(ByVal DlgType As DialogType, PromptString As String, Control1String As String, Control2String As String, Control3String As String, Answer As DialogCtrl)
End Sub
But I don't know how to get the field to be saved with each new transaction.
I appreciate any help!
Thank you,
Sean
*This post is locked for comments
Hi Sean,
I live 5 miles north of downtown Dallas, but I serve the whole Metroplex. My office is at the corner of Midway and Spring Valley in the GEICO building. I'd love to buy you lunch if you have an opening on your dance card, just to say 'hi'. I'll be back in Dallas the last week of March. Shoot me an email at leslievail@earthlink.net or call me at 972-814-8550.
Kind regards,
Leslie
Hi Leslie -
I used to work for US Risk Insurance Group located in the Lincoln Park Tower at 75 and Northwest Hwy, but recently accepted a position with Atlantic Aviation in Plano. Where in Dallas are you located?
--Sean
Sean,
I just noticed you worked for a company in Dallas. I'm in Dallas. What part of Dallas do you call home?
Leslie
Sean,
Is this still an issue for you? I've read the responses and you have a lot of good ones. I'm confused in that you said the DDL field is over the PONumber. So, how does the value of the ddl field impact the PO Number? I know I'm coming in late to this thread, but the issue as I understand it seems very straightforward.
Kind regards,
Leslie
Hi Sean,
Just to clarify, the value in the "P.O. Number" field (which you renamed to Transaction Type), is getting saved. Is this correct (I'm assuming yes)?
It's just the value of the DDL that isn't getting saved? (again I'm assuming yes).
If this is the case, then you have a couple of options:
1.) As Steve mentions: "Rather than saving the value of the DDL, since it looks like the DDL options are directly correlated with your PO number value, can't you just write script to set the DDL value based on the PO number when a transaction is retrieved".
2.) Actually save the value of the DDL somewhere. Now this could be saved in DUOS objects as I mentioned, or in a custom SQL table as Steve mentioned. Either way, you'll need to save the value of the DDL somewhere (Because GP's Dexterity uses "Save table" commands...and your DDL isn't part of a table, it's just/only a control on a window...hence the value isn't getting saved).
Thanks,
Justin
Hi Steve,
I'm actually the one with the issue. What I did was (at the request of accounting) was create a drop-down list with two items, positioned the DDL field over the PO Number field, then changed the PO Number label to Transaction Type. I also made the PO Number/Transaction Type field required and tied it to the DDL.
In order to get the data in the DDL to be saved to the PM20000 table (for Smartlists and other reports) I chose to copy the value selected in the DDL to the PO Number field.
What's happening now is when the accounting folks in UK enter Payables Transactions, select an option in the drop down, then save the transaction the value in the DDL not being saved, which is the issue I'm trying to solve now.
I'm on a short time schedule so I'm looking for the best option on limited time which still gets the job done.
--Sean
Hi Justin,
Rather than saving the value of the DDL, since it looks like the DDL options are directly correlated with your PO number value, can't you just write script to set the DDL value based on the PO number when a transaction is retrieved?
User enters new PO
Selects from drop down
PO Number value is defaulted by script
User clicks Save
PO Number is saved, DDL value is not saved
User opens existing PO
Script reads PO number value
Script defaults DDL value based on PO number value
Let me know if this might work, or if your process is more complex, requiring the storage of the DDL value.
If you do have to store the DDL value, I would recommend investing a little more time learning how to use a custom SQL table rather than DUOS. A standard SQL table will be easier to query, add to SmartLists, add to reports, etc. I consider DUOS a vestigial feature of GP.
Hi Justin -
I believe you're correct and I downloaded and am referencing the VBADevelopersGuide.pdf but my skill set is still relatively new with working in VBA with Dynamics. I'm also looking through Leslie Vail's "Developing Microsoft Dynamics GP Business Applications" which is also helping.
Thanks,
Sean
Hi Sean,
I believe you'll need to make use of DUOS objects. I recommend you refer to the VBADevelopersGuide.pdf and look at the chapter on "Storing Additional Data".
Thanks,
Justin
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156