web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

computed field in Form Grid

(0) ShareShare
ReportReport
Posted on by 627

Hi, I want to create some computed fields in a form grid (checkbox, price fields, discountgroup)

How can I realize this to show entered values only on the gridline I wnat (and not on all lines) and how can I get the single values to work with

I have the same question (0)
  • Martin Dráb Profile Picture
    239,069 Most Valuable Professional on at

    I' don't really understand the second line of the text, but I guess Using the display Method Modifier will help you.

  • CRSW Profile Picture
    627 on at

    ok. more precised:

    I try to add new columns in the purchcopying form (creating a credit note)

    1 checkbox to mark if price should be overwritten

    1 field to enter new discount percentage

    1 field to select a lineDiscgroup

    The fields "discount percentage" and "lineDiscGroup" can only be filled if the checkbox is marked

    This part works for now, but after adding values to the fields and change selection of the grid line the entered data appears on each line in the grid.

    I tried to it similar to the "Mark all" field in this form

  • Martin Dráb Profile Picture
    239,069 Most Valuable Professional on at

    Where do you store information about which lines have been selected? Either explain your design to us or show your code.

    MarkAll saves that in a temporary table, as you can see in editMarkAll() method.

  • CRSW Profile Picture
    627 on at

    yes. Markall saves in tmpVirtualHeader and I create a myTmpVirtualHeader instance for my code

  • Martin Dráb Profile Picture
    239,069 Most Valuable Professional on at

    Then why do you ask how to do it if you're already aware of code doing it?

    Therefore:

    "How can I get the single values to work with?" - You get the current record in _header variable and you try to find it in the temporary table (element.findTmpFrmVirtual()).

  • CRSW Profile Picture
    627 on at

    because, as I mentioned, my values are shown an all gridlines and not only the one I entered it

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    Hi CRSW,

    there must be something wrong with your code. Please check it. And if you need help, please share it. Thanks!

  • CRSW Profile Picture
    627 on at

    
    edit NoYes AvnOverwritePrice(boolean            _set,
    
                                VendInvoiceJour     _vendInvoiceJour,
    
                                NoYes               _overwrite)
    
    {
    
        NoYes       overwrite;
    
        ;
    
        element.findTmpFrmVirtual(tmpFrmVirtualHeader2, _vendInvoiceJour.TableId, _vendInvoiceJour.RecId);
    
     
    
        if (tmpFrmVirtualHeader2)
    
        {
    
            overwrite   = NoYes::Yes;
    
        }
    
     
    
        if (_set)
    
        {
    
            if(_overwrite == NoYes::Yes)
    
            {
    
                avnNewDiscountPercent.allowEdit(true);
    
                avnNewLineDiscountCode.allowEdit(true);
    
                element.writeTmpFrmVirtual(tmpFrmVirtualHeader2,
    
                                           _vendInvoiceJour.TableId,
    
                                           _vendInvoiceJour.RecId,
    
                                           _vendInvoiceJour.InvoiceId,
    
                                           utcDateTimeNull());
    
                overwrite   = NoYes::Yes;
    
            }
    
            else
    
            {
    
                GOENewDiscountPercent.allowEdit(false);
    
                GOENewLineDiscountCode.allowEdit(false);
    
                tmpFrmVirtualHeader2.delete();
    
                overwrite   = NoYes::No;
    
            }
    
     
    
        }
    
     
    
       return overwrite;
    
    }

  • Martin Dráb Profile Picture
    239,069 Most Valuable Professional on at

    Please use the debugger to debug your code and tell us where it doesn't behave as expected.

    By the way, using allowEdit() there makes no sense. Do it in active() method of the data source.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 658

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 495 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 315 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans