Total Pageviews

Showing posts with label D365 finance and operation. Show all posts
Showing posts with label D365 finance and operation. Show all posts

Friday, March 21, 2025

Preventing Price Recalculation for Imported Sales Lines ( custom price other then trade agreements price) in D365FO - X++ - Microsoft Dynamics 365 Finance & operations

 In D365FO if sales line is imported from excel using custom built solution or sales line is created from Code X++ and user provide its own unit price (price other then trade agreements) after sales line creation user go to sales order and click Recalculate and update the Unit price as per trade agreement. To stop this behavior (stop recalculation) if price is enter manually or is custom price is imported for sales line

need to add below code after you modify price in code 


Salesline.setPriceDiscChangePolicy(PriceDiscSystemSource::ManualEntry, fieldNum(Salesline, SalesPrice));

it will stop recalculating price for particuallar sales line when some one click Recalculate button on sales order 

Thursday, January 30, 2020

D365FO. Dynamics 365 fiance and operation. Get and update contract of batch job on Controller run method. ax 2012

set Batch id in contract if batch isInBatch check is true

in run method we will update the contract and set the batch id.


class BrFunctionalLocationRecordsController extends SysOperationServiceController
{
    protected void new()
    {
        super(classStr(BrFunctionalLocationRecordsService), methodStr(BrFunctionalLocationRecordsService, functionalLocationRecordsService), SysOperationExecutionMode::Synchronous);
    }

 
    public static BrFunctionalLocationRecordsController construct(SysOperationExecutionMode _executionMode = SysOperationExecutionMode::Synchronous)
    {
        BrFunctionalLocationRecordsController      controller;
        controller = new BrFunctionalLocationRecordsController();
        controller.parmExecutionMode(_executionMode);
        return controller;
    }

 
    public static void main(Args _args)
    {
        BrFunctionalLocationRecordsController controller;
        // to update contract value at main we can initialize contract here.
        //BrFunctionalLocationRecordsContract   brFunctionalLocationRecordsContract;

        controller = BrFunctionalLocationRecordsController::construct();
        //and can set contract values here
        //brFunctionalLocationRecordsContract = controller.getDataContractObject();
        controller.parmArgs(_args);
        controller.startOperation();
    }

 
    public ClassDescription defaultCaption()
    {
        return "@Br:FunctionalLocationRecords";
    }

   
    public void run()
    {
        BrFunctionalLocationRecordsContract brFunctionalLocationRecordsContract;

       //getting batch contract.
        brFunctionalLocationRecordsContract = this.getDataContractObject();
       
        Batch                                   batch;
        if (this.isInBatch())
        {
            //getting batch information;
            batch = this.currentBatch;
            //setting batch id in contract
            brFunctionalLocationRecordsContract.parmBatchHeader(batch.BatchJobId);
        }
        super();
    }

}

D365FO and Sharepoint integration issue on dev box: "You are not authorized to connect to 'https://sharepoint.sharepoint.com/

Troubleshooting SharePoint Integration After Upgrading D365FO to Version .42 After upgrading to Dynamics 365 Finance and Operations (D365FO)...