So you can't insert it and you can't modify it after insert?
Are you sure it's getting to that part of your code?
Did you try adding a message line to see if it's executing where you think it should? Message('executing');
Perhaps that section of code only runs for the last line instead of running for each line. Add a message('%1',"line no.");
If its just the last line then your imported=true is in the wrong place
Sale;Invoice;YVO001;TWC-SINV001;EXTDOCNO-001;11/12/2011;COD;30/09/2011;DOMESTIC;AUD;DANNY;19/09/2011;CASH;TRIPLEPACK-SCA;MENLO;PCS;1;20;20;21.4;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;Company A
Sale;Invoice;YVO001;TWC-SINV001;EXTDOCNO-001;11/12/2011;COD;30/09/2011;DOMESTIC;AUD;DANNY;19/09/2011;CASH;CCHINBBQQY;BAYS;BTL;1;30;30;32.1;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;Company A
Sale;Invoice;YVO001;TWC-SINV001;EXTDOCNO-001;11/12/2011;COD;30/09/2011;DOMESTIC;AUD;DANNY;19/09/2011;CASH;CATER-FOOD;MENLO;PCS;1;40;40;42.8;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;Company A
Sale;Credit Memo;BER001;TWC-SCR002;EXTDOCNO-002;12/12/2011;90D;30/09/2011;DOMESTIC;USD;DANNY;19/09/2011;CASH;CCHINBBQQY;BAYS;PCS;1;20;20;21.4;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;Company A
Purchase;Invoice;ANG001;TWC-PINV001;TEXTCAPSLOCK;26/12/2011;COD;30/09/2011;FOREIGN;AUD;BELINDA;20/09/2011;VISA;CATER-FOOD;MENLO;PCS;1;30;30;32.1;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;Company A
Sale;Invoice;ASA001;TWC-SINV002;EXTDOCNO-002;23/12/2011;COD;30/09/2011;DOMESTIC;USD;BELINDA;19/09/2011;CASH;BULBHOLDER;BAYS;PCS;1;20;20;21.4;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;TEXTCAPSLOCK;Company A
So you can't insert it and you can't modify it after insert?
Are you sure it's getting to that part of your code?
Did you try adding a message line to see if it's executing where you think it should? Message('executing');
Perhaps that section of code only runs for the last line instead of running for each line.
Add a message('%1 %2 %3',"Document Type","Document No.","line no.");
If its just the last line then your imported=true is in the wrong place
So you can't insert it and you can't modify it after insert?
Are you sure it's getting to that part of your code?
Did you try adding a message line to see if it's executing where you think it should? Message('executing');
Perhaps that section of code only runs for the last line instead of running for each line. Add a message('%1',"line no.");
If its just the last line then your imported=true is in the wrong place
after sales line inserted... i tried previously catch using message
and it's all correct.... imported is true, and description is Test
but after that... the result is wrong
When you validate the Customer No. on the header, Nav recreates / refresh the Sales Line. That is why the previously inserted Sales Lines Imported Field is set back to default (FALSE).
Microsoft Certified IT Professional for Microsoft Dynamics NAV
When you validate the Customer No. on the header, Nav recreates / refresh the Sales Line. That is why the previously inserted Sales Lines Imported Field is set back to default (FALSE).
Hi Dan,
another problem if we import multiple documents
previously we tried for doc TWC-SINV0001
but if we using this one... failed
i changed now my data hava 2 documents : TWC-SINV0001 and TWC-SINV0002
it was said sales header document type : invoice and no TWC-SINV0002 does not exist
Sale;Invoice;CUST001;TWC-SINV001;EXTDOCNO-001;11/12/2011;COD;30/09/2011;TWCI;AUD;DENNIES;19/09/2011;CASH;TRIPLEPACK-SCA;BLUE;PCS;3;100;10;TEXTCAPSLOCK1-1;TEXTCAPSLOCK1-2;TEXTCAPSLOCK1-3;TEXTCAPSLOCK1-4;TEXTCAPSLOCK1-5;Company A Pte. Ltd.
Sale;Invoice;CUST001;TWC-SINV002;EXTDOCNO-011;11/12/2011;COD;30/09/2011;TWCI;AUD;DANNY;19/09/2011;CASH;CCHINBBQQY;BOXSAS;BTL;1;200;20;TEXTCAPSLOCK2-1;;TEXTCAPSLOCK2-3;TEXTCAPSLOCK2-4;TEXTCAPSLOCK2-5;Company A Pte. Ltd.
When you validate the Customer No. on the header, Nav recreates / refresh the Sales Line. That is why the previously inserted Sales Lines Imported Field is set back to default (FALSE).
Hi dan, i just realized that if we do not validate the sales header for sell to cust no
then the sales header only get customer code... and not validated
i think this one is still wrong
Comments
Are you sure it's getting to that part of your code?
Did you try adding a message line to see if it's executing where you think it should? Message('executing');
Perhaps that section of code only runs for the last line instead of running for each line. Add a message('%1',"line no.");
If its just the last line then your imported=true is in the wrong place
http://www.BiloBeauty.com
http://www.autismspeaks.org
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
http://www.BiloBeauty.com
http://www.autismspeaks.org
i use boolean as normal type
after sales line inserted... i tried previously catch using message
and it's all correct.... imported is true, and description is Test
but after that... the result is wrong
Just a happy frood who knows where his towel is
now it's work
thanks for your helps
can anyone share what happened previously?
Just a happy frood who knows where his towel is
another problem if we import multiple documents
previously we tried for doc TWC-SINV0001
but if we using this one... failed
i changed now my data hava 2 documents : TWC-SINV0001 and TWC-SINV0002
it was said sales header document type : invoice and no TWC-SINV0002 does not exist
IF (SH."Document Type" <> TempDocType) AND OR (SH."No." <> TempDocNo) THEN
anyway i need these 2 conditions
i dont think i can use OR
then the sales header only get customer code... and not validated
i think this one is still wrong
Just a happy frood who knows where his towel is
i think it works
i put a code like this
thanks man ! =D>
actually there is a few things that you could do to improve the coding, such as the variable naming, use GET instead of SETRANGE, etc.
IF NOT CheckSalesHeader.GET(SH."Document Type",SH."No.") THEN
SH.VALIDATE(SH."Sell-to Customer No.")
ELSE
SH.GET(SH."Document Type",SH."No.");
I will let you decide it for yourself though.
Just a happy frood who knows where his towel is
thanks a lot Dan