Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Employee Benefits - EConnect SDk

Posted on by Microsoft Employee

How to set taCreateEmployeeBenefitsBasedOnPayDedCodes_Items from the default Benefit setup record?

My code so far is as below

Dim benefitds As DataSet = vEmpBenefit.EmplBenefitDataset

If benefitds.Tables(0).Rows.Count > 0 Then

Dim benefitdr As DataRow

For Each benefitdr In benefitds.Tables(0).Rows

Dim oUPRCreateEmpBenefitType As New GP10.UPR.UPRCreateEmployeeBenefitType

Dim oUPREmpBenefit As New GP10.UPR.taCreateEmployeeBenefit

Dim oUPREmpBenefitBasedonPayDedCodes As New GP10.UPR.taCreateEmployeeBenefitBasedOnPayDedCodes

oUPREmpBenefit.EMPLOYID = benefitdr.Item("EmployID")

oUPREmpBenefit.BENEFIT = benefitdr.Item("Benefit")

oUPREmpBenefit.BNFBEGDT = benefitdr.Item("BenStartDate")

'The foll. replaces the need for sending in other information on the record, E-Connect will now use what is in the master setup for that.

oUPREmpBenefit.UseDefaultCoBenefit = GP10.UPR.taCreateEmployeeBenefit.UseDefaultCoBenefitType.ecTrue

 oUPRCreateEmpBenefitType.taCreateEmployeeBenefit = oUPREmpBenefit

oUPRCreateEmpBenefitType.taCreateEmployeeBenefitsBasedOnPayDedCodes_Items = New List(Of GP10.UPR.taCreateEmployeeBenefitBasedOnPayDedCodes)

Dim strXMLDoc As String = oUPRCreateEmpBenefitType.SerializeEmployeeBenefitObject()

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Employee Benefits - EConnect SDk

    This is what I finally ended up doing as the following statement was not populating the Based On PayCodes from Benefit setup.

    oUPREmpBenefit.UseDefaultCoBenefit = GP10.UPR.taCreateEmployeeBenefit.UseDefaultCoBenefitType.ecTrue

    I got the BasedOnPayCodes list from the database for the Benefit I was building the XML for used the following code to build to my XML.

    oUPRCreateEmpBenefitType.taCreateEmployeeBenefit = oUPREmpBenefit

    ---code to get the Based On Codes from database

    For Each basedOnCodedr In filteredTable.Rows()

    Dim oUPREmpBenefitBasedonPayDedCodes_1 As New GP10.UPR.taCreateEmployeeBenefitBasedOnPayDedCodes

    oUPREmpBenefitBasedonPayDedCodes_1.EMPLOYID = basedOnCodedr.Item("EmployID")

    oUPREmpBenefitBasedonPayDedCodes_1.BSDONCDE = basedOnCodedr.Item("BSDONCDE")

    oUPREmpBenefitBasedonPayDedCodes_1.BENEFIT = basedOnCodedr.Item("BENEFIT")

    oUPREmpBenefitBasedonPayDedCodes_1.BORCDTYP = basedOnCodedr.Item("BORCDTYP")

    oUPRCreateEmpBenefitType.taCreateEmployeeBenefitsBasedOnPayDedCodes_Items.Add(oUPREmpBenefitBasedonPayDedCodes_1)

    Next

    Dim strXMLDoc As String = oUPRCreateEmpBenefitType.SerializeEmployeeBenefitObject()

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans