Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

How to make a sub grid fields editable and required

(0) ShareShare
ReportReport
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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Liquid error: parsing "/globalsearch/?q=mass+match+maker++loverslab" - Nested quantifier +.