Solved

Create New Text Field in Microsoft Dynamics Great Plains

Posted on 2011-09-14
29
603 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:ramziabk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 15
  • 13
29 Comments
 
LVL 2

Expert Comment

by:Trackrabbit
ID: 36536296
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
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36537757
You would add it using Modifier, then add the functionality using VBA.
Is it clear to you how to do so?
0
 
LVL 1

Author Comment

by:ramziabk
ID: 36553544
Thanks Abdulmalek. I added the field using modifier. How to add the functionality using VBA?
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36553983
What functionality? Saving the contents of the field?
0
 
LVL 1

Author Comment

by:ramziabk
ID: 36553996
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
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36554016
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
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36554024
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
 
LVL 1

Author Comment

by:ramziabk
ID: 36556496
Dear Adbulmalek,

Can you please correct my code.I'm getting error Object Required?
1.JPG
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36557234
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
 
LVL 1

Author Comment

by:ramziabk
ID: 36565708
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
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36566023
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
 
LVL 1

Author Comment

by:ramziabk
ID: 36567679
Removing the quotes will give me a type mistmatch!
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36569017
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
 
LVL 1

Author Comment

by:ramziabk
ID: 36572000
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
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36572960
What's the type of the Title field in your form?
0
 
LVL 1

Author Comment

by:ramziabk
ID: 36573055
It is a String
0
 
LVL 10

Accepted Solution

by:
Abdulmalek_Hamsho earned 500 total points
ID: 36573087
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
 
LVL 1

Author Comment

by:ramziabk
ID: 36716167
Even with Employee ID, still I get Type mismatch

Set CMATitleObject = CMATitleCollection.Item(EmployeeID)
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36716614
Can you please send me the VBA Error Message?
0
 
LVL 1

Author Comment

by:ramziabk
ID: 36716925
Kindly find attached print screen of the error.
Thanks
PIC-1.JPG
PIC-2.JPG
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36720497
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
 
LVL 1

Author Comment

by:ramziabk
ID: 36895703
I have also GP version 10.There must be a discrepency between me and you!!!
0
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36896019
You added the EmployeeID field from the form to VBA before use it in the above code, right?
0
 
LVL 1

Author Comment

by:ramziabk
ID: 36896350
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
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36896906
You also need to add the Title field to VBA.
0
 
LVL 1

Author Comment

by:ramziabk
ID: 36899099
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
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36899608
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
 
LVL 10

Expert Comment

by:Abdulmalek_Hamsho
ID: 36899609
Pick up the EmployeeID from the main window if you faced issues.
0
 
LVL 1

Author Comment

by:ramziabk
ID: 36901903
Thank You Hamsho. Now it is working fine.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question