How to import Expense Lines

david_pinheiro
Giga Contributor

Hi Everyone,

 

I am trying to import Expense lines but I keep getting an error. The error is on the Source ID field. I can't figure out how to import to that, does anyone know how to do this

 

Thanks

1 ACCEPTED SOLUTION

Hi Lepipasc



I should have updated this!



Using the transform mapping function doesn't work to insert values in to the source id field, you have to use a transform script for it to work (don't ask me why).




This is what I used and it worked



target.source_id=source.u_source_id;


target.source_table=source.u_source_table;


View solution in original post

7 REPLIES 7

Pascal Lepine2
Kilo Contributor

Hi David,



You need to fill your cost source (CI or Task).   Source ID field will be filled automatically!


Hi Lepipasc



I should have updated this!



Using the transform mapping function doesn't work to insert values in to the source id field, you have to use a transform script for it to work (don't ask me why).




This is what I used and it worked



target.source_id=source.u_source_id;


target.source_table=source.u_source_table;


Hi David,



I added the below two lines in the Transform Script with an onBefore trigger:



target.source_id=source.u_source_id;


target.source_table=source.u_source_table;



But I am still getting the following error:



Operation against file 'fm_expense_line' was aborted by Business Rule 'Source ID check^b3b30dd96ff6e100ddcb1bd27b3ee48c'. Business Rule Stack:Source ID check



What do you think is going wrong on this one?


tangcov
Kilo Explorer

I added the below two lines in the Transform Script with an onBefore trigger:



target.source_id=source.u_source_id;


target.source_table=source.u_source_table;



But I am still getting the following error:



Operation against file 'fm_expense_line' was aborted by Business Rule 'Source ID check^b3b30dd96ff6e100ddcb1bd27b3ee48c'. Business Rule Stack:Source ID check



What do you think is going wrong on this one?