Solved

Create New Text Field in Microsoft Dynamics Great Plains

Posted on 2011-09-14
29
575 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
  • 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is a walkthrough guide I wrote whilst upgrading my on-premise MS Dynamics CRM 3.0 deployment to 4.0. This covers the actual installation of the product to a working level for my system, I ran into a lot of issues that the steps below fixed so h…
On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now