I'm getting an error while creating batch jobs in business central 'Record(472) is not compatible with Codeunit.Run(Record(37) error'
I am trying to ship SO through batch jobs. In job queue entries If I use 'report' as object type to run and select object type to run '296' (batch post sales order) The SO is posting (and invoicing) and a shipment is also creating but no pick list is generating (pick toggle is set to yes on warehouse and it does create picking list when SO is manually created)
I want to ship SO but with segregated processes
1. Batch job SO release - object Id to run '414' (release sales document)
2. Batch job creation of WH shipment - object id to run '64' (sales - get shipment)
3. Batch job creation of pick list - object id to run '5778' whse - create pick
4. Batch job registration of picking list - object id to run isnt available
5. Batch job posting of WH shipment - object id to run '5763' (whse - post shipment)
These processes are present in object type to run 'codeunit' but on selecting any of the object types to run, I get the above mentioned error 'Record(472) is not compatible with Codeunit.Run(Record(37) error' as soon as I set the status to ready (after changing time and dates)
The record 472 is from the Job Queue Entry table. The Codeunit is expecting the table 37 (Sales Line). I rewrote the Codeunit to use the TableNo = Job Queue Entry and the error went away.
Were you able to solve this? Would you mind sharing how did you make it work? Thanks!
When object type to run code unit is selected, for all of the 'object id's to run' mentioned above I get the same error that record is not compatible.
it seems like you are calling a function which has parameter as record 472 but you are passing record 37.
which function are you calling?
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