logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Tuesday, April 21, 2020 9:39:42 AM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
When UPS labels are enabled, you cannot generate a label when marking the shipment as shipped if the product name exceeds 50 characters. Or more specifically, if the total length of all product names on the shipment exceed 50 characters.

The error response is:
Quote:

Ship operation failed for provider 'UPS OnLine® Tools' with error: An error occured while confirming shipment # 1 for order # 135170. Error code: 120503 error message: Shipment Description cannot exceed the length of 50 characters


Technically this is happening in Gold R12 but the AC9 gateway code is identical.

Specifically the problem is in the BuildShipConfirmRequest() routine. You can't use product names as the description for the shipment, it'll just blow the character limit practically every time.

Code:

            // /ShipmentConfirmRequest/Shipment/Description
            string description = string.Empty;
            foreach (OrderItem item in orderShipment.OrderItems)
            {
                if (item.OrderItemType == OrderItemType.Product)
                {
                    if (!string.IsNullOrEmpty(description)) description += ", ";
                    description += item.Name;
                }
            }

            XmlUtility.SetElementValue(shipmentNode, "Description", description, true); 



change the code to this in order to fix the issue:

Code:

            // /ShipmentConfirmRequest/Shipment/Description
            string description = string.Empty;
            foreach (OrderItem item in orderShipment.OrderItems)
            {
                if (item.OrderItemType == OrderItemType.Product)
                {
                    if (!string.IsNullOrEmpty(description)) description += ", ";
                    description += item.Name;
                }
            }
            
            // BEGIN MOD: AbleMods.com
            // DATE:  4-21-2020
            // prevent description from exceeding 50 characters
            description = description.Length <= 50 ? description : description.Substring(0, 50);
            // END MOD: AbleMods.com

            XmlUtility.SetElementValue(shipmentNode, "Description", description, true); 







Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

mazhar  
#2 Posted : Friday, May 1, 2020 6:21:25 PM(UTC)
mazhar

Rank: Administration

Groups: Admin, Administrators, HelpDesk, System, Authorized User, Developers, Registered
Joined: 10/5/2018(UTC)
Posts: 175

Thanks: 8 times
Was thanked: 17 time(s) in 15 post(s)
Thanks for reporting the issue. We will look into this.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.