Hi,
Can anybody tell me how to change the warehouse to quarantine warehouse if quarantine is checked through code.
Thanks,
Raziq
*This post is locked for comments
Hi,
Can anybody tell me how to change the warehouse to quarantine warehouse if quarantine is checked through code.
Thanks,
Raziq
*This post is locked for comments
Hi Baber,
I Wrote one class method in which I am passing WmsJournalTrans table buffer as a parameter and below is the code.
public void updateQuarantineWh(WMSJournalTrans _wmsjournalTrans)
{
InventLocationId inventLocationId;
InventLocationIdQuarantine inventLocationIdQuarantine;
InventDim inventdim;
;
inventLocationId = InventDim::find(_wmsjournalTrans.inventDimId).InventLocationId;
inventLocationIdQuarantine = InventLocation::find(inventLocationId).InventLocationIdQuarantine;
inventdim = InventDim::find(_wmsjournalTrans.inventDimId);
inventdim.InventLocationId = inventLocationIdQuarantine;
inventdim = InventDim::findOrCreate(inventdim);
_wmsjournalTrans.inventDimId = inventdim.inventDimId;
_wmsjournalTrans.update();
// return inventLocationIdQuarantine;
}
This method will find quarantine warehouse of actual warehouse and update to inventdim table using findorCreate Method.
Hi Mohammad,
There is an InventDim data source on the form which is used to show the inventory dimension under Dimensions tab. You can use the below code snippet to achieve this:
ttsbegin;
select forUpdate InventLocationId from InventLocation
where InventLocation.InventLocationId == InventDim.InventLocationId;
if (InventLocation)
{
InventLocation.InventLocationType = InventLocationType::Quarantine;
InventLocation.update();
}
ttscommit;
You can write the above code in the init method of InventDim data source on form WMSJournalReception after super(). If you get any error by calling the update method above, then you can use doUpdate(), but keep in mind that it will bypass any standard validations exist in update method. Not sure what would be the impact of changing the warehouse type like this, so I would suggest you to do proper testing of this before moving this to production.
Please verify and let me know if you have further queries.
Thanks,
Baber.
yes baber.......
Hi Mohammad,
Do you want to change the warehouse showing under Dimensions tab to quarantine warehouse on Item arrival journal?
Thanks,
Baber.
Hi Baber,
Actually, When record is created in item arrival journal, every time it goes for check whether it is QuarantineCheck is marked or not. if it is marked then warehouse should changed to quarantine warehouse in the form but in dimension tab.
Is there any possibility so that we can change through code.
Thanks,
Raziq
Hi Mohammad,
You can set the warehouse to quarantine, by setting invent location type value to quarantine. The code should be as follows:
InventLocation.InventLocationType = InventLocationType::Quarantine;
Is this what you are looking for?
Thanks,
Baber.
André Arnaud de Cal...
292,978
Super User 2025 Season 1
Martin Dráb
231,821
Most Valuable Professional
nmaenpaa
101,156
Moderator