Notifications
Announcements
No record found.
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 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?
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.
Do you want to change the warehouse showing under Dimensions tab to quarantine warehouse on Item arrival journal?
yes baber.......
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.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.
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.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Priya_K 4
Martin Dráb 4 Most Valuable Professional
Sukrut Parab 2 Moderator