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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Extension of class PurchFormletterParmDataInvoice error

(0) ShareShare
ReportReport
Posted on by 758

Hi Everyone ,

I am trying to take extension of updateQueryBuildSpecQty method of PurchFormletterParmDataInvoice class.

Please find my code below,

In extension class I am getting value for isFromPackingSlip boolean but for chooseLines getting null value and getting error in compiler as Value for  chooseLines  does not exist in this context. 

However in my next call isFromPackingSlip  & chooseLines  both have value.

What could be the reason?

[ExtensionOf(classStr(PurchFormletterParmDataInvoice))]
final class WCLPurchFormLetterParmDataInvoice_Extension
{
    protected void updateQueryBuildSpecQty()
    {
        QueryBuildDataSource qbds;
        QueryBuildRange qbr;

        next updateQueryBuildSpecQty();
        if(isFromPackingSlip)
        {
            qbds = chooseLines.query().dataSourceTable(tableNum(VendPackingSlipTrans));
            if (qbds)
            {
                qbr = SysQuery::findOrCreateRange(qbds, fieldNum(VendPackingSlipTrans, WCLConsiderForPosting));
                qbr.value(queryValue(NoYes::Yes));
            }
        }
        

    }
}

PO-111.PNG

  • Sergei Minozhenko Profile Picture
    23,099 on at

    Hi Rhushikesh,

    Do you mean that when you all next statement and go to the original code, all variables are initialized, but when you come back to your extension method back after the next statement, chooseLine is null?

    Have you tried to make a build if the model from D365 menu?

  • Rhushikesh R Profile Picture
    758 on at

    Yes Sergie. No I haven't tried model build. Will do that and update you.

  • Rhushikesh R Profile Picture
    758 on at

    Hi Sergie, I tried model build but it didn't work. Could you please help me further?

  • Sergei Minozhenko Profile Picture
    23,099 on at

    Hi Rhushikesh,

    The code looks fine. Do you have any other customization for the same method? There is also method parmQueryChooseLines on the class, you can try to check if it's returning something.

    this.parmQueryChooseLines().query().dataSourceTable(tableNum(VendPackingSlipTrans));

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 539 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 366 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 197

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans