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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Store custom field in a database and get it in d365fo project

(0) ShareShare
ReportReport
Posted on by

Hi Guys,

I am totally new to D365FO. I need to store URL in a database and then get it value in the project.

What is the best way to do it? Was trying to create a custom table in AxDB and pull it in DataEntity, but my table doesn't even appear in DataSource selection list.

I have the same question (0)
  • nmaenpaa Profile Picture
    101,160 Moderator on at

    What is the URL related to? Perhaps you can store it in some already existing table / field - or add a field to existing table.

    Also where do you want to use this URL?

    Could you explain your business requirement / functional requirement? Thanks!

  • Community Member Profile Picture
    on at

    Hi Nikolaos,

    Thanks for reply!

    I need to have a form, where in tab (iframe) would be displayed resourse from another website. For now URL of this website is hardcoded. The requirement is to store this URL in a database and pull it from there in the project to transfer to iframe .

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    I would not create a new table for storing one URL.

    You talk about projects, so are you using this in Project management module? Then you could add a new field in ProjParameters table via table extension. But you would need to specify the URL in every legal entity separately, since project parameters are not shared across legal entities.

    You can access the field in x++ by "ProjParameters::find().MyField".

    SystemParameters is a global table shared by all companies.

    But I would put it in the parameters of the module that is related to your functionality.

    Data entity is needed only if you want to access this field from external systems. And, also then you can add it to an existing entity via extension.

  • Community Member Profile Picture
    on at

    Unfortunately, the exact requirement is to use database.

    I am using custom almostly blank module and there are no entities yet.

    Could you please tell how to access/modify database correctly in this case?

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    ProjParameters and all other tables ARE in the database. The only way to add anything in the database is using tables.

  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    If it's your custom module, create a paramerer table for it if you don't already have one. Use existing parameter tables as examples, because they differ a bit from most other tables - especially by supporting only one record for each legal entity.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    Hi Polina,

    If you want to embed a third party application or website you can read the next post to achieve it using a configuration: docs.microsoft.com/.../embed-third-party-apps--phase-2

  • Community Member Profile Picture
    on at

    I will try it.

    But I am still curios how to deal with AxDB itself? I tried to write queries but always had timeout error, and Data Entity doesn't show a table I created. Maybe I am doing wrong?

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    Forget data entities for now, you don't need them.

    What do you mean that queries timeout? Please tell us more details about what you are doing, for example the code of your query.

    Are you already familiar with reading data from existing tables with x++? You need to know that before it's useful to add your own tables.

    You don't need to deal with AxDB, the system does it for you. You just need to know which table you want to query.

  • Community Member Profile Picture
    on at

    Here is a query I came up with:

    Query query;

           QueryBuildDataSource qbds;

           QueryBuildRange qbr;

           QueryRun queryRun;

           Counter resultCnt = 0;

           str myRange = 'valueForSearch';

           AnyTable anyTable;

           query = new Query();

           qbds = query.addDataSource(tableNum(AnyTable));

           qbr = qbds.addRange(fieldNum(AnyTable,Field));

           qbr.value(myRange);

           info (query.toString());

           queryRun = new queryRun(query);

           while (queryRun.next())

           {

               resultCnt++;

           }

           info(strFmt("results count: %1",vendCnt));

    I was trying to calculate number of records in the existing table for testing purposes.  But it returns nothing ("results count : 0").

    Also I tried simple update transactions:

    ttsbegin;

               select forupdate Table

               where Table.field == "Value";

               Table.field = "newValue";

               Table.update();

           ttscommit;

    In this case I got an error "The record has never been selected"

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans