Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Record is not compatible with Codeunit.Run(Record(37) error

(0) ShareShare
ReportReport
Posted on by 15

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)

pastedimage1599549304436v1.png 

pastedimage1599549740502v2.png

  • Predator75 Profile Picture
    35 on at
    RE: Record is not compatible with Codeunit.Run(Record(37) error

    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.

  • MarisolC Profile Picture
    103 on at
    RE: Record is not compatible with Codeunit.Run(Record(37) error

    Were you able to solve this? Would you mind sharing how did you make it work? Thanks!

  • Ayesha Naeem Profile Picture
    15 on at
    RE: Record is not compatible with Codeunit.Run(Record(37) error

    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. 

  • Suggested answer
    Mohana Yadav Profile Picture
    60,234 Super User 2025 Season 1 on at
    RE: Record is not compatible with Codeunit.Run(Record(37) error

    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?

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans