Solved

Ability to Add Selector to Custom Field in Mobile Application

  • 12 September 2022
  • 4 replies
  • 167 views

Userlevel 4
Badge +1

Hello,

Has anyone had any success in getting a selector to work on a custom field added to the mobile application? I have added the field successfully, however, it is giving me a weird dropdown arrow instead of directing me to a selector screen like I would expect (similar to “Employee” field above it).

My code:

update screen PJ304000 {
update container "LaborTimeAndActivities" {
fieldsToShow = 7
add field "EquipmentID"{
placeAfter field "Employee"
}
}
}

Mobile view:

Application View:

 

icon

Best answer by rhooper91 12 September 2022, 23:17

View original

4 replies

Userlevel 5
Badge +2

@rhooper91

Try something like this

update screen PJ304000 {
update container "LaborTimeAndActivities" {
fieldsToShow = 7
add field "EquipmentID"{
      selectorDisplayFormat = KeyDescription
      pickerType = Searchable
      weight = 2
      selector {
       add field "EquipmentID"
       add field "[Your Description (if you have one)]"
    }
placeAfter field "Employee"
}
}
}

 

 

Userlevel 4
Badge +1

@Fernando Amadoz

I just attempted this. Replaced “EquipmentID” and “Description” in your brackets and I’m still getting the same functionality.

Updated Mobile Code:

update screen PJ304000 {
update container "LaborTimeAndActivities" {
fieldsToShow = 7
add field "EquipmentID"{
selectorDisplayFormat = KeyDescription
pickerType = Searchable
weight = 2
selector {
add field "EquipmentID"
add field "Description"
}
placeAfter field "Employee"
}
}
}

 

Could it have something to do with the way I defined the DAC extension? See below for my field code:

    #region UsrEquipmentID
[PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
[PXDBInt()]
[PXUIField(DisplayName = "Equipment ID")]
[PXSelector(typeof(Search<EPEquipment.equipmentID, Where<EPEquipment.status, Equal<EPEquipmentStatus.EquipmentStatusActive>>>), SubstituteKey = typeof(EPEquipment.equipmentCD), DescriptionField = typeof(EPEquipment.description))]
public virtual int? UsrEquipmentID { get; set; }
public abstract class usrEquipmentID : PX.Data.BQL.BqlInt.Field<usrEquipmentID> { }
#endregion

 

Userlevel 4
Badge +1

Ok… this was a bit of a monster. You have to add levels to the grid. By default it shows as a grid control. You then need to add it as a selector control type.

Userlevel 7
Badge

Thank you for sharing your solution with the community @rhooper91 !

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