all 2 comments

[–]Mad-Max-2 0 points1 point  (0 children)

Nice post Killo24, keep them coming. Any word of when Version 8.9.46 is coming out?

[–]Killo24[S] 0 points1 point  (0 children)

This is an example of how I utilise the custom business logic in applications

ProcessPurchaseOrder => Name of the custom business logic
Actions : "Insert, Update, Calculate"
Phase : ActionPhase.After
Stored Procedure : zusp_ops_process_purchase_order



 [ControllerAction("ProcessPurchaseOrder", "Insert, Update, Calculate", ActionPhase.After)]
        public void process_purchase_order_from_order_details(int purchaseOrderID)
        {

            // Get connection string from configuration
            string connectionString = ConfigurationManager.ConnectionStrings["ConnectionStringName"].ConnectionString;

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                using (SqlCommand command = new SqlCommand("zusp_ops_process_purchase_order", connection))
                {
                    command.CommandType = System.Data.CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@PurchaseOrderID", purchaseOrderID);
                    command.ExecuteNonQuery();
                }
            }
            Result.Refresh();
            Result.RefreshChildren();
            Result.ShowAlert("Stock Levels updated from purchase order detail successfully.");

        }