Dataport into Time Journal Line - Payroll Control Code blank

pengwenincpengweninc Member Posts: 38
I've created a dataport to bring in ADP data into the Time Journal Line.

When I bring in the data, the Payroll Control Code is blank. I've tried to use some logic to indicate which Code should be inserted depending on which fields have amounts specified in the CSV file that I am importing.

This is the code in my dataport:


Time Journal Line - OnAfterImportRecord()
IF Hours <> 0 THEN
TimJnlLine."Payroll Control Code" := 'EARN REG';
IF Hours <> 0 THEN
TimJnlLine.Earnings := Amount;

IF OTHours <> 0 THEN
TimJnlLine."Payroll Control Code" := 'EARN OVER';
IF OTHours <> 0 THEN
TimJnlLine.Earnings := OTEarn;

IF SHours <> 0 THEN
TimJnlLine."Payroll Control Code" := 'EARN SICK';
IF SHours <> 0 THEN
TimJnlLine.Earnings := SEarn;

Comments

  • matttraxmatttrax Member Posts: 2,309
    What trigger did you put the code in? Are you sure those variables are listed as DataItemFields?
  • AlbertvhAlbertvh Member Posts: 516
    Hi,

    you should do the following as I assume that the DataItem being imported is "Time Journal Line"
    Time Journal Line - OnAfterImportRecord()
    IF Hours <> 0 THEN BEGIN
      "Payroll Control Code" := 'EARN REG';
      Earnings := Amount;
    END;
    
    IF OTHours <> 0 THEN BEGIN
      "Payroll Control Code" := 'EARN OVER';
      Earnings := OTEarn;
    END;
    
    IF SHours <> 0 THEN BEGIN
      "Payroll Control Code" := 'EARN SICK';
      Earnings := SEarn;
    END;
    
    

    Hope this helps
Sign In or Register to comment.