web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

fetch product size,color and style based on selected barcode number

(0) ShareShare
ReportReport
Posted on by 255

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

1832.Screenshot_5F00_3.png

5280.Screenshot_5F00_1.png

I have the same question (0)
  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    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.

  • André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Akshay,

    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)

  • Akshay Thombare Profile Picture
    255 on at

    Hi @sergei i tried COC over mofiedfield but item number and name are fetched but size,color,style becomes non editable after that

  • Akshay Thombare Profile Picture
    255 on at

    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;  
           }  
         }  
       }  
     }  

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    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().

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Akshay,

    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

  • Akshay Thombare Profile Picture
    255 on at

    User will scan for the barcode and then its respective item number,name,color,size or style should be filled automatically

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi Akshay,

    Are you using Warehousing app to do scanning or something else?

  • André Arnaud de Calavon Profile Picture
    301,109 Super User 2025 Season 2 on at

    Hi Akshay,

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans