Create New Text Field in Microsoft Dynamics Great Plains

I need to know if it is possible to create a new Text field in Great Plains.

Like In screen below, I need a new text field  to fill in with CMA registered title. I know I can use extra field but I need to see if I can add my own field and if yes how!! Screen shot
LVL 1
ramziabkAsked:
Who is Participating?
 
Abdulmalek_HamshoCommented:
The Title is related to the Employee ID, you need to make the Employee ID as your Object Item, as the following:

Private Sub OK_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
    Dim CMATitleCollection As DUOSObjects
    Dim CMATitleObject As DUOSObject

Set CMATitleCollection = DUOSObjectsGet("CMA Title")
Set CMATitleObject = CMATitleCollection.Item(EmployeeID)
CMATitleObject.Properties("Title") = Title
End Sub
0
 
TrackrabbitCommented:
The short answer is "yes", you can add your own custom fields in Great Plains.

As there are multiple ways to do so, I will give a link that outlines your options.

http://www.articlesbase.com/software-articles/microsoft-dynamics-gp-development-dexterity-econnect-extender-1543059.html

Applicable to you:
Dexterity - Flexible but probably more than you. Requires maintaining a customization dictionary which needs to be upgraded with service packs and version releases.

eConnect - Not applicable for this application.

Extender - Doesn't modify existing windows, rather creates a companion window accessible from the  Extras menu. Non-programmer friendly but can expect performance hits.

VBA/Modifier - Although it is a development tool (i.e. for developers) Modifier with VBA is probably the solution that is most viable for your needs. However ... Modifier is an additional purchase from Microsoft (I believe around 3k).


Adam Page
Owner/Principal Consulant - Aperture Dynamics

0
 
Abdulmalek_HamshoCommented:
You would add it using Modifier, then add the functionality using VBA.
Is it clear to you how to do so?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
ramziabkAuthor Commented:
Thanks Abdulmalek. I added the field using modifier. How to add the functionality using VBA?
0
 
Abdulmalek_HamshoCommented:
What functionality? Saving the contents of the field?
0
 
ramziabkAuthor Commented:
Exactly.

As you can see in the attachement, I create the text field under the label CMA Reg. Title. I need to save the data entered into this field.

Thanks
UPR-EMP.bmp
0
 
Abdulmalek_HamshoCommented:
Well, then you need to save the contect and load them back upon fetching the record.

Refer to "VBA Developer's Guide" in Dynamics GP printed manuals, Chapter 6 "Storing Additional Data".
0
 
Abdulmalek_HamshoCommented:
If you're experienced in ADO and VBA, you can avoid using DUOS and create your own tables, save and load the data using ADO.

I recommend using DUOS because you won't be bothered with creating the tables.
0
 
ramziabkAuthor Commented:
Dear Adbulmalek,

Can you please correct my code.I'm getting error Object Required?
1.JPG
0
 
Abdulmalek_HamshoCommented:
Please consider the following:

1- You need to create a DUOS collection that will be used always for storing the employee CMA Reg info.
2- You need to create an object in this collection for every employee you put CMA Reg info for.
3- Place the saving script in OK_BeforeUserChanged, but it might be updating an existing info.
4- You need to place the Retrieval script in EmployeeID_Changed.

Please read the chapter 6 in depth, because it is worth the reading.
0
 
ramziabkAuthor Commented:
AbdulMalek,

I created the below code and place it in the Ok button


Private Sub OK_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
    Dim CMATitleCollection As DUOSObjects
    Dim CMATitleObject As DUOSObject

Set CMATitleCollection = DUOSObjectsGet("CMA Title")
Set CMATitleObject = CMATitleCollection.Item("Title")
CMATitleObject.Properties.Item("Title") = Title
End Sub

If I run select * from SY90000, I'm getting the below result.

ObjectType      ObjectID      PropertyName      PropertyValue      DEX_ROW_ID
CMA Title       Title              Title                                                                               19

But still the value I entered in the title field is not saved!!!!!!!
0
 
Abdulmalek_HamshoCommented:
Try this (removed the double quotes from the line# 7):

Private Sub OK_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
    Dim CMATitleCollection As DUOSObjects
    Dim CMATitleObject As DUOSObject

Set CMATitleCollection = DUOSObjectsGet("CMA Title")
Set CMATitleObject = CMATitleCollection.Item(Title)
CMATitleObject.Properties.Item("Title") = Title
End Sub
0
 
ramziabkAuthor Commented:
Removing the quotes will give me a type mistmatch!
0
 
Abdulmalek_HamshoCommented:
I noticed another error in your code, please try this code:

Private Sub OK_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
    Dim CMATitleCollection As DUOSObjects
    Dim CMATitleObject As DUOSObject

Set CMATitleCollection = DUOSObjectsGet("CMA Title")
Set CMATitleObject = CMATitleCollection.Item(Title)
CMATitleObject.Properties("Title") = Title
End Sub
0
 
ramziabkAuthor Commented:
The code that is working is the below. Removing the quotes from the title will give type mismatch. However what i'm entering in the text box is not saved in sy90000!!!

Private Sub OK_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
    Dim CMATitleCollection As DUOSObjects
    Dim CMATitleObject As DUOSObject

Set CMATitleCollection = DUOSObjectsGet("CMA Title")
Set CMATitleObject = CMATitleCollection.Item("Title")
CMATitleObject.Properties("Title") = Title
End Sub
0
 
Abdulmalek_HamshoCommented:
What's the type of the Title field in your form?
0
 
ramziabkAuthor Commented:
It is a String
0
 
ramziabkAuthor Commented:
Even with Employee ID, still I get Type mismatch

Set CMATitleObject = CMATitleCollection.Item(EmployeeID)
0
 
Abdulmalek_HamshoCommented:
Can you please send me the VBA Error Message?
0
 
ramziabkAuthor Commented:
Kindly find attached print screen of the error.
Thanks
PIC-1.JPG
PIC-2.JPG
0
 
Abdulmalek_HamshoCommented:
I have tested the code I have given to you later (listed below) on GP 10, and it's working perfectly, which GP version do you have?

{

Private Sub OK_BeforeUserChanged(KeepFocus As Boolean, CancelLogic As Boolean)
    Dim CMATitleCollection As DUOSObjects
    Dim CMATitleObject As DUOSObject

Set CMATitleCollection = DUOSObjectsGet("CMA Title")
Set CMATitleObject = CMATitleCollection.Item(EmployeeID)
CMATitleObject.Properties("Title") = Title
End Sub
}
0
 
ramziabkAuthor Commented:
I have also GP version 10.There must be a discrepency between me and you!!!
0
 
Abdulmalek_HamshoCommented:
You added the EmployeeID field from the form to VBA before use it in the above code, right?
0
 
ramziabkAuthor Commented:
Well No I didn't add the Employee ID to VBA before. Now after I added it, I'm not recieving the type mismatch error anymore but still the value in the Title is not saved!!!!!

Now if I run select * from SY90000 I recieve the below:

ObjectType      ObjectID      PropertyName      PropertyValue      DEX_ROW_ID
CMA Title      10012            Title                                                                               31
0
 
Abdulmalek_HamshoCommented:
You also need to add the Title field to VBA.
0
 
ramziabkAuthor Commented:
Now I'm able to insert the value in the SY90000 table. But on GP, the field Title is still empty. I added to the VBA script the below but still can't display the result in the window!!

Private Sub EmployeeID_Changed()
    Dim CMATitleCollection As DUOSObjects
    Dim CMATitleObject As DUOSObject
Set CMATitleCollection = DUOSObjectsGet("CMA Title")
If EmployeeID.Empty = False Then
Set CMATitleObject = CMATitleCollection.Item(EmployeeID)
Title = CMATitleObject.Properties("Title")
End If
End Sub
0
 
Abdulmalek_HamshoCommented:
Put your code in the ""HumanResources_Afteruserchange" event; the spelling is not correct, and you need to add the main window and the Human Resources button to VBA.
0
 
Abdulmalek_HamshoCommented:
Pick up the EmployeeID from the main window if you faced issues.
0
 
ramziabkAuthor Commented:
Thank You Hamsho. Now it is working fine.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.