Acumatica移动端Appointments添加自定义Action遇阻求助
问题:Acumatica移动端无法显示自定义Action按钮
我已完成T400和T410培训,在FS300200页面添加了自定义Action,功能为调用外部Web应用填写表单、生成PDF并附加到预约记录中,该功能在Web端ERP运行正常,但移动端应用里始终看不到这个Action按钮。
自定义Action后端代码(简化版)
#region XForm Button public PXAction<FSAppointment> asgExtForms; [PXUIField(DisplayName = "DoorForm", MapEnableRights = PXCacheRights.Select)] [PXButton] public virtual void ASGExtForms() { var allCaches = Base.Caches.Caches; // 根据缓存内容拼接完整URL string fullURL = "SOME VALUE BASED ON CACHE"; // 跳转至外部Web应用 var redirectException = new PXRedirectToUrlException(fullURL, PXBaseRedirectException.WindowMode.New, "Acumatica.com"); throw redirectException; } #endregion
两次尝试的问题
第一次尝试(语法报错)
尝试新增标签页放置Action,执行时出现错误:
第19行:无法在当前上下文使用entity type 'listAction'。
使用的移动端标记代码:
update screen FS300200 { update container "AppointmentRecords" { add layout "ASG" { displayName = "ASG" layout = "Tab" add group "DoorForms" { displayName = "DoorForms" collapsable = True collapsed = True add layout "ASGLine" { displayName = "WebForm" layout = "Inline" add field "OtherSourceInfoDocumentType#ReferenceNbr" add recordAction "ASGExtForms" { Behavior = Void displayName = "DoorForms" redirect = True } } } } } }
第二次尝试(无报错但不显示)
调整代码后无语法错误,但发布后移动端界面仍未显示该Action:
update screen FS300200 { update container "AppointmentRecords" { update layout "AdditionalTab" { add layout "ASGLine" { add recordActionLink "ASGExtForms" } } add recordAction "ASGExtForms" { displayName = "DoorForms" behavior = Void } } }
问题分析与修复方案
1. 第一次报错原因
移动端标记语法中,recordAction属于容器级别的定义,不能嵌套在layout或group节点内部,必须直接定义在container下,再通过recordActionLink在布局中引用。
2. 第二次不显示的原因
- 未为
recordAction指定redirect = True属性,移动端无法识别该Action的跳转逻辑; recordActionLink的布局结构可能未被正确渲染。
正确的移动端标记代码
update screen FS300200 { update container "AppointmentRecords" { // 1. 先在容器下定义recordAction,明确跳转属性 add recordAction "ASGExtForms" { displayName = "DoorForms" behavior = Void redirect = True } // 2. 在现有标签页中添加Action链接 update layout "AdditionalTab" { add layout "ASGActionRow" { layout = "Inline" add recordActionLink "ASGExtForms" { displayName = "DoorForms" } } } } }
额外检查项
- 确认自定义DLL已部署到移动端应用的服务器;
- 验证移动端发布配置包含了你的自定义项目;
- 检查Action的权限设置(
MapEnableRights/MapViewRights),确保移动端用户有访问权限。
内容的提问来源于stack exchange,提问作者MarkJoel60
相关产品推荐
相关产品推荐

