Hi everyone,
Need to set a default warehouse for specific types of order in the form below.
Kindly assist
Best answer by jinin
View originalHi everyone,
Need to set a default warehouse for specific types of order in the form below.
Kindly assist
Best answer by jinin
View originalHi
You can create/modify the Warehouse selector like the below:
[PXSelector(typeof(Search<APDiscount.discountID,
Where<APDiscount.bAccountID,
Equal<Current<VendorDiscountSequence.vendorID>>>>))]
Note: Change DAC and Field Names as per your requirement.
Hope this may help you!
Moulali Shaik.
Hi
You can also write the logic in the Order Type Field updated event, based on the order type you can assign the Warehouse for the field.
Example,
protected virtual void SOOrder_OrderNbr_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
{
if (e.Row == null) return;
SOOrder row = (SOOrder)e.Row;
row.SiteID = warehouseID; // Assign the Warehouse for the field
}
Thank you for all your responses
But am stack a bit. New to acumatica.
To be more specific of what I need. When I select DS order type the warehouse FGS should be the default one or it should populate itself upon choosing this specific order type.
All responses will be highly appreciated
Thank you
Hi
In that case, you need to follow as jinin suggested.
For Example:
protected void _(Events.FieldUpdated<DACNAME, DACNAME.inventoryID> e)
{
var row = (DACNAME)e.Row;
if (row == null) return;
InventoryItem inventory = SelectFrom<InventoryItem>
.Where<InventoryItem.inventoryID.IsEqual<@P.AsInt>>
.View.Select(this,row.InventoryID);
if(inventory != null)
{
row.Description = inventory.Descr;
}
}
Note: Make the field Layout property commitChanges = true.
Hope this helps you!
Thanks,
Moulali Shaik.
Hi
You can also write the logic in the Order Type Field updated event, based on the order type you can assign the Warehouse for the field.
Example,
protected virtual void SOOrder_OrderNbr_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
{
if (e.Row == null) return;
SOOrder row = (SOOrder)e.Row;
row.SiteID = warehouseID; // Assign the Warehouse for the field
}
Note: When one choose a value for the Inventory ID the warehouse field is updated.
So I decided to to go along with
But I got the following error
Maybe because the field is set to accept Integer values;
How should I go along with this?
Kindly help.
Hi
you should write the BQL to get the SiteID from the INSite table.
Example,
protected virtual void SOOrder_OrderNbr_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
{
if (e.Row == null) return;
SOOrder row = (SOOrder)e.Row;
INSite site = PXSelectReadonly<INSite, Where<INSite.siteID, Equal<Required<INSite.siteID>>>>.Select(Base, "WarehouseName");
row.SiteID = site?.siteID;
}
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.