Hi
In my C/al code I have to increment the the 'last number used' field in the 'no. Series Line' table.
**************************************
I load the last number used in variable docno :
**************************************
docno:=NoSeries."Last No. Used"
*****************
the variables are:
*****************
docno =>code
NoSeries => record of subtype No. Series Line
**********************************************************
now I want to increment docno and then inject it in the table to update "Last number used" field.
**********************************************************
docno=docno+1 wont work since docno is of Code type and not integer.
Does anyone know how I can increment such a variable ? Or maybe convert a Code type to integer and then vice versa?
thank you !
0
Comments
Why not make docno type integer. do what you need to do
DocNo := DocNo + 1;
etc.
and then use the format function when all is done to take your result and put it in a code field?
http://www.mibuso.com/forum/viewtopic.php?t=19147
code_variable := FORMAT(integer_variable);
note: use the EVALUATE function to convert Code to Integer
***Why isn't your No. Series incrementing in the first place? Perhaps this is the question you should be asking? Like I said I'm not sure what you are trying to accomplish.
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org
I want to change the number that is by default in the 'No.' field when I open the 'purchase invoice ' form.
that number coresponds to 'P-INV' in the 'no. series line' table
I thought that by changing 'Last No. Used' it would change the No that appears by default when I open the form, but it doesnt work : / .
Does anyone know how to modify what apears by default in the 'No.' field when you open the 'purchase invoice ' form?
thanks a lot
Onopen form you want it to automatically have an order number so you can get right to putting an order in or whatever.
Now this has been discussed a few times (i'll search for it later) but if you do this then everytime you open the form a new order will be created even if you just want to look at it again. Now this WILL create (eventually) a bunch of open, unsued orders sitting around.
is F3-enter really to much to do?
**edit
Here's one
http://www.mibuso.com/forum/viewtopic.php?t=5964
maybe David can fix the MBSonline links for me [-o<
I like this one too
http://dynamicsuser.net/forums/thread/67711.aspx
http://www.BiloBeauty.com
http://www.autismspeaks.org
I have created an XML port to import XMLs containing info on invoices. The info gets dumped in the general journal line table.
I use the code in the 'No.' field of the purchase invoice form to fill the field 'document no.' in the general journal for each record.
So suppose the 'No'. on the purchase invoice form is set a 1001 by default when I open the purchase invoice form.
If I import 10 XMLs, which create 10records in GJ line table. Those 10 records must have 'Document No.' 1001 1002 1003...1011.
Then suppose after that I want to insert a purchase manually with the 'Purchase invoice form', I want to have it so that when I open the form I get 1012 set in the 'No.' field by default.
I'm stuck on initializing that 'No.' field
](*,)
thanks in advance
I'm not and XML port expert but perhaps this can point you in the direction you need to go.
http://www.mibuso.com/forum/viewtopic.php?t=18748
http://www.BiloBeauty.com
http://www.autismspeaks.org
actually never mind the xml port part
just wondering where you initialize the default "No." field in the purchase invoice form. ](*,)
thats the thing I'm trying to increment
ok what i understand now is that you are using Numbers but the No. series is NOT increasing. when you import. so for each imported "thing" you want to increase the no series by that #.
You would have to update the No. Series Line Table (309).
find your series code P-INV (or whichever)
change the Last # usedfield.
then add a "No. Series Line".MODIFY; statement.
I really think using # series management codeunit to enter the numbers while importing is the way to go.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I coded the thing so that it increment the "last No. used' Field for P-INV in 'No Series line' table. But for some weird reason it doesn't change the default value in 'No." when you pop a Purchase invoice form although 'Last No used' has changed ](*,) ](*,) ](*,)
It looks like the Purchase invoice form doesn't read in the No Series line table when it initializes #-o #-o #-o
Where does it read that default value?
:-k :-k :-k
so you see that the last no used HAS BEEN changed by your code in the no series line table (309)?
http://www.BiloBeauty.com
http://www.autismspeaks.org
The wheel has already been invented!
On Pre Report or Data Item
PurchSetup.GET;
PurchSetup.TESTFIELD("Invoice Nos");
In your code and the G/L Line you are making
CLEAR(NoSeriesMgt);
"Document No." := NoSeriesMgt.GetNextNo(PurchSetup."Invoice Nos",TODAY,TRUE);
This will use the next number and update the number series, if I am reading your post correctly?
David
NOTE:
//If you wanted to Insert Purchase Invoices in code
PurchHeader.INIT;
PurchHeader."Document Type" := PurchHeader."Document Type"::Invoice;
//Clear the Number as Init leaves the old value
PurchHeader."No." := '';
PurchHeader.INSERT(TRUE);
This will use the next number and update the "No Series"
Add your Vendor etc and Modify, then create your lines
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com