Tuesday, 13 September 2016

Code for Department

   select firstOnly ITLHRWorkerTransfer
    order by assignmentstartdatenew desc
     where  ITLHRWorkerTransfer.PersonnelNumber == ITLPayReimbursementApplication.EmplID &&
            ITLHRWorkerTransfer.WorkflowApprovalStatus == ITLWorkflowApprovalStatus::Approved;
    dimStorage = DimensionAttributeValueSetStorage::find(ITLHRWorkerTransfer.DimensionDefaultNew);

      for (i= 1 ; i<= dimStorage.elements() ; i++)
      {
        if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "Department")
          {
            select _omoperatingunit where _omoperatingunit.OMOperatingUnitNumber == dimStorage.getDisplayValueByIndex(i);
            ITLPayAppChildTMP.Department = _omoperatingunit.Name;
          }

       }

No comments:

Post a Comment

POSTMAN D365

  Postman is useful to test the behavior of different OData class from/to D365FO. In this post we will see the steps to setup Postman with D...