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
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()
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156