Skip to content

How to save multi records from one dialog #7075

Answered by MAboKhadra
MAboKhadra asked this question in Help
Discussion options

You must be logged in to vote

and here is the answer on ver 6.9.6 after few month and no one respond

protected override void AfterSave()
{
    base.AfterSave();
    if (Row.Product == null)
        return;

    // Get the Product row based on the ProductId from PurchasDetails
    var product = Connection.TryFirst<ProductRow>(ProductRow.Fields.ProdId == Row.Product.Value);
    if (product != null)
    {
        // Update the Product's balance based on the purchase details
        // You'll need to determine the logic based on your system
        product.Balance += Row.Quantity;
        product.Price = Row.SellPrice;
        product.PurchasPrice = Row.PurchasPrice;
        product.Purchased++;
        // Assuming "Quant…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MAboKhadra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant