Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Product receipt - Numb...
Finance forum
Suggested answer

Product receipt - Number seq

Posted on by 23

Hi All,

I'm currently working on generating a custom number sequence for product receipt in purchase orders.

I've mapped the number sequence into the NUM field in PURCHPARMTABLE, but unfortunately, it's not functioning as expected. During debugging, I consistently receive a number sequence value, but it's not populating the NUM field.

If anyone has insights or suggestions on resolving this issue, I'd greatly appreciate your assistance.

Thank you.

 
 
 
 
 
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,246 Super User 2024 Season 2 on at
    Product receipt - Number seq
    Hi,
     
    So you mean to say that the num variable did get a value assigned, but in the same method this.Num was not getting the same value? 
  • Community member Profile Picture
    Community member 23 on at
    Product receipt - Number seq
    I debugged the standard code, but no value was assigned to that field."
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,246 Super User 2024 Season 2 on at
    Product receipt - Number seq
    Did you check the comment from Rachit? He mentioned that the value might have been overwritten after the number sequence value was set to the NumberSeqTable.Num field in your code extension. 
  • Community member Profile Picture
    Community member 23 on at
    Product receipt - Number seq

    The user doesn't want to manually enter values in the Product Receipt, so they requested a custom number sequence for that purpose.

    I created a custom number sequence and successfully tested it by assigning the number sequence value to a string variable.

    However, the issue arises when tracking the Product Receipt field in the PURCHEDITLINES form, which is mapped to the NUM field in PURCHPARMTABLE.

    Although I attempted to assign the number sequence value to the NUM field using methods such as initvalue(), create(), and insert(), the Product Receipt field continues to have a null value.

    I'm unsure where the mistake lies in this process.

  • Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 8,945 Super User 2024 Season 2 on at
    Product receipt - Number seq
    Hi,
     
    can you share with us all steps ?
     
    BR,
    Mohamed Amine MAHMOUDI
  • Community member Profile Picture
    Community member 23 on at
    Product receipt - Number seq
    I tried both scenarios insert method and create method. it's not working
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 8,945 Super User 2024 Season 2 on at
    Product receipt - Number seq
    Hi,
     
    Try to override the create method on datasource on your form
    public void create(boolean _append = false)
    {
        super(_append);
    
        yourtable.Num= NumberSeq::newGetNum(purchparameters::numRefproductReceipt()).num();;
    }
    Best regards,
    Mohamed Amine MAHMOUDI
  • Suggested answer
    Rachit Profile Picture
    Rachit 4,011 User Group Leader on at
    Product receipt - Number seq
    Probably your value assignment is getting reset by any standard logic and you will need to debug the process to find it out. Alternatively, you also try extending the insert method of the table.
  • Community member Profile Picture
    Community member 23 on at
    Product receipt - Number seq
    This is the code I wrote in PURCHPARMTABLE. While debugging, I confirmed that I am receiving the value of the number sequence. However, it is not being displayed in the PURCHEDITLINES form.
     
     
    public void initValue()
        {
            Num num;
            NumberSeq numberSeq;
            numberSeq = numberSeq::newGetNum(purchparameters::numRefproductReceipt());
            num  = numberSeq.num();
            numberSeq.used();
            next initValue();
            this.Num = num;
        }
  • Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 8,945 Super User 2024 Season 2 on at
    Product receipt - Number seq
    Hi,
     
    can you share with us the code ?
     
    Best regards,
    Mohamed Amine MAHMOUDI

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,246 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,041 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans