D365 Finance & Operations and Dynamics AX Forum

Blanking out the Location field in the Create lines form for sales orders & sales quotations

  • 1.  Blanking out the Location field in the Create lines form for sales orders & sales quotations

    TOP CONTRIBUTOR
    Posted 13 days ago
    Edited by Rudy Salcedo 11 days ago
    Below is the form that comes up when the "Add lines" button is clicked in the grid for sales order and sales quotation lines.  We have a business need to override the value of the  Location field (wmsLocationId) and populate it with blanks when the Warehouse (InventLocationId) is 101.

     

    In the SalesQuickQuote.tmpFrmVirtualInventDimId() method of the form, I've added code to manipulate the InventDimId when the Warehouse (InventLocationId) is "101" so that the method returns an InventDimId whose InventDim record contains all the same values as the original InventDim record that would have been determined, except that the "new" InventDim record has a blank value for wmsLocationId, which is what we need.  I've stepped through the code in the debugger and can see that the InventDimId being returned is correct.

    However when the form renders, the Location field still populates with the wmsLocationId values from the original InventDim record.

    I've tried adding the same code to determine the required InventDimId to other methods of the form, but the results are always the same, and the Location field is populated.

    The reason why we want the Location to be blank for warehouse 101 is because we want the Location to be blank in the SO & quote lines that are created via this form.

    Is it even possible to override the value that populates in the Location column?  If so, how can this be accomplished?


    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------


If you've found this thread useful, dive deeper into User Group community content by role