Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Business Central, create job with code

(0) ShareShare
ReportReport
Posted on by 453

hello everyone, 

I want to know how to create a job by code in AL/Business  Central. 

I tried this but I get an error for "Bill-to customer" field:

you cannot change Bill-to customer no, because one or more entries are associated with this job

By creating the job manually, we need to choose a customer from Customer Modal. And Bill-to city, Bill-to Address...etc. will be filledout. 

*This post is locked for comments

  • Verified answer
    Mehdi26 Profile Picture
    453 on at
    RE: Business Central, create job with code

    Hi Subhashis

    I did following to solve it, I don't get any error now.

    if Customer.GetFilter("Bill-to Customer No.") <> '' then
    
                   if Customer.GetRangeMin("Bill-to Customer No.") = Customer.GetRangeMax("Bill-to Customer No.") THEN
    
                       Job.Validate("Bill-to Customer No.", Customer.GetRangeMin("Bill-to Customer No."));


  • Suggested answer
    subhashis Das Profile Picture
    579 on at
    RE: Business Central, create job with code

    Hi 

    You Job no. correct ? As per the error some transaction already posted , so you are not allow to change the Bill-to Customer 

    Regards

    Subhashis

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

Announcing the Engage with the Community forum!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans