Hello Experts, I am stuck on one of the process and i am not getting a clear idea how to create a issue transaction from a request. Actually i thought of using Business event but was unable to create, can anyone help me out from this .
How to Create inventory issue from request form.
Best answer by chameera71
It seems like you're looking for a way to create an issue transaction in Acumatica from a request, and you've considered using a Business Event to achieve this but are encountering challenges.
Here are some suggestions to guide you through the process:
1. Clarify the Workflow
- First, ensure that the process flow you're aiming for is clear. Are you trying to create an **issue transaction** (e.g., an inventory issue or similar) from a custom request screen or some other specific process? Understanding the exact flow helps identify the right Acumatica tools and approaches.
2. Business Event Overview
- Business Events in Acumatica are used to trigger automated actions based on certain conditions or data changes. To trigger a **transaction creation**, you need to ensure that the **event and trigger conditions** are correctly set up.
- Make sure you have defined the **trigger** properly (e.g., when a request is submitted or updated), and that the **action** you want is clear, such as calling a **customized action** to create the issue transaction.
3. Alternatives to Business Events
- If Business Events are not functioning as expected, consider using **Automation Steps** or **Custom Processing** instead.
- You can build a custom action in Acumatica, linked to the request, that will generate the issue transaction directly using **PXGraph** and the relevant **DACs** (Data Access Classes) like `INIssueEntry` for inventory transactions.
4. Check Permissions and Process Flow
- Ensure the user or system account triggering the Business Event has the correct permissions to create issue transactions.
- Also, verify that the necessary fields for creating an issue (such as warehouse, inventory item, quantity) are being passed correctly when the Business Event is triggered.
5. Code Example (Custom Action)
If you are leaning toward custom code rather than a business event, you could create a custom **PXGraph** that creates the issue transaction programmatically. A simplified outline might look like:
```csharp
public class RequestEntry : PXGraph<RequestEntry, Request>
{
public PXAction<Request> CreateIssueTransaction;
[PXButton]
[PXUIField(DisplayName = "Create Issue Transaction")]
protected void createIssueTransaction()
{
// Sample code to create an IN Issue Entry
INIssueEntry issueGraph = PXGraph.CreateInstance<INIssueEntry>();
INRegister issueDoc = issueGraph.Document.Insert(new INRegister
{
DocType = INDocType.Issue,
SiteID = <yourSiteID>,
TranDate = PXTimeZoneInfo.Now
});
// Add transaction details
issueGraph.Transactions.Insert(new INTran
{
InventoryID = <yourInventoryID>,
Qty = <yourQty>,
UOM = <yourUOM>,
SiteID = <yourSiteID>
});
issueGraph.Save.Press();
}
}
```
6. Debugging Tips
- Check the Event History: If you're having trouble with the Business Event, look at the **Business Event History** in Acumatica to see if the event is being triggered as expected.
- Logs and Errors: Any errors logged in the trace window could provide insights into why the Business Event is not completing successfully.
7. Documentation Reference
- Review the **Acumatica documentation** on Business Events and the **INIssueEntry** graph for more detailed guidance on how transactions are handled programmatically.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.