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

Copy custom field from PurchParmLine to VendPackingSlipTrans

(0) ShareShare
ReportReport
Posted on by 240

I have a custom field in both PurchParmLine and VendPackingSlipTrans tables. I want to set the value user enter while creating product receipt from PurchParmLine to VendPackingSlipTrans. 

I have checked initJournalLine and updateJournalLine methods in PurchPackingSlipJournalCreate class which have the initialization logic for VendPackingSlipTrans table but I couldn't find a way to apply me logic in between those methods using chain of command as the table buffer for VendPackingSlipTrans is private and not accessible in extension class. 

Is there any way to use these methods or any other suitable method for initializing VendPackingSlipTrans table using extension?

I have the same question (0)
  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    VendPackingSlipTrans has a method named initFromPurchParmTable. If you can provide one-to-one relation with other fields, maybe you can try using this method.(You could do it using the initJournalLine method in 2012 but I haven't tried it in 365.)

  • Hassan Akhtar Khan Profile Picture
    240 on at

    Yes, InitJournalLine would be a good place to make these changes. But since over-layering is not an option and I cannot access private variables in extension class, I couldn't use it.

    I ended up writing my logic in endCreate method. It runs after the journal and all the lines has been created so I can loop through lines and update the field according to my need. This method suited me best for my requirement.

  • Verified answer
    Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Which variable are you unable to access? The extension of initJournalLine() looks quite straightforward to me:

    public Common initJournalLine(Common _parmLine)
    {
    	PurchParmLine purchParmLine = _parmLine as PurchParmLine;
    	VendPackingSlipTrans vendPackingSlipTrans = next initJournalLine(purchParmLine);
    	
    	vendPackingSlipTrans.MyField = purchParmLine.MyField;
    	
    	return vendPackingSlipTrans;
    }

  • Hassan Akhtar Khan Profile Picture
    240 on at

    Thanks Martin, apparently I was doing it wrong.

    Although endCreate method fulfills the requirement but this is exactly what I have asked for.

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