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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Changing namealias value of multiple records via dialog

(1) ShareShare
ReportReport
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 değiştirme');
        DialogField dfNameAlias;
         
        dfNameAlias = d.addField(extendedTypeStr(NameAlias), 'NameAlias:');
        dfNameAlias.value(inventTable.NameAlias);  
        // Dialog çalıştır ve kullanıcıdan yeni değeri alma işlemi
        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?
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    306,371 Super User 2026 Season 1 on at
    Hi,
     
    What is your source for multiple records? Is a user selecting records on a form or do you have another list with item records?
    Depending on the source or condition what records you need to update, you can use a while select statement or update_recordset.
  • Suggested answer
    Martin Dráb Profile Picture
    240,077 Most Valuable Professional on at
    If you have records selected in a grid, use inventTable.getFormDataSource() (FormDataUtil::getFormDataSource() in F&O) to get the form data source from the table buffer and MultiSelectionHelper class to iterate the selected records.
  • Raj Borad Profile Picture
    1,578 on at
    Hi,
    If you want to change the approach and able to create a excel file with required details,
    You can update multiple records using Excel import code.

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

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 June Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Subra Profile Picture

Subra 385

#3
Martin Dráb Profile Picture

Martin Dráb 252 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans