Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

How to make a sub grid fields editable and required

Posted on by 15

Hi,

On the invoice form, there is a invoicedetail subgrid and few fields are enabled and required like the quantity.

I have created a new column and added to the subgrid but it's only in display mode.

I would like to make it editable and required.

I was exploring the subgrid properites and I found nothing interesting.

Then I tried using javascript but it doesn't work

var invoiceSubGrid = formContext.getControl("invoicedetailsGrid").getGrid();
var gridRows = invoiceSubGrid.getRows();
gridRows.forEach(function (row, i)
{
    var gridColumns = row.getData().getEntity().attributes;
    gridColumns.forEach(function(column, j) {
        varatrName = column.getName();
        varatrValue = column.getValue();
        column.setDisabled(false);
        column.setRequiredLevel("required");
    });
});

Thanks in advance

  • vnussbaum Profile Picture
    vnussbaum 15 on at
    RE: How to make a sub grid fields editable and required

    By default, the invoicedetail control was read only but you can modify the quantity.

    I tried to add the editable grib control and my custom field is still not editable. If I set it to required, the field is locked and I get the error message telling the field is required.

    I just tried as business required, something changed.

    Maybe it's a limitation for this specific table

  • Suggested answer
    Rui Carvalho Profile Picture
    Rui Carvalho on at
    RE: How to make a sub grid fields editable and required

    Hi,

    For Editable Sub-Grids please see the following documentation: docs.microsoft.com/.../use-editable-grids

    Under this:

    pastedimage1624267352969v1.png

    For field as required please see the following documentation: Create and edit fields with Dynamics 365 Customer Engagement (on-premises) | Microsoft Docs

    You will have 'Field Requirement'. You need to set the field as 'Business Required'

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,537 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,520 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans