Change prompt character for a custom table key field - acumatica

How can I change the prompt character for the key field for my custom table. The only way I know how to change it is to change the segmented key, but since this is a custom table, there is none. Do I have to create one and tie it to my new table? If so, how do I do that? Is there a parameter in the IsKey?

You want to look into InputMask and DisplayMask attribute property.
[PXDBString(10, IsUnicode = true, IsKey = true, InputMask = ">aaaaaaaaaa")]
Example of use:
InputMask = ">LLLLL"
InputMask = ">aaaaaaaaaa"
InputMask = ">CC.00.00.00"
Full documentation of this feature can be found here:
https://help.acumatica.com/Main?ScreenId=ShowWiki&pageid=d0758787-4c73-423b-8566-11c83f3acde8

Related

Sorting data in PXSelector

I'm using this selector and i want to sort (Asc) by LineNbr
PXSelector(typeof(Search<Choixfournisseur.inventoryCD, Where<Choixfournisseur.reqNbr, Equal<Current<Choixfournisseur.reqNbr>>>,**OrderBy<Asc<Choixfournisseur.lineNbr>>**>), new Type[] { typeof(Choixfournisseur.lineNbr), typeof(Choixfournisseur.orderQty),typeof(Choixfournisseur.itemDesc),typeof(Choixfournisseur.curyEstUnitCost),typeof(Choixfournisseur.curyEstExtCost),typeof(Choixfournisseur.inventory) },ValidateValue = false, Filterable = true)]
But it doesnt work
enter image description here
Thanks for your feedback
A workaround you can do, is that you can create a projection which is ordered by the LineNbr field. In the selector you can reference the projection instead of the Main DAC. The selector should then reflect the results as you want them.

PO Line Account selector selection doesn't display in field

I have a customization that overrides the Purchase Order Line Account field drop-down lookup selector on the Purchase Order screen. It populates like I want, but the account selected from the dropdown doesn't display in the grid field after chosen. Here it is:
[PXSelector(
typeof(Search5<Account.accountID,
InnerJoin<PMCostBudget, On<Account.accountGroupID, Equal<PMCostBudget.accountGroupID>>>,
Where2<Where<PMCostBudget.projectID, Equal<Current<POLine.projectID>>, Or<Current<POLine.projectID>, IsNull>>,
And2<Where<PMCostBudget.projectTaskID, Equal<Current<POLine.taskID>>, Or<Current<POLine.taskID>, IsNull>>,
And2<Where<PMCostBudget.costCodeID, Equal<Current<POLine.costCodeID>>, Or<Current<POLine.costCodeID>, IsNull>>,
And<Where<Current<POLine.lineType>, Equal<POLineType.nonStock>, Or<Current<POLine.lineType>, IsNull>>>>>>,
Aggregate<GroupBy<Account.accountID>>,
OrderBy<Asc<Account.accountCD>>>),
DescriptionField = typeof(Account.description),
Filterable = false,
SelectorMode = PXSelectorMode.DisplayModeValue
)]
It basically filters on the line type, project, task, and cost code selected on the same PO line. What am I missing or doing wrong so that the selected AccountCD value will display?
Assuming the rest of your customization properly handled the override and the selector itself works (I think that is what you are saying)... If you need to display AccountCD, you should add SubstituteKey = typeof(Account.accountCD). Without that, the selector is set right now to display the AccountID.
[PXSelector(
typeof(Search5<Account.accountID,
InnerJoin<PMCostBudget, On<Account.accountGroupID, Equal<PMCostBudget.accountGroupID>>>,
Where2<Where<PMCostBudget.projectID, Equal<Current<POLine.projectID>>, Or<Current<POLine.projectID>, IsNull>>,
And2<Where<PMCostBudget.projectTaskID, Equal<Current<POLine.taskID>>, Or<Current<POLine.taskID>, IsNull>>,
And2<Where<PMCostBudget.costCodeID, Equal<Current<POLine.costCodeID>>, Or<Current<POLine.costCodeID>, IsNull>>,
And<Where<Current<POLine.lineType>, Equal<POLineType.nonStock>, Or<Current<POLine.lineType>, IsNull>>>>>>,
Aggregate<GroupBy<Account.accountID>>,
OrderBy<Asc<Account.accountCD>>>),
SubstituteKey = typeof(Account.accountCD),
DescriptionField = typeof(Account.description),
Filterable = false,
SelectorMode = PXSelectorMode.DisplayModeValue
)]
On PXSelector, the first "typeof" is the value to be selected. You can add subsequent typeof() references if you want to designate fields to display in the PXSelector (if your intent is to display an actual selector).
SubstituteKey = typeof(DAC Field) alters the selector's display to show the designated field rather than the actual value. It is very common to select the recordID field and substitute the recordCD field.
DescriptionField displays the field designated after the displayed valued (the specifically selected field or the SubstituteKey field if specified). I could be wrong, but I don't believe this shows when the selector is displayed in a grid. I believe it only applies to form fields, such as if you toggle the grid row to a form view.
Filterable is optional, but it allows you to set filters in the selector, such as when you have a lot of records to retrieve and may want to quickly locate a value. I believe there is some overhead to using it, so setting to false as you did could be a tiny performance gain.
I never used SelectorMode before, so you taught me something new here! If adding SubstituteKey does not resolve your issue, you might try removing the SelectorMode line to see if that resolves your issue. By the way it reads, that could be changing the behavior of the selector from what I would expect.
Acumatica support's suggestion solved my problem. Since the Account id is a segmented key, I needed to manually change the PXSegmentedValue to a PXSelector in the .ASPX to get it to work. I also got it to work without that change by using a PXDimensionSelector instead of a plain PXSelector in the override.
[PXDimensionSelector(AccountAttribute.DimensionName,
typeof(Search5<Account.accountID>...

Dynamically changing field's DisplayName affests web service

The field in the DAC is defined like this.
#region NextMonthHours
[PXDBDecimal(2, MinValue = 0.0, MaxValue = 280.0)]
[PXUIField(DisplayName = "Next Month Hours")]
[PXDefault(TypeCode.Decimal, "0.0")]
public virtual Decimal? NextMonthHours { get; set; }
public abstract class nextMonthHours : PX.Data.BQL.BqlDecimal.Field<nextMonthHours> { }
#endregion
I change the display name of the field in RowSelected event.
PXUIFieldAttribute.SetDisplayName<EVEPPlannedHoursDetails.nextMonthHours>(sender, nextMonth+"Hours");
where nextMonth is "February".
I need to add this field to Acumatica Mobile Screen. When I go to web service schema the field name is "FebruaryHours"
<s:element minOccurs="0" maxOccurs="1" name="FebruaryHours" type="tns:Field"/>
I cannot use the name "FebruaryHours" because it changes every month but I also when I use field name NextMonthHours it is not added in the mobile screen.
Any idea how to solve this issue?
Thanks
There's quite a few ways to workaround this depending on the use case and whether the label value is static or dynamic.
If all you want to do is to change a static label in UI without having to change the display name property you can add a separate label and merge group.
Here's an example to change Billable in UI without changing DisplayName property using that technique.
Set SuppressLabel property to true to hide the original label bounded to DisplayName on UI.
Use ADD CONTROLS tab to add a Layout Rule with Merge property set to true.
Use ADD CONTROLS tab to add a label control in the merged group.
Put the original field in the merge group so they show up together on the same line in UI.
End result, label is now a UI control and wouldn't interfere with DisplayName property.

Why is my selector not selecting a record in my customized screen? Am I missing something? Acumatica

Here is My DAC Field for the Selector.
It seems fine on the first run, but when I select through the selector, its just blinks, or nothing happens, but when I nagivate through the next and previous buttons it selects the records.
#region RQBatchNbr
[PXDBString(15, IsKey =true, InputMask ="")]
[PXDefault()]
[PXUIField(DisplayName = "Batch Nbr", Required = true)]
[PXSelector(
typeof(Search<GNRequest.rQBatchNbr>),
typeof(GNRequest.prefixCode),
typeof(GNRequest.description),
DescriptionField = typeof(GNRequest.description)
)]
[AutoNumber(
typeof(Search<GNSetup.requestBatchNumberingID>),
typeof(AccessInfo.businessDate)
)]
#endregion
One reason can be that you have forgotten setting IsUnicode = true in the PXDBStringAttribute.
Another one can be related to the typeof(AccessInfo.businessDate) in the AutoNumberAttribute. Try adding Date field to your DAC and passing him instead of AccessInfo.businessDate.
It seems a little weird, but I just Redo the whole ASPX Page. it turns out to be working as it is.

Transaction Number / Invoice Number Length limit

I am working with the Acumatica Webservice as described here.
http://www.acumatica.com/technical-tuesday-doug-johnson-connecting-website-acumatica/
I would link to know about the field length limitations for the system.
I have reviewed the "Segmented Keys" where we can set the GL Account length.
as mentioned in
http://acumaticaopenuniversity.com/pdf/F100_Financials_Basic_Guide_5_0.pdf#page=15&zoom=auto,56.692,738.698
Thank you
If you are looking for the max length for any field in acumatica, what you can do is that go to the DAC definition and see the PXDB
Eg: For invoice reference number, youcan see the type is string and the max length is 15 from the below info.
DAC: ARInvoice, Property: RefNbr
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask =
">CCCCCCCCCCCCCCC")]

Resources