Skip to main content

Notifications

Microsoft Dynamics AX forum
Suggested answer

Error while posting Project time sheet. info log says :The value <projectid> does not exist for <legalentity>

Posted on by Microsoft Employee

Hi there,

This is a Dynamics AX2012 R3 CU13 environment.

I am trying to post a project time sheet in the Project Management module.

While posting, the info log throws an error : The value <projectid> does not exist for <legalentity>

The strange thing is the projectID mentioned in the info log is not the project id selected in the timesheet line. 

In fact, the project id belongs to another legal entity.

Tested the same scenario in all the available legal entities, the info log shows exactly the same (wrong) project id every time in every legal entities

Any thoughts would be appreciated

Thanks

Riyas

  • Charan Bhamidi Profile Picture
    Charan Bhamidi 20 on at
    Error while posting Project time sheet. info log says :The value does not exist for
    We encountered this in R3 CU13 as well. After looking into this, I suspect that this is a bug. There are two reasons - firstly in the class TSTimesheetsPost method validatePost() there is a check whether the TSTimesheetLine is intercompany. However, when it does this check the record buffer for TSTimesheetLine is empty. 
    protected static boolean validatePost(TSTimesheetTable _tsTimesheetTable)
    {
        TSTimesheetLine         
    tsTimesheetLine;
        TSTimesheetLineWeek     tsTimesheetLineWeek;
        TSTimesheetTrans        tsTimesheetTrans;
        COSMovements_Project    cosMovements_Project;
        ProjJournalTrans        projJournalTrans;
        ProjTrans               projTrans;
        boolean                 retVal = (_tsTimesheetTable.ApprovalStatus == TSAppStatus::Approved);
        TSTimesheetsPost        tsTimesheetsPost;
        if (retVal && (!_tsTimesheetTable.checkProjId() || !_tsTimesheetTable.checkReqActivity()))
        {
             retVal = false;
        }
        else
        {
            // transition the lines to fully distributed, if this is not possible the line is not ready to be submitted
            SourceDocumentProcessorFacade::submitSourceDocumentLinesForHeader(_tsTimesheetTable, SourceDocumentLineAccountingStatus::FullyDistributed);
            retVal = retVal && SourceDocumentProvider::areSourceDocAccDistAccountValid(SourceDocumentHeader::find(_tsTimesheetTable.SourceDocumentHeader), true, true);
            if (retVal && (
    tsTimesheetLine.isIntercompany()) && (_tsTimesheetTable.ApprovalStatus == TSAppStatus::Approved))
            {
                tsTimesheetsPost =  new TSTimesheetsPost(_tsTimesheetTable);
                retVal = tsTimesheetsPost.validateProjFinancialDim(_tsTimesheetTable);
            }

    The record buffer being empty, the only value it seems to hold is the default DataAreaId of the current legal entity. And the method isIntercompany() only checks whether the record's ProjectDataAreaId value is the same as the DataAreaId. If the record is empty, then the ProjectDataAreaId is blank, which is not equal to the defaulted DataAreaId (current legal entity) of the empty record. So, it returns a true value causing the condition to be met even though it shouldn't. 
    The second reason for my belief this is a bug is what happens in the tsTimesheetsPost.validateProjFinancialDim() method that is called above.
    while select crossCompany projTable
            exists join dimensionAttributeValue
                exists join dimensionAttributeValueSetItem
                    exists join tsTimesheetLine
                        where projTable.RecId == dimensionAttributeValue.EntityInstance &&
                            dimensionAttributeValue.RecId == dimensionAttributeValueSetItem.DimensionAttributeValue &&
                            dimensionAttributeValueSetItem.DimensionAttributeValueSet == tsTimesheetLine.DefaultDimension &&
                            tsTimesheetLine.TimesheetNbr == _tsTimesheetTable.TimesheetNbr
        {
            if (projTable && (projTable.dataAreaId != curext()))
            {
                error(strfmt("@SYS326454", projTable.ProjId, curext()));
                retVal = false;
            }
        }
    Here, the while select does not check whether the DimensionAttribute value on the DimensionAttributeValue record happens to be the correct Attribute for a Project dimension. So, in our case, even if the DimensionAttribute value on the relevant DimensionAttributeValue records (for Department, ProductLine, Site in our case) have the EntityInstance values that coincidentally equal the Record IDs of any Projects in any legal entity, it grabs those Project records in this query. 
    I think we would have to add a bug fix.
     
  • Suggested answer
    Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Error while posting Project time sheet. info log says :The value <projectid> does not exist for <legalentity>

    Hi RiyasBhai,

    The error seems to be related to your findims, not the project itself.

    Can you check

    (a) what findims are setup in your timesheet and

    (b) what findims are setup at the project level?

    There must be an invalid value.

    Best regards,

    Ludwig

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error while posting Project time sheet. info log says :The value <projectid> does not exist for <legalentity>

    Hi,

    On another thought, for posting the timesheet, is it mandatory to have Project as a financial dimension?

    In our AX financial dimension setup, we don't have "Project" as a dimension until now.

    So, I was wondering if there is anything like that.

    Appreciate your comment on this, thanks

    Riyas

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error while posting Project time sheet. info log says :The value <projectid> does not exist for <legalentity>

    This is the info log and the corresponding class

    FYI

    pastedimage1617701005817v1.png

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error while posting Project time sheet. info log says :The value <projectid> does not exist for <legalentity>

    Hi Ludwig,

    Yes, I can post the Hour journal directly, no problems

    Screenshot for the Project time sheet setup is shown below. 

    Any other screens required, pls let me know

    pastedimage1617699794596v1.png

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Error while posting Project time sheet. info log says :The value <projectid> does not exist for <legalentity>

    Hi Riyas,

    I wonder if you could post time on the project if you post if through an hour journal.

    Also, can you share what has been setup in regards to the project timesheet usage?

    Some screenprints would help.

    Many thanks,

    Ludwig

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Error while posting Project time sheet. info log says :The value <projectid> does not exist for <legalentity>

    Hi Andre,

    This is the first time I am checking this.  We are using project module but haven't used time sheet functionality yet.

    No customizations are done on this area

    Riyas

  • Andre Arnaud de Calavon Profile Picture
    Andre Arnaud de Cal... 283,377 Super User on at
    RE: Error while posting Project time sheet. info log says :The value <projectid> does not exist for <legalentity>

    Hi Riyas,

    Can you tell if this worked correctly before? If so, what had changed?

    Do you have customizations or an add-on in this environment?

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,377 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans