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 :
Microsoft Dynamics AX (Archived)
Under review by Community Managers

Under review

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

Changing namealias value of multiple records via dialog

Posted on by 1
public final class  InventTableNameUpdateClass
{
    InventTable  inventTable;
    str          newNameAlias;
    public InventTable parmInventTable(InventTable _inventTable = inventTable)
    {
        inventTable = _inventTable;
        return inventTable;
    }
    public static void main(Args _args)
    {
        InventTableNameUpdateClass  NameUpdate = new InventTableNameUpdateClass();
         NameUpdate.parmInventTable(_args.record());
         NameUpdate.run();
    }
    boolean dialog()
    {
        Dialog d = new Dialog('NameAlias ');
        DialogField dfNameAlias;
         
        dfNameAlias = d.addField(extendedTypeStr(NameAlias), 'NameAlias:');
        dfNameAlias.value(inventTable.NameAlias);  
        
        if (d.run())
        {
            newNameAlias = dfNameAlias.value();
            return true;
        }
        else
        {
            return false;
        }
    }
    public void run()
    {
        if (this.dialog())
        {
            ttsBegin;
            inventTable.selectForUpdate(true);
            inventTable.NameAlias = newNameAlias;
            inventTable.update();
            ttsCommit;
            info("succesfull .");
        }
        else
        {
            info("failed.");
        }
    }
 
 
 
I have such a class. I can change the namealias value of the selected record with the dialog, but I want to change the namealias value of more than one selected record. Can you help me with the code?

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans