Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] table 1001 "Job Task" - OnBeforeBillToCustomerNoUpdated, OnBillToCustomerNoUpdatedOnAfterCopyFieldsFromBillToCustomer, OnAfterBillToCustomerNoUpdated #27281

Closed
pri-kise opened this issue Sep 19, 2024 · 1 comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area ships-in-future-update Fix ships in a future update

Comments

@pri-kise
Copy link
Contributor

pri-kise commented Sep 19, 2024

Describe the request

Could you please add the following events?

local procedure BillToCustomerNoUpdated(var JobTask: Record "Job Task"; var xJobTask: Record "Job Task")
var
    BillToCustomer: Record Customer;
begin
    //+EVENT
    OnBeforeBillToCustomerNoUpdated(Job, xJob, CurrFieldNo);  
    //-EVENT  
    CheckBillToCustomerAssosEntriesExist(JobTask, xJobTask);

    if (xJobTask."Bill-to Customer No." <> '') and (not GetHideValidationDialog()) and GuiAllowed() then
        if not Confirm(ConfirmChangeQst, false, BillToCustomerTxt) then begin
            JobTask."Bill-to Customer No." := xJobTask."Bill-to Customer No.";
            JobTask."Bill-to Name" := xJobTask."Bill-to Name";
            exit;
        end;

    // Set sell-to first if it hasn't been set yet.
    if (JobTask."Sell-to Customer No." = '') and (JobTask."Bill-to Customer No." <> '') then
        Validate("Sell-to Customer No.", JobTask."Bill-to Customer No.");

    if JobTask."Bill-to Customer No." <> '' then begin
        BillToCustomer.Get(JobTask."Bill-to Customer No.");
        JobTask."Bill-to Name" := BillToCustomer.Name;
        JobTask."Bill-to Name 2" := BillToCustomer."Name 2";
        JobTask."Bill-to Address" := BillToCustomer.Address;
        JobTask."Bill-to Address 2" := BillToCustomer."Address 2";
        JobTask."Bill-to City" := BillToCustomer.City;
        JobTask."Bill-to Post Code" := BillToCustomer."Post Code";
        JobTask."Bill-to County" := BillToCustomer.County;
        JobTask."Bill-to Country/Region Code" := BillToCustomer."Country/Region Code";
        JobTask."Payment Method Code" := BillToCustomer."Payment Method Code";
        JobTask."Payment Terms Code" := BillToCustomer."Payment Terms Code";

        Job.Get("Job No.");
        if Job."Bill-to Customer No." = BillToCustomer."No." then
            "Invoice Currency Code" := Job."Invoice Currency Code"
        else
            "Invoice Currency Code" := BillToCustomer."Currency Code";

        JobTask."Language Code" := BillToCustomer."Language Code";
        //+EVENT
       OnBillToCustomerNoUpdatedOnAfterCopyFieldsFromBillToCustomer(JobTask, xJobTask, Job, BillToCustomer);
        //-EVENT
        GetCustomerContact(JobTask."Bill-to Customer No.", JobTask."Bill-to Contact No.", JobTask."Bill-to Contact");
        CreateDefaultJobTaskDimensionsFromCustomer(JobTask."Bill-to Customer No.");
    end else begin
        JobTask."Bill-to Name" := '';
        JobTask."Bill-to Name 2" := '';
        JobTask."Bill-to Address" := '';
        JobTask."Bill-to Address 2" := '';
        JobTask."Bill-to City" := '';
        JobTask."Bill-to Post Code" := '';
        JobTask."Bill-to County" := '';
        JobTask."Bill-to Country/Region Code" := '';
        JobTask."Language Code" := '';
        JobTask."Bill-to Contact" := '';
        JobTask."Bill-to Contact No." := '';
        JobTask."Payment Method Code" := '';
        JobTask."Payment Terms Code" := '';
    end;

    if (xJobTask."Bill-to Customer No." <> '') and (JobTask."Bill-to Customer No." <> xJobTask."Bill-to Customer No.") then
        UpdateCostPricesOnRelatedJobPlanningLines(JobTask);
   //+EVENT
   OnAfterBillToCustomerNoUpdated(JobTask, xJobTask, BillToCustomer, CurrFieldNo);
   //-EVENT
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeBillToCustomerNoUpdated(var JobTask: Record "Job Task"; xJobTask: Record "Job Task"; CallingFieldNo: Integer)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBillToCustomerNoUpdatedOnAfterCopyFieldsFromBillToCustomer(var JobTask: Record "Job Task"; xJobTask: Record "Job Task"; Job: Record Job; BillToCustomer: Record Customer)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterBillToCustomerNoUpdated(var JobTask: Record "Job Task"; xJobTask: Record "Job Task"; BillToCustomer: Record Customer; CallingFieldNo: Integer)
begin
end;

Additional context

We need similiar integration points as in job to transfer custom fields and add custom processing.
Internal work item: AB#549878

@haoranpb haoranpb added event-request Request for adding an event SCM GitHub request for SCM area labels Sep 20, 2024
@JesperSchulz JesperSchulz added the ships-in-future-update Fix ships in a future update label Sep 26, 2024
@JesperSchulz
Copy link
Contributor

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 24747.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area ships-in-future-update Fix ships in a future update
Projects
None yet
Development

No branches or pull requests

3 participants