Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Contributor
skysider
Posts: 47
Registered: 05-16-2011
0

How to create UDT with multiple key fields ?

Hi,

 

I want to do some customization in MAS90, for which it is required to create a UDT which has multiple key fields but the problem is that MAS90 does not allow more than one primary key field for a UDT. It is very common in database tables to have composite keys, I am confused why MAS90 does not meet this industry standard... anyway is there any way to accomplish this task ?

 

Any help would be appreciated...

 

 

I am using MAS90 v4.40

Super Contributor
DFeller
Posts: 2,944
Registered: 10-28-2008

Re: How to create UDT with multiple key fields ?

You are correct, multiple keys in a UDT is not available.

 

You could use a sequence number as a key then add your fields however they would not be keys.

 

Dawn

Moderator
SRYork
Posts: 125
Registered: 11-06-2009
0

Re: How to create UDT with multiple key fields ?

[ Edited ]

Sorry, I am not familiar with the ins and outs of UDT's.  You might try posting this on the Personalization, Customization and Productivity Tools http://community.sagemas.com/t5/Personalization-Customization/bd-p/Pers_Cust_Brd forum to get more info.

GatorGal
Regular Contributor
T-Man
Posts: 58
Registered: 10-29-2008
0

Re: How to create UDT with multiple key fields ?

Skysider,

Just a note. UDT is a User Defined Table and therefore is limited to what can be done to make it easier for a user to create. Although this function could be added it doesn't mean that "MAS90 does not meet this industry standard". It means they do not allow this function in a end user function.

 

MAS90 does have many Multikey tables. AR_Customer has:

KPRIMARY: ARDivisionNo+CustomerNo

KNAME: CustomerName+ARDivisionNo+CustomerNo

KSORT: SortField+ARDivisionNo+CustomerNo

KSALESPERSON: ARDivisionNo+SalespersonNo+CustomerNo

KTYPE: CustomerType+ARDivisionNo+CustomerNo

KZIPCODE: ZipCode+ARDivisionNo+CustomerNo

KTELEPHONE: TelephoneNo+ARDivisionNo+CustomerNo

KCUSTOMERNO: CustomerNo

KADDRESS1: AddressLine1+ARDivisionNo+CustomerNo

KADDRESS2: AddressLine2+ARDivisionNo+CustomerNo

KADDRESS3: AddressLine3+ARDivisionNo+CustomerNo

 

What is it that you wish to accomplish with the multikey and maybe there could be another way to acomplish it. Otherwise a developer could assist in the modification you need.

Todd Martin
-MCSE


Member of 90minds http://www.90minds.com.
Sage Employee
jepritch
Posts: 237
Registered: 08-25-2009
0

Re: How to create UDT with multiple key fields ?

As Dawn stated, multi-keyed UDT's are not available at this time.  Sometimes you can just create a key field that contain all of these key elements.  Create the key as UDTKeyField$ and then read/write to it using all the components of the key concatenated together.  Then include the key fields as discrete other fields if you want and need them separately.

 

Example:

 

Say, you want to create a UDT by vendor by project.  You could create the following in the table:

 

VdrProjKey$ <----- Primary Key: APDIvisionNo$+VendorNo$+ProjectCode$

APDivisionNo$

VendorNo$

ProjectCode$

ProjectDesc$

 

 

Hope this helps

Elliott