acumatica - 如何向移动应用程序添加新操作
问题描述
再会
构建 20.107.0026
我创建了一个新操作并希望将其添加到我的移动应用程序中。是否可以向移动屏幕添加自定义操作?我在约会屏幕中创建了以下操作(FS300200)
namespace PX.Objects.FS
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class AppointmentEntry_Extension : PXGraphExtension<AppointmentEntry>
{
#region Event Handlers
public PXAction<PX.Objects.FS.FSAppointment> DoWork;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "DoWork")]
protected void doWork()
{
}
#endregion
}
}
手机代码如下。如果我想将按钮添加到主菜单;侧面的 3 个点我使用 AppointmentRecords 作为容器吗?
update screen FS300200 {
update container "AppointmentRecords" {
add listAction "StartTravelAPICall" {
behavior = Void
displayName = "StartTravelAPICall"
}
}
}
解决方案
The short answer is YES! The long answer depends in part on what version of Acumatica you are using. For the purpose of this answer, I'll assume you are in 2019R2 and already know how to add or edit a Mobile App screen in Acumatica. If not, the training guides referenced below should give you all the detailed information you need to accomplish your goal.
Manipulating the Mobile App screens/actions is relatively easy if the screen/action works in the browser interface. The T410 course material explains how to add an action in 2019R2. I don't work with Field Services, so I'll have to explain more generically as per the training guide.
First you must either add or edit the screen in the Mobile Application section of the Customization Project. (In your case, you want to Update the existing screen.) This will create a section of code in the customization project that looks like this:
As you can see, the original screen definition in the mobile app is shown on the right, and you will be updating the screen to add your action. You will need to add the appropriate container (not shown in your question) and then the action within that container.
To continue the answer, let's switch to the training guide example on page 12 of the T410 course updating the SO303000 screen. You can compare to your screen to see what needs to be changed.
add container "InvoiceSummary" {
# fields declaration
…
add recordAction "Save" {
behavior = Save
}
add recordAction "Cancel" {
behavior = Cancel
}
add containerAction "Insert" {
behavior = Create
}
add recordAction "ReleaseAction" {
syncLongOperation = true
behavior = Record
}
}
I believe your action would follow the ReleaseAction portion at the bottom of the example, and the need for syngLongOperation = true would depend on what your action is doing (i.e. if you need the action performed asynchronously).
Assuming your container is already defined in the page, which I suspect it is, let's instead look at the example for PO302000 on page 35. This example shows how to UPDATE a container to add your action.
update screen PO302000 {
update container "DocumentSummary" {
add recordAction "AddPOOrderLine" {
displayName = "Add PO Line"
behavior = Void
redirect = True
redirectToContainer = "AddPurchaseOrderLine$List"
}
}
}
That was a more complex action, but yours may be as simple as.
update screen FS300200 {
update container "ServiceOrderTypeLine" {
add listAction "DoWork" {
Behavior = Void
displayName = "Do Work"
}
}
}
If you need guidance on how to read the WDSL Schema to identify the container, etc. that training is found in T400 starting on Page 13.
I highly recommend reviewing both T400 and T410 if you are working with the mobile app as there is a lot more detail in those training guides than can be explained easily in a Stack Overflow post/answer.
推荐阅读
- php - 我的网站的联系表无法在 php 中运行
- powerbi - 基于另一列的条件计算
- python - 在“a”标签下提取“href”
- python - gremlinpython - 你如何在 graph_traversal 中选择(键)?
- webpack - Webpack Parse Error: Unexpected token (8:2) 你可能需要一个合适的加载器来处理这个文件类型
- git - 如何正确配置 git 子模块
- scala - 如何将 List[List[Long]] 转换为 List[List[Int]]?
- c# - RestSharp 响应内容始终为空,但仍记录 Execute
- mysql - 从 MySQL 中的表行获取日期时间
- javascript - 如何解决 Firebase 异步函数调用以使其同步运行?