Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Function ProjBudgetTransactionLine_Virtual::construct has been incorrectly called.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

got the following error while trying to create a P.O  

" Function ProjBudgetTransactionLine_Virtual::construct has been incorrectly called." 

7127.POBudget.PNG

* the function in question 

public static ProjBudgetTransactionLine construct(
ProjTransType _transType,
TransDate _transDate,
ProjTransIdBase _transId,
ProjId _projId,
ProjCategoryId _categoryId,
Qty _quantity,
CurrencyCode _costAmountCurrencyCode,
CostAmount _costAmount,
CurrencyCode _salesAmountCurrencyCode,
SalesAmount _salesAmount,
RefRecId _sourceDocumentLine,
ProjActivityNumber _projActivityNumber = '',
ProjLinePropertyId _projLinePropertyId = ''
)
{
ProjBudgetTransactionLine_Virtual projBudgetTransactionLine_Virtual = new ProjBudgetTransactionLine_Virtual();

if (!_transDate ||
!_projId ||
!_categoryId ||
(_transType != ProjTransType::Revenue && !_costAmountCurrencyCode) ||
!_salesAmountCurrencyCode ||
!_sourceDocumentLine)
{
throw error(strFmt("@SYS22828", funcName()));
}

projBudgetTransactionLine_Virtual.parmTransType(_transType);
projBudgetTransactionLine_Virtual.parmTransDate(_transDate);
projBudgetTransactionLine_Virtual.parmTransId(_transId);
projBudgetTransactionLine_Virtual.parmProjId(_projId);
projBudgetTransactionLine_Virtual.parmCategoryId(_categoryId);
projBudgetTransactionLine_Virtual.parmCostAmountCurrencyCode(_costAmountCurrencyCode);
projBudgetTransactionLine_Virtual.parmSalesAmountCurrencyCode(_salesAmountCurrencyCode);

projBudgetTransactionLine_Virtual.parmQty(_quantity);
projBudgetTransactionLine_Virtual.parmCostAmount(_costAmount);
projBudgetTransactionLine_Virtual.parmSalesAmount(_salesAmount);
projBudgetTransactionLine_Virtual.parmTransIdRef('');
projBudgetTransactionLine_Virtual.parmProjActivityNumber(_projActivityNumber);
projBudgetTransactionLine_Virtual.parmSourceDocumentLine(_sourceDocumentLine);
projBudgetTransactionLine_Virtual.parmLinePropertyId(_projLinePropertyId);
return projBudgetTransactionLine_Virtual;
}

*This post is locked for comments

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Function ProjBudgetTransactionLine_Virtual::construct has been incorrectly called.

    Hi thegallery2020,

    since you found this old discussion, I assume you already tried the suggestions that were given above.

    Please share with us what you learned when following the suggestions. Thanks!

  • thegallery2020 Profile Picture
    thegallery2020 95 on at
    RE: Function ProjBudgetTransactionLine_Virtual::construct has been incorrectly called.

    i am facing the same error please help me how to rectify this

  • Martin Dráb Profile Picture
    Martin Dráb 230,458 Most Valuable Professional on at
    RE: Function ProjBudgetTransactionLine_Virtual::construct has been incorrectly called.

    You can analyze the code, identify all the places where values of all parameters may come from and then review the data in production.

    If you can't reproduce the problem in any non-production environment, considering copying data from production and trying it again. It may be easier than analyzing code.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Function ProjBudgetTransactionLine_Virtual::construct has been incorrectly called.

    thank you  for the reply martin ... is there any way to test all parameter without debugging on live environment ?

  • Martin Dráb Profile Picture
    Martin Dráb 230,458 Most Valuable Professional on at
    RE: Function ProjBudgetTransactionLine_Virtual::construct has been incorrectly called.

    If you can, use the debugger to find out which parameter (or parameters) has a wrong value. Then you'll look at the code calling construct() and figure out why it's wrong.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans