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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

scan in sales line

(0) ShareShare
ReportReport
Posted on by 2,050

greeting everyone 

i have tow question 

i'v created duplicate from this form (SalesTableLineQuantity)

and i did some modify in this duplicated 

pastedimage1603370465796v1.png

1- my for this form is let user do scan for barcode in that text box above and then if the item existing in line it will automatic will be increased 1 to  delivery now field until equal to SalesQty

how can i do that?!!

 

2- i need to create button to clear all delivery now field from all lines 

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    304,508 Super User 2026 Season 1 on at

    Hi Mohammed,

    My two cents here:

    1) Do you already have barcode scanner? There are devices (USB barcode scanner) which could read a barcode and convert it in text. It is then acting as an additional keyboard.

    2) You can decide to create a button and add coding on or the form on a table or in a separate class. The method could have an update_recordset command with a where clause for the best performance. docs.microsoft.com/.../update-recordset

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

    Hi mohammed,

    1. You can write the logic in the modified method of the "Barcode" text field. Have you added a bar code field to sales order lines? You can write logic for increasing the quantity on sales order lines.

    SalesLine   salesLineLoc;
    
    ttsBegin;
    
    select firstOnly forUpdate salesLineLoc 
        where salesLineLoc.SalesId == salesTable.SalesId
           && salesLineLoc.BarCode == barCode.text(); //Assuming that the control name for "Barcode" field is barCode
        
    salesLineLoc.SalesDeliverNow  = 1;
    if (salesLineLoc.SalesDeliverNow <= salesLineLoc.SalesQty)
    {
        salesLineLoc.update();
    }
        
    ttsCommit;
    
    salesLine_ds.reread();
    salesLine_ds.refresh();

    2. You can add a new button and write the logic to clear the Deliver now field for all lines in the clicked method .

    SalesLine   salesLineLoc;
    
    update_recordset salesLineLoc 
        setting SalesDeliverNow = 0
            where salesLineLoc.SalesId == salesTable.SalesId
        
    salesLine_ds.reread();
    salesLine_ds.refresh();

  • mohammed.mqi Profile Picture
    2,050 on at

    thanks all for replay 

    yes i'm usin barcode scanner 

    Mr.Gunjan Bhattacharyya i used your code and it works fine but i can only use it once 

    i mean if have many (3 Quantity) from same barcode and i did first scan it's enter 1 on DeliverNow

    but when i scan again same item nothing change and not increasing the quantity for DeliverNow

    i must closed form and open it again maybe i need to improve the code to allow me scan same barcode many times

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

    Hi mohammed,

    You can try clearing the value of the barcodetext field after each increment. Please try this code at the end of the modifiedfield.

    barCode.text('');

  • mohammed.mqi Profile Picture
    2,050 on at

    ok thanks that's useful

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 694

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 646 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 337

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans