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

Update on CompanyInfo table

(0) ShareShare
ReportReport
Posted on by 2,114

Hi Techies,

We are facing strange issue need some inputs.

One custom field is created on CompanyInfo table and we are trying to update it by code.

Here, it doesn't throw any error but field doesn't update as well.

companyInfoUpdate.skipDataMethods(true);

update_recordset companyInfoUpdate
setting customField = _installedProdVersion
where companyInfoUpdate.customField != _installedProdVersion &&
_installedProdVersion;

Where as, we have tried above code without where clause, but getting error like 'Cannot edit a record in Legal entities (CompanyInfo). Data update is not allowed on field that has not been selected.

Do we need to update in any other table as well.

Can anyone help giving some inputs here that how we can update the CompanyInfo table here please.

Any response is appreciated!

Thank you in advance!

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,014 Super User 2025 Season 2 on at

    Hi Sangram,

    Have you used the debugger to check if the _installedProdVersion variable has an actual value?

    You can try to set the update_recordset statement in an 'if-clause' where you first evaluate if there is an value provided.

    E.g.:

    ttsbegin;
    
    companyInfoUpdate.skipDataMethods(true);
    
    if (_installedProdVersion)
    {
        update_recordset companyInfoUpdate
        setting customField = _installedProdVersion
        where companyInfoUpdate.customField != _installedProdVersion;
    }
    
    ttscommit;

  • Sangram Shinde Profile Picture
    2,114 on at

    Thank you for reply Andre, yes the _installedProdVersion has the value, we've checked that in debugger.

    While adding new field in CompanyInfo also, it was showing error on DirPartyTable that field doesn't exist. Then we've added same custom field in DirPartyTable from SQL with same characters and that error got resolved.

    Hence I am wondering if we need to update any other table as well.

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

    Hi Sangram,

    Manually adding a field in the SQL database is not recommended. The Database synchronization should take care of that job. There is an SQLDictionary table (and probably some others) which are used to translate the x++ queries to SQL queries. This table is not updated when you manually add fields in the SQL database. I would suggest to run a full database synchronization job.

  • Sangram Shinde Profile Picture
    2,114 on at

    We were facing sync issue after adding field in companyInfo saying it's not available in DirPartyTable, means the SQLDictionary table which you are referring wasn't updating SQL query it seems.

    For now we've used an alternate way.

    Yeah we would try with full db synch once.

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 659 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 289 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans