英文:
Need To Add Custom Action to Acumatica Mobile Application in Appointments
问题
I have been through the Training T400 and T410, but I cannot get this to work in my own application. 我已经完成了T400和T410的培训,但我无法使它在我的应用程序中工作。
I have a custom action that I have added to FS300200. This will call out to an external web application to allow a form to be filled out, which will eventually generate a PDF that gets attached to the appointment. 我有一个自定义操作,我已添加到FS300200。这将调用外部Web应用程序,允许填写表单,最终生成附加到约会的PDF。
It is working fine in the web ERP. But I do not know how to get this new button (action) to work in the mobile app. 它在Web ERP中运行良好。但我不知道如何在移动应用程序中使这个新按钮(操作)工作。
This is the definition of the action in my custom DLL (slightly stubbed out): 这是我自定义DLL中操作的定义(稍微修剪了一下):
#region XForm Button
public PXAction
[PXUIField(DisplayName = "DoorForm", MapEnableRights = PXCacheRights.Select)]
[PXButton]
public virtual void ASGExtForms()
{
var allCaches = Base.Caches.Caches;
/************************************************
* Code builds full url based on what is found in cache
************************************************/
string fullURL = "SOME VALUE BASED ON CACHE";
// Everything is gathered up. Time to send it
var redirectException =
new PXRedirectToUrlException(fullURL,
PXBaseRedirectException.WindowMode.New, "Acumatica.com");
throw redirectException; // call URL
}
#endregion
[EDIT]
I have recently tried this code to update the mobile app. It does not give a syntax error, but when I publish it, I do not see any action added to the Mobile screen: [编辑] 我最近尝试了这段代码来更新移动应用程序。它不会报语法错误,但当我发布它时,我看不到任何添加到移动屏幕的操作:
update screen FS300200
{
update container "AppointmentRecords"
{
update layout "AdditionalTab"
{
add layout "ASGLine"
{
add recordActionLink "ASGExtForms"
}
}
add recordAction "ASGExtForms"
{
displayName = "DoorForms"
behavior = Void
}
}
}
[END EDIT] [编辑结束]
[ORIGINAL ATTEMPT]
In my customization, I am trying to modify the Mobile Application's FS300200: [原始尝试] 在我的自定义中,我试图修改移动应用程序的FS300200:
This is the mobile markup I am trying: 这是我尝试的移动标记:
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
}
}
}
}
}
}
but I get an error: 但是我收到一个错误:
Line 19: Can't use entity type 'listAction' in current context. 第19行: 无法在当前上下文中使用实体类型'listAction'。你缺少一些东西吗?
英文:
I have been through the Training T400 and T410, but I cannot get this to work in my own application.
I have a custom action that I have added to FS300200. This will call out to an external web application to allow a form to be filled out, which will eventually generate a PDF that gets attached to the appointment.
It is working fine in the web ERP. But I do not know how to get this new button (action) to work in the mobile app.
This is the definition of the action in my custom DLL (slightly stubbed out):
#region XForm Button
public PXAction<FSAppointment> asgExtForms;
[PXUIField(DisplayName = "DoorForm", MapEnableRights = PXCacheRights.Select)]
[PXButton]
public virtual void ASGExtForms()
{
var allCaches = Base.Caches.Caches;
/************************************************
* Code builds full url based on what is found in cache
************************************************/
string fullURL = "SOME VALUE BASED ON CACHE";
// Everything is gathered up. Time to send it
var redirectException =
new PXRedirectToUrlException(fullURL,
PXBaseRedirectException.WindowMode.New, "Acumatica.com");
throw redirectException; // call URL
}
#endregion
[EDIT]
I have recently tried this code to update the mobile app. It does not give a syntax error, but when I publish it, I do not see any action added to the Mobile screen:
update screen FS300200
{
update container "AppointmentRecords"
{
update layout "AdditionalTab"
{
add layout "ASGLine"
{
add recordActionLink "ASGExtForms"
}
}
add recordAction "ASGExtForms"
{
displayName = "DoorForms"
behavior = Void
}
}
}
[END EDIT]
[ORIGINAL ATTEMPT]
In my customization, I am trying to modify the Mobile Application's FS300200:
This is the mobile markup I am trying:
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
}
}
}
}
}
}
but I get an error:
Line 19:
Can't use entity type 'listAction' in current context.
What am I missing?
答案1
得分: 0
Just for anyone else trying to do this...
一个操作与添加其他元素是不同的明显。
这是将其添加到屏幕所需的全部内容:
update screen FS300200
{
update container "AppointmentRecords"
{
add recordAction "ASGExtForms"
{
behavior = void
redirect = True
}
}
}
请注意,recordAction 名称与 DAC 中的值相同,而不是显示名称(通常使用的是显示名称,但这里不同,因为它是一个操作...)
[PXUIField(DisplayName = "DoorForm", MapEnableRights = PXCacheRights.Select)]
[PXButton]
public virtual void ASGExtForms()
英文:
Just for anyone else trying to do this...
An action is different than adding other things apparently.
This is all that was necessary to add it to the screen:
update screen FS300200
{
update container "AppointmentRecords"
{
add recordAction "ASGExtForms"
{
behavior = void
redirect = True
}
}
}
Note that the recordAction Name is the same as the value in the DAC, not the Display Name (which is usually what is used. This is different because it is an action...)
[PXUIField(DisplayName = "DoorForm", MapEnableRights = PXCacheRights.Select)]
[PXButton]
public virtual void ASGExtForms()
{
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论