Skip to main content

Notifications

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

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

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

Categories:
  • Predator75 Profile Picture
    Predator75 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
    MarisolC 338 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
    Ayesha Naeem 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
    Mohana Yadav 59,137 Super User 2024 Season 2 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans