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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Unable to shrink fields of a grid in form

(0) ShareShare
ReportReport
Posted on by

Hello everybody, I have trouble with shrinking the fields of a form.
I'm editing the standard form "DocuView": I have created a checkbox that allows the notes to be shown in the grid instead of in the reserved part below.
When the checkbox is checked, the fields of the grid grow in height, in order to contain a rather large portion of the note, and when the checkbox is unchecked the fields shrink again.
I also keep track of the last value for the checkbox (checked or unchecked) for every user.
When the form is closed with the checkbox checked, it reappears just fine (it actually saved the value of the checkbox), but if I uncheck it the grid does not shrinks anymore.
This only happens when the form is reopened with the checkbox value saved as checked.
If the form is opened with "no previous value" or with last value "unchecked", it shrinks and grows as needed.

Here is the code for the edit method of the checkbox.

edit boolean showNoteInGrid(boolean _set, boolean _mark)
{
    if (_set)
    {
        showNoteGrid = _mark;
        docuRef_NotesGrid.visible(_mark);

        if (showNoteGrid == false)
        {
            DocuRef_Type.displayHeight(1);
        }
        element.redraw();
    }
    return showNoteGrid;
}

The LastValue is handled as usually using Currentversion and xSysLastValue

Thank you

*This post is locked for comments

I have the same question (0)
  • Otavio Anaga Profile Picture
    216 on at
    RE: Unable to shrink fields of a grid in form

    Hi Gaia!

    I never did something like this in a form. But I think that you need to call the xSysLastValue::saveLast(this); method to update the lastvalue.

    Try to put it in your method!

    Please, marks as a response if it helped you!

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at
    RE: Unable to shrink fields of a grid in form

    Hi,

    As per my understanding you want to either shrink/expand the DocuView form based on the user.I feel instead of relying on syslastvalue its better to introduce a checkbox(namely expand DocuView) on the SysUserinfo table and whenever a user opens the DocuView form default the set method value from this checkbox based on the user.

    Hope this information is helpful to you.

    Thanks,

    Chaitanya Golla

  • Zain Bokhari Profile Picture
    3,208 Moderator on at
    RE: Unable to shrink fields of a grid in form

    Hi Gaia,

    Have you tried to see what LastValue is returned when the form is opened?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans