I need to make usage Assignment and Approval Maps. What is template for usage of maps which are constructed at page EP205000? I made research in file coderepository.xml of Acumatica, and found there EPApprovalAutomation class. I wanted to use it, but it requires among arguments usage of class which implements IAssignedMap interface. It gives another problem, because IAssignedMap interface is internal, which gives another riddle, how to use IAssignedMap interface? What are alternatives?
相关问题
- How to add a memo / formatted text field ala Cases
- Create Case with Activity through Rest API
- Acumatica dynamic dropdown
- How to create an ad-hoc email and send it using Ac
- How to include a dialog for file upload
相关文章
- Cannot load a reference assembly for execution
- Adding additional filter field on process shipment
- Create custom User Control for Acumatica
- Sales Price Updating Every Other Time
- Import Amount Paid in screen Bill And Adjusment us
- Acumatica Configuration Wizard error: Can't ge
- How to properly sort Tasks having multi-level Task
- Prevent update of note/files on disabled views
Adding this as an answer because it is too big for a comment. My response below builds on Gabriel's answer...
I was able to get the steps that Gabriel posted working with the following additions: (Referred to graph SOOrderEntry for examples)
If you want to fill in the EPApproval fields such as Description as seen on the approval form by the approver, you can do a cache attached in your graph containing the approval setup like so:
[PXDBString(60, IsUnicode = true)] [PXDefault(typeof(MyDac.description), PersistingCheck = PXPersistingCheck.Nothing)] protected virtual void EPApproval_Descr_CacheAttached(PXCache sender) { }
If you want the "Type" value on the approval screen to be something user friendly and not the object namespace (PX.Objects.MyStuff.MyDac) then use PXCacheName attribute on the primary DAC like so:
[PXEMailSource] [Serializable] [PXCacheName("My DAC")] [PXPrimaryGraph(typeof(MyGraph))] public class MyDac : PX.Data.IBqlTable, PX.Data.EP.IAssign {...}
My custom approval process on my custom graph is fulling functional. Big help/thanks to Gabriel and Evgeny for the article. The version of Acumatica I am using is 5.30.2233. One limitation is not having a way to package the Automation steps so distributing this from a customization package is not flexible.
If you check the RQRequestEntry, there's an additional code in "Hold"
I've been trying to figure out the third level approval step and the instructions doesn't include this part. I tried even debugging acumatica's code and there seem to be no errors there. For the benefit of the other developers here is what you need
you need this part of the code to assign to the next approver:
This answer might be coming a bit late, but I'm sure it can be useful to others so I will share it.
New tables and fields for the database
XXSetupApproval
Add new setup table for approval settings in your module (XXSetupApproval further). You can see all required fields below, but you may need to add any additional parameters if you want to split approval for different types of entities.
XXRegister
Modify table of entity for which you need to implement approval mechanism (XXRegister further). Your entity should include three required fields that you can see below. OwnerID uniqueidentifier NULL, WorkGroupID int NULL, Approved bit NOT NULL XXSetup Modify table of main setup in your module (XXSetup further). Your setup should include one required field that you can see below. Name this flag according with your entity name, because it will be indicate whether approval mechanism enabled or not (XXRequestApproval further). XXRequestApproval bit NULL
New update scripts for the database
Update XXRegister table and set Approved flag equal to 1 for all existing records according with your conditions. Use your own expressions instead of three dots.
New tables and fields for the code
AssignmentMapTypeXX
Add your entity to the AssignmentMapType class (AssignmentMapTypeXX further). This type should be used for select the assignment maps of needed types only.
XXSetup
Add new properties and classes to the XXSetup DAC according with new fields in the database. Use any other attributes if needed.
XXRegister
Add PXEmailSource attribute to the XXRegister DAC, it is required for "Assignment and Approvals Maps" tree selector.
Add new properties and classes to the XXRegister DAC according with new fields in the database. XXRegister DAC should realize IAssign interface (OwnerID, WorkgroupID fields). Use any other attributes if needed. Use your own expressions instead of three dots.
Statuses
Add new approval statuses for the entity and use them in the list. Use other letters if “P” and “R” already in use.
New code for the graph of the entity
Implement EPApprovalAutomation helper in the graph which is manipulating with your entity. Use your own parameters instead of three dots.
Add view for the XXSetupApproval DAC. Use your own expressions instead of three dots.
New code for the graph of the main setup
Add view for the XXSetupApproval DAC.
Update each XXSetupApproval row according with new value of the XXRequestApproval field.
New tables and fields for the web pages
XXSetup.aspx
Add new tab with approval settings to the main web page of the setup (XXSetup.aspx further). Use any other parameters if needed.
XXRegister.aspx
Add new field “Approved” to the main web page of the entity (XXRegister.aspx further). Use any other parameters if needed.
Add new tab with approval information to the XXRegister.aspx web page. Use any other parameters if needed.
New Automation steps for the Automation definition
This is the most difficult part during approval implementation because a few new automation steps should be created in the scope of current behavior of the entity. For example, the entity has next statuses and automation steps accordingly: "Hold" -> "Open". And we should implement approval mechanism between those two steps. Then three new automation steps should be created: "Hold-Open" (if we don’t need to approve the document), "Hold-Pending Approval" (if we need to approve the document), "Pending Approval" (step from which the entity should be approved or rejected). New life cycle will be looks like this: "Hold" -> "Hold-Open" OR "Hold-Pending Approval" -> "Open" OR "Pending Approval". So "Hold-Open" and "Hold-Pending Approval" automation steps are only switches, that determine, which automation step should be used after "Hold".
Thanks to Evgeny Kralko from the Acumatica dev team for his work.