Solved

Extend Field Length

  • 16 December 2021
  • 16 replies
  • 1135 views

Userlevel 4
Badge

Trying to extend the length of the UOM field in Acumatica and not having much success. I’ve done the following(This UOM field references INUnit.ToUnit which was previously customized by another developer to extend the field length.):

Add the column length increase DB script:
 

That however did not increase the length in the DB so I increased in manually.

But I still got this error on the field I’m trying to customize:
 

 

 

So in addition I tried option two from this article: Extend Address Line length - Acumatica Developers Blog

and got this error:

 

icon

Best answer by Naveen Boga 19 December 2021, 00:12

View original

16 replies

Userlevel 5
Badge +1

@Freeman Helmuth It seems like you have just altered the field in the DB, you need to extend the DAC field as well to get the expected result. 

Userlevel 7
Badge +19

Hi @Freeman Helmuth  If you are modifying the length of TOUnit in INUNIT table, how to it will work for the other tables UOM? 

You will need to override every single DAC, alter every single tab where the UOM is referenced to change the length. With every new update you will need to review all these customizations.

UOM field is available in around 125 tables , here is the table names for your reference.

AMBomMatl
AMClockItem
AMClockTran
AMClockTranSplit
AMConfigResultsOption
AMConfigurationOption
AMConfigurationResults
AMEstimateItem
AMEstimateMatl
AMFeatureOption
AMForecast
AMForecastStaging
AMMPS
AMMTran
AMMTranSplit
AMOrderCrossRef
AMProdItem
AMProdItemSplit
AMProdMatl
AMProdMatlSplit
AMRPDetail
AMRPPlan
AMVendorShipLine
AMVendorShipLineSplit
AMWrkMatl
APPriceWorksheetDetail
APTax
APTran
APVendorPrice
ARPriceWorksheetDetail
ARSalesPrice
ARTax
ARTran
CAExpenseTax
CarrierPlugin
CASplit
CATax
CommonSetup
ContractDetail
CROpportunityProducts
CROpportunityTax
CRTaxTran
DiscountItem
DiscountSequenceDetail
DRScheduleDetail
EPExpenseClaimDetails
EPTax
EPTaxAggregate
EPTaxTran
EPTimeCardItem
FAServiceSchedule
FAUsage
FAUsageSchedule
FlatPriceItem
FSAppointmentDet
FSAppointmentTax
FSAppointmentTaxTran
FSApptLineSplit
FSBranchLocation
FSContractPeriodDet
FSSalesPrice
FSServiceOrderTax
FSServiceOrderTaxTran
FSSODet
FSSODetSplit
GLTax
GLTran
INCartSplit
INComponent
INItemBox
INItemXRef
INKitSpecNonStkDet
INKitSpecStkDet
INRelatedInventory
INReplenishmentLine
INTran
INTranSplit
InventoryItem
InventoryItemDetails
PMBudget
PMChangeOrderBudget
PMChangeOrderLine
PMChangeRequestLine
PMCommitment
PMCostProjectionLine
PMDetail
PMProformaLine
PMRecurringItem
PMSetup
PMTax
PMTaxTran
PMTran
POAccrualSplit
POAccrualStatus
POLandedCostReceiptLine
POLandedCostTax
POLandedCostTaxTran
POLine
POLineBillingRevision
POReceiptLine
POReceiptLineSplit
PortalCardLines
PortalSetup
POTax
POTaxTran
POVendorUOMXRef
RQBidding
RQRequestLine
RQRequisitionLine
SOLine
SOLineSplit
SOPackageDetail
SOPackageDetailSplit
SOPackageInfo
SOPickerListEntry
SOPickingWorksheetLine
SOPickingWorksheetLineSplit
SOShipLine
SOShipLineSplit
SOShipLineSplitPackage
SOTax
SOTaxTran
Tax
TaxTran
Vendor

 

Userlevel 4
Badge

@Naveen B Yes this is what we are doing, and we have all those other tables done already. Like I said, this is a field the previous developer missed when doing those, and I can’t figure out how to extend this one.

 

I’ve modified the DAC with the following: 

 

But then I get this error:

 

 

And FYI: It is worth it to us. We have many different UOMs that we use to count and to receive in. Honestly its a bit ridiculous that Acumatica has this restriction. I have an open feature request for it.

Userlevel 7
Badge +19

Hi @Freeman Helmuth  Understood.

As I see the error message, it is NOT an issue with the length but it is the issue casting from DECIMAL to STRING.

In your code, you might assigning the DECIMAL value to the UOM string field.

Userlevel 4
Badge

@Naveen B  So it seems.

However this error occurs when doing nothing but the following in a customization:
Add the database script to extend the DB field:

Using:

[PXRemoveBaseAttribute(typeof(PXDBStringAttribute))]
[PXDBString(80, IsUnicode = true)]

to modify the DAC:
 

 

My DACs show customized properly in the DAC browser and the field lengths show correct-so why this odd error?

Userlevel 7
Badge +11

Hi @Freeman Helmuth 

I tried to use the  Increase Column length option under the Database script  to increase the field length of the UOM field from the AMBomMatl table. Not getting any error. Its working fine. May be causing issue with some other customization. Can you please cross check the customization once?

 

Userlevel 4
Badge

Hi @Freeman Helmuth 

I tried to use the  Increase Column length option under the Database script  to increase the field length of the UOM field from the AMBomMatl table. Not getting any error. Its working fine. May be causing issue with some other customization. Can you please cross check the customization once?

 

you have to customize the DAC as well

Do that and let me know what your results are

Userlevel 7
Badge +19

Hi @Freeman Helmuth  I have tried your requirement and yes, when I use the CacheAttached I also get the same, which you are getting casting issue.

Then I dig deep and observed that this is not with other customizations and causing this with the CacheAttached event.

Here are more details.

  • INUnit DAC → ToUnit Field, used INUnitAttribute and there is logic related unit conversions, we can not simply replace with the PXDBString(80, Isunicode = true)
  • Due to the some calculations in the INUnitAttribute, hence getting the Casting i.e. Decimal to String.
  • I will recommend you to raise a support ticket to increase the length of INUnitAttribute 

 

Got the same issue when I use the CacheAttached

 

Used INUnit Attribute but not the PXDBString

 

INUnitAttrbute code

 

Userlevel 3
Badge

@Naveen Boga Hi! I’m trying to follow the thread above and have a quick question. My client has multiple custom fields and the Database Script is set to 150 character length but the system won’t let him save anything longer than 25 characters. Will this “Increase Column Length” feature solve this issue?

Userlevel 7
Badge +19

Hi, @cshaheen26  It might be mentioned 150 databases BUT have you also checked in the DAC level size?

 

I’m assuming that they might be provided only 25 characters in the DAC level. Please do verify and confirm.

Userlevel 3
Badge

@Naveen Boga It was that we needed to also Increase the Column Length in the Database Script. I guess the code under Data Access didn’t work on its own.

Thanks for the quick response :)

Userlevel 7
Badge +19

If you increase the Column Length from the customization package, the size will be increased only in the Database but NOT at the DAC.

Make sure DAC size and Database size should be the same.

Userlevel 1

@Naveen Boga I updated the Database Script to increase the Column Length, but how do I increase the DAC size. I am not sure I see how to do it from the above thread.

Userlevel 2
Badge

@Freeman Helmuth  any luck on the casting error? I am getting same error when trying to extend attribute value field

Userlevel 4
Badge

@woodyg84  not sure that I’m the right person to answer on this. Can you post the code you’ve tried and maybe Naveen can give some input.

Userlevel 2
Badge

@Naveen B  So it seems.

However this error occurs when doing nothing but the following in a customization:
Add the database script to extend the DB field:

Using:

[PXRemoveBaseAttribute(typeof(PXDBStringAttribute))]
[PXDBString(80, IsUnicode = true)]

to modify the DAC:
 

 

My DACs show customized properly in the DAC browser and the field lengths show correct-so why this odd error?

I was doing similar steps like you did, and get same error you got, that is how I found this post. Did you solved the issue later on?

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved