Notifications
Announcements
No record found.
Hi Experts,
I have requirement where I need to mention barcodeId(custom added field) in counting journal line where depending upon which barcodeid is scanned / inserted its respective dimension for that product will be inserted with its count(if same product is scanned twice then its count would be 2 or else it will create new line).Here is code which I have tried.Can you guys guide me for the same? around which method event I should wrap my logic for the same?
find screenshot for the same
Hi Akshay,
What code have you tried? And what kind of issue you have? (The title and description are quite different).
Inventory dimension (InventDim) are linked to barcodes (InventItemBarcode) table by InventDimId field (there is also inventDim method on InventItemBarcode table). One you find a record in InventItemBarcode by barcode you can fetch Size, Color, and so on from related inventDim record.
You mentioned you shared the coding you had created for this. It is not included in your post. Can you share the coding?
You can use the 'Use rich formatting' to paste the code. (Insert > Insert code)
Hi @sergei i tried COC over mofiedfield but item number and name are fetched but size,color,style becomes non editable after that
here is the code for the same
[ExtensionOf(tableStr(InventJournalTrans))] final class InventJournalTransCFSTable_Extension { /// /// modifiedField /// /// _fieldId public void modifiedField(FieldId _fieldId) { next modifiedField(_fieldId); switch(_fieldId) { case fieldNum(InventJournalTrans, CFSitemBarCode): if(this.inventJournalTable().JournalType == InventJournalType::Count) { this.modifyItemBarcode(); } break; } } /// /// modifyItemBarCode /// public void modifyItemBarcode() { InventJournalTrans inventJournalTransCountQty; if(this.CFSItemBarCode) { InventItemBarcode inventItemBarcode = InventItemBarcode::findRetailBarcode(this.CFSItemBarCode); this.ItemId = inventItemBarcode.itemId; this.modifiedField(fieldNum(InventJournalTrans, ItemId)); select firstonly inventJournalTransCountQty where inventJournalTransCountQty.CFSitemBarCode == this.CFSitemBarCode && inventJournalTransCountQty.JournalId == this.JournalId && inventJournalTransCountQty.RecId != this.RecId; if(inventJournalTransCountQty.RecId) { ttsbegin; this.selectForUpdate(true); this.delete(); inventJournalTransCountQty.selectForUpdate(true); inventJournalTransCountQty.Counted = 1; inventJournalTransCountQty.skipDataMethods(true); inventJournalTransCountQty.doUpdate(); ttscommit; if(this.isFormDataSource()) { FormDataUtil::getFormDataSource(this).research(true); FormDataUtil::getFormDataSource(this).refresh(); } } else { //InventDim inventDim; //inventDim.clear(); //inventDim.InventSizeId = inventItemBarcode.inventDim().InventSizeId; //inventDim.InventStyleId = inventItemBarcode.inventDim().InventStyleId; //inventDim.InventColorId = inventItemBarcode.inventDim().InventColorId; //this.InventDimId = InventDim::findOrCreate(inventDim).inventDimId; this.Counted = 1; } } } }
Akshay,
On modifiedField extension, I would just set the ItemID, inventory dimensions and set the count to 1.
I would suggest you write logic for finding existing records and updating them extending the insert method of the same table.
After this logic has completed, do a fDs.reread() and fDS.refresh().
Do users create and put values into barcode field manually?
For me, it looks like quite a weird solution. I would personally create a lookup action button where a user can put barcode and quantity and if the user press ok, the system will find the line by barcode and update it (or create new if needed). Also, it looks like a perfect chance to use the embedded Power Apps
docs.microsoft.com/.../embed-power-apps
User will scan for the barcode and then its respective item number,name,color,size or style should be filled automatically
Are you using Warehousing app to do scanning or something else?
If the dimension fields becomes inactive after the scan, can you check if this item has a product dimension group attached with these dimensions enabled?
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.
Martin Dráb 451 Most Valuable Professional
André Arnaud de Cal... 428 Super User 2025 Season 2
BillurSamdancioglu 239 Most Valuable Professional