Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

AIF ProjectHourJournalService Document Service

(0) ShareShare
ReportReport
Posted on by 2

Has anyone successfully managed to create a project hour journal using the standard AX document service?

I'm having various problems, including AIF complaining that the VoucherNumberSequenceTable is invalid and AIF complaining that the Worker is invalid, despite the ID of the worker being correct.

Just curious if anyone has used this service correctly, if so is there any example code out there!?

Thanks,

Nick

*This post is locked for comments

  • NR-11010513-0 Profile Picture
    NR-11010513-0 2 on at
    Re: AIF ProjectHourJournalService Document Service

    You need to ensure the AxdEntity_ProjJournalTable.VoucherNumberSequenceTable property is populated.

    This requires a AxdEntityKey_NumberSequenceTable object is created with values for the number sequence scope.

    I'd be interested if you get anywhere with this. I too have had problems with this. It looks as though when it retrieves the surrogate key for the number sequence table, the underlying query it uses is performing inner joins across the tables related to the NumberSequenceScope table.

    I can see the service failing when I debug the AxdBaseCreate.getSurrogateForeignKeyValue() method at the point it attempts to retrieve the surrogate key for the property VoucherNumberSequenceTable.

    Hope that makes sense!

  • Liz Herrington Profile Picture
    Liz Herrington 265 on at
    Re: AIF ProjectHourJournalService Document Service

    Thanks so much Nick!  Do you have some sample code from your import?  We are getting a lot of errors surrounding the Number Sequence:

    Invalid document schema. The following error was returned:  The element 'ProjJournalTable' in namespace 'schemas.microsoft.com/.../ProjJournalTable& has invalid child element 'Worker' in namespace 'schemas.microsoft.com/.../ProjJournalTable&. List of possible elements expected: 'VoucherNumberSequenceTable' in namespace 'schemas.microsoft.com/.../ProjJournalTable&.

    We added a bunch of number sequence information, but I don't think that should be necessary.

  • NR-11010513-0 Profile Picture
    NR-11010513-0 2 on at
    Re: AIF ProjectHourJournalService Document Service

    Check this link out, explains it slightly better than I did:

    community.dynamics.com/.../surrogate-foreign-keys-in-aif.aspx

  • NR-11010513-0 Profile Picture
    NR-11010513-0 2 on at
    Re: AIF ProjectHourJournalService Document Service

    Hi Liz,

    I did manage to succesfully post hour journals through the document service. I believe when I was getting the error, I was using the Party 'RecID' of the Worker instead of the 'PartyNumber'. The document service has a concept of 'expanding foreign surrogate keys' whereby the document service will look for the replacement key of the table, in this instance PartyNumber is the replacement key of DirPartyTable.

    What is the issue you are getting exactly? The errors in the AIF exception log can sometimes be a bit misleading.

    Cheers,

    Nick

  • Liz Herrington Profile Picture
    Liz Herrington 265 on at
    Re: AIF ProjectHourJournalService Document Service

    Nick,

    Did you ever figure this out?  We are experiencing the same issue.  Thanks, Liz

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! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans