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 :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Getting error while adding records in custom table

(3) ShareShare
ReportReport
Posted on by 2,382
Hi Experts,
 
I have custom table. While adding a records getting error "Field 'Dimension number' must be filled.
 
This table(AT_SAGlineDelete) is created by another person.I do not know why inventDimId field is Allow Edit "No" Allow Edit On Create "No" Mandatory "Yes"
 
There is no any relation on table level.
 
 
Form:
 
There is no InventDimId field as shown in below form.
 
 
Table:
I have the same question (0)
  • Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at
    We can't tell you while the other person created the table this way. You'll can talk to him/her, look how other code uses the table and/or check the business requirement that the table was created for.
     
    That you don't see the field in the form simply means that it hasn't been added there. Users are usually interested in the actual dimensions such as the warehouse, not an ID that the system assigned to the combination of dimensions.
  • faiz7049 Profile Picture
    2,382 on at
    Hi Martin,
     
    Code is written on form level as below.
     
    Even form level adding records throw same error.
     
    [Form]
    public class AT_SAGLineDeleteForm extends FormRun
    {
        
        [Control("Button")]
        class DeleteButton
        {
            /// <summary>
            ///
            /// </summary>
            public void clicked()
            {
                super();
                AgreementLine           _agreementLine, agreementLineloc;
                InventDim               inventDim , inventDimToFind;
                AgreementHeader         _agreementHeader;
                SalesAgreementHeader    agreementHeader;
                AT_SAGlineDelete        at_SAGDeleteLine, at_SAGDeleteLineUpd;
                boolean                 check;
                
    
                while select at_SAGDeleteLine
                    where at_SAGDeleteLine.IsCheckSAG == NoYes::No
                {
                    inventDimToFind.configId            = at_SAGDeleteLine.configId;
                    inventDimToFind.InventSizeId        = at_SAGDeleteLine.InventSizeId;
                    inventDimToFind.InventColorId       = at_SAGDeleteLine.InventColorId;
                    inventDimToFind.InventStyleId       = at_SAGDeleteLine.InventStyleId;
                    inventDimToFind.INVENTBATCHID       = at_SAGDeleteLine.inventBatchId;
                    inventDimToFind.LicensePlateId      = at_SAGDeleteLine.LicensePlateId;
                    inventDimToFind.INVENTSITEID        = at_SAGDeleteLine.InventSiteId;
                    inventDimToFind.INVENTLOCATIONID    = at_SAGDeleteLine.InventLocationId;
                    inventDimToFind.WMSLOCATIONID       = at_SAGDeleteLine.wMSLocationId;
                    inventDimToFind.INVENTSTATUSID      = at_SAGDeleteLine.InventStatusId;
                    inventDimToFind.InventOwnerId_RU    = at_SAGDeleteLine.InventOwnerId_RU;
                    inventDimToFind.InventVersionId     = at_SAGDeleteLine.InventVersionId;
                    inventDimToFind.inventSerialId      = at_SAGDeleteLine.inventSerialId;
                    inventDimToFind.wMSPalletId         = at_SAGDeleteLine.wMSPalletId;
                    inventDimToFind.inventBatchId       = at_SAGDeleteLine.inventBatchId;
            
                    inventDim = InventDim::findOrCreate(inventDimToFind);
    
                    select firstonly agreementHeader 
                        where agreementHeader.SalesNumberSequence == at_SAGDeleteLine.SAGId ;
                    while select agreementLineloc 
                        order by RecId desc
                        where agreementLineloc.Agreement == agreementHeader.RecId
                        && agreementLineloc.InventDimId == inventDim.inventDimId
                        && agreementLineloc.ItemId == at_SAGDeleteLine.ItemId
               
                    if(agreementLineloc.RecId)
                    {
                        
                        ttsbegin;
                        select forupdate _agreementLine where _agreementLine.RecId == agreementLineloc.RecId;
                        if(_agreementLine)
                        {
                            _agreementLine.selectForUpdate(true);
                            _agreementLine.dodelete();
                            check = true;
    
                        }
                        if(check==true)
                        {
                            select forupdate  at_SAGDeleteLineUpd 
                                where at_SAGDeleteLineUpd.RecId == at_SAGDeleteLine.RecId;
    
                            at_SAGDeleteLineUpd.IsCheckSAG = NoYes::Yes;
                            at_SAGDeleteLineUpd.update();
                        }
                        info("record deleted");
                        ttscommit;
                
                    }
                }
    
            }
    
        }
    
        [Control("String")]
        class AT_SAGlineDelete_InventSiteId
        {
            /// <summary>
            ///
            /// </summary>
            public void lookup()
            {
                super();
                
    
                SysTableLookup        sysTableLookup  = SysTableLookup::newParameters(tableNum(InventSite), this);
    
                sysTableLookup.addLookupfield(fieldNum(InventSite, SiteId));
                sysTableLookup.addLookupfield(fieldNum(InventSite, Name));
                sysTableLookup.performFormLookup();
              
            }
    
        }
    
    }
     
  • Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at
    I'm sorry, but I can't tell you why your team designed the table this way. You need to discuss the intention internally instead of asking strangers on internet.
  • Mike Foss Profile Picture
    51 on at
    When a new record is being added to your custom table, do you know if the InventDimId field is ever being explicitly set in the code?
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,194 Super User 2025 Season 2 on at
    Hi faiz,
     
    The InventDumId is usually used to have a unique conbination of inventory dimensions, like size, site, warehouse, or batch number. You have these dimension fields on your form. With help of X++ coding, an existing value for the InventDimId should be found or a new one created. I think your developer forgot about adding the required coding. There are examples how to do that on other forms in the application, like inventory journal lines, sales lines, and more. 
    You need to solve this with your developer.
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,438 Super User 2025 Season 2 on at
    Hi faiz7049,
     
    InventDimId is a value that is generated as a 100 character string value at the database level. It is never explicitly set in through code. Instead, InventDimId is retrieved based on this the product dimensions (Configuration, Size, Color, Style), storage (Site, Warehouse, Location,Inventory status, Licensing plate etc.) and/or tracking dimensions (Batch number, Serial number, Lot number etc.). 
    Screenclip below highlights how the InventDimID is stored in the database and is usually tied to a product dimension/storage/tracking dimension.
     
    A few questions:
    - Why do we need the InventDimId to be manually created through code?
     
    Looking at the screen clip above it should be retrieved as a pre-existing value through the ItemId. Depending on the scenario in place, you can refer to this piece of code available under InventProductDimension class through which you can retrieve the inventDimId.
     
    Hope this helps. Happy to answer questions, if any.
     

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 > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 307 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 67 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans