web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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

I have the same question (0)
  • Suggested answer
    subhashis Das Profile Picture
    579 on at

    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

  • Verified answer
    Mehdi26 Profile Picture
    453 on at

    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."));


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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans