Select to view content in your preferred language

Help with Specialties

884
1
05-26-2010 07:07 AM
JoshHandler
Emerging Contributor
I am trying to get build a custom import into AL.  I have every field I need "mapped" through the process except the Specialties fields.  I know it needs to be an Editable Collection, but I tried everyway possible to get this to add.  I have listed some of my code below.  I have left the commented lines in where I was testing different scenarios.  I know the orderParam is working because I have used that for time windows, etc.  Any help on this is greatly appreciated.

                    Dim orderParam As IALRoutingParams = DirectCast(porder, IALRoutingParams)

                    'Dim spec As IALEditableCollection
                    Dim spec As ALCollection


                    spec = orderParam.Specialties

                    spec.Add("BU")

                    'spec.Add("123")
                    'spec.Add("456")

                    orderParam.Specialties.Add("123")
                    orderParam.Specialties.Add("456")

Thanks,
Josh
0 Kudos
1 Reply
JeffWickstrom
Esri Contributor
Hello Josh,

You want to add the specific specialty instance instead of adding it by name.

1) Get the Specialties collection from the ALProject.
2) Find the one you want in there (i.e. by comparing names).
3) Add that one you found to the Order Specialties collection.

Jeff
0 Kudos