Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to change Form titledatasource property in x++

Posted on by Microsoft Employee

Hi,

I have try to change form titledatasource property in x

but i'm facing error 

pastedimage1637908067493v1.png

public static void main(Args    _args)
{
    
        InventTable  invent;
        Args         args;
        FormRun     formRun;
        
        select  invent;
       
        args = new Args();
        args.record(invent);
        args.name(formstr(ecoresproductdetailsextended));
        args.formViewOption(FormViewOption::Details);
        formRun = classfactory.formRunClass(args);
        formRun.design().titleDatasource(formRun.dataSource(tableNum(InventItemGroupItem)));
        formRun.init();
        formRun.run();
        formRun.wait();
}

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to change Form titledatasource property in x++

    Thanks Martin

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: How to change Form titledatasource property in x++

    The error says that the form design isn't initiliazed. It's becase you haven't called init() yet - you're doing it at line 16, while you're trying to change the design at line 15.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans