Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

scan in sales line

Posted on by 2,016

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 

  • mohammed.mqi Profile Picture
    mohammed.mqi 2,016 on at
    RE: scan in sales line

    ok thanks that's useful

  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: scan in sales line

    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
    mohammed.mqi 2,016 on at
    RE: scan in sales line

    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

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    Gunjan Bhattachayya 35,421 on at
    RE: scan in sales line

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

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,280 Super User 2024 Season 2 on at
    RE: scan in sales line

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans