I am currently debugging an endpoint for my custom API page. When I make changes or update my page, I click on the “Save” button. I want the API endpoint to be called when some conditions are satisfied. The sessions are empty. How do I do that on ASP.NET Maker, instead of using VS Code? This is my method:
public void RowUpdated(Dictionary<string, object?> oldRow, Dictionary<string, object?> newRow)
{
// Helper: To read from newRow with fallback to oldRow
string GetValue(Dictionary<string, object?>? n, Dictionary<string, object?>? o, string key) =>
(n != null && n.ContainsKey(key) && n[key] != null) ? ConvertToString(n[key]) :
(o != null && o.ContainsKey(key) && o[key] != null) ? ConvertToString(o[key]) : "";
// Normalize processing platform friendly names to canonical code
string NormalizeProcessingPlatform(string platform) {
if (Empty(platform)) return platform;
platform = platform.Trim();
if (SameText(platform, "Pag"))
return "PG_01";
return platform;
}
// Apply defaults to ensure no empty required fields
string ApplyDefault(string value, string defaultValue) =>
string.IsNullOrWhiteSpace(value) ? defaultValue : value;
// Check request status
string requestStatus = GetValue(newRow, oldRow, "Request_Status");
if (requestStatus == "Released For Immediate Payment") {
// Core fields for payment service calls
string entityID = GetValue(newRow, oldRow, "Entity_ID");
string referenceNumber = GetValue(newRow, oldRow, "RequestID");
destinationBankUID = "40090E2F-7446-4217-9345-7BBAGDTGHHJB7043C4C";
destinationAccount = "0000000000";
// Normalize processing platform
string normalizedPlatform = NormalizeProcessingPlatform(processingPlatformRaw);
// Set all session variables
Session["ExEntityID"] = entityID;
Session["ExReferenceNumber"] = referenceNumber;
Session["ExTransferType"] = transferType;
Session["ExTotalAmountDue"] = totalAmountDue;
Session["ExDestinationAccount"] = destinationAccount; // TEST: 0000000000
Session["ExDestinationPhone"] = destinationPhone;
}
}