Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Add a computed column on a view extension caused error during database synch

(0) ShareShare
ReportReport
Posted on by 563

Hi,

i like to extend the PurchLineBackorder view with a computed column. Therefore I extend the view as follows:

pastedimage1677585509317v2.png

I also write a new methode as follows:

/// <summary>
/// code extension for PurchLineBackorder view
/// </summary>
[ExtensionOf(viewstr(PurchLineBackorder))]
internal final class myPurchLineBackorder_Extension
{
    /// <summary>
    /// get the created date from current purchline
    /// </summary>
    /// <returns>created date</returns>
    internal static str getPurchLineCreatedDate()
    {
        return SysComputedColumn::returnField(viewstr(PurchLineBackorder), tableStr(PurchLine), fieldStr(PurchLine, CreatedDateTime));
    }
 
}

The build ended with no error but the database synch caused this error:

Log level - Error | Infolog diagnostic message: 'Error executing code: AJHPurchLineBackorder_Extension object does not have
method 'getPurchLineCreatedDate'.' on category 'Error'.

I don't know how to fix it...
  • Suggested answer
    Christian Busche Profile Picture
    Christian Busche 563 on at
    RE: Add a computed column on a view extension caused error during database synch

    Martin,

    after rework on the view settings I found the error... The flag ENABLED was set to NO... When I set it to YES the view is available in SSMS and in the browser as well...

    And the error of the computed column was because of not setting the branch number in method parameters... ;-)

  • Martin Dráb Profile Picture
    Martin Dráb 230,900 Most Valuable Professional on at
    RE: Add a computed column on a view extension caused error during database synch

    Successfully synchronized views definitely should be in the database (and visible in SSMS). Either you aren't checking it correctly (looking to a wrong DB, not refreshing the list...) or the view wasn't successfully synchronized.

  • Christian Busche Profile Picture
    Christian Busche 563 on at
    RE: Add a computed column on a view extension caused error during database synch

    Hi Martin,

    Is there a known issue with views under Visual Studio PlatformVersion 55?

    On the one hand I have the already mentioned problem of a view extension, on the other hand I can build and synchronize a new created view, but I cannot access it in the table browser ("You are not authorized to access the table..."). Also the created view is not visible in the SQL Manager...

  • Christian Busche Profile Picture
    Christian Busche 563 on at
    RE: Add a computed column on a view extension caused error during database synch

    Martin,

    you are right, the name in error message is diffenrent than the one in the class... I forgot to change it in the error message...

    But... I build the whole model for several times but it is still not working...

    Funny is that the error occurs during synch the database also during synchronise it out of the solution/project... the build gets no error?

    by the way... I post this question inadvertently also with 480586... How can I clean it with deleting one of the questions?

  • Martin Dráb Profile Picture
    Martin Dráb 230,900 Most Valuable Professional on at
    RE: Add a computed column on a view extension caused error during database synch

    I see that the name in the error message is different. It may be caused by how you shared the information with us, but it's worth checking.

    Otherwise I don't see anything wrong. Try rebuilding the model (not just a project).

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,074 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,900 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans