Hey everyone,
I need to create a code that prevent the customer from duplication importing the same 1000 invoices.
Right now, I created the following code:
IF ("Document No.") EXIST
Then Begin
CurrDataport. SKIP;
END;
But system gives me an error.
Any suggestions please.
[-o<
0
Comments
AutoUpdate=NO
AutoReplace=NO
http://www.BiloBeauty.com
http://www.autismspeaks.org
RIS Plus, LLC
I created dataport in Purchase Line so when I do
AutoUpdate=NO
AutoReplace=NO
I can not import anything. Our client is going to use this dataport from time to time to import its invocies so customers' No and Names can repeat.
I need system to identify by invoice No. that this invoice has been already imported. Because if client imports 1000 invoices and then found out that these invocies have been already imported and posted recently, of course it is not fun for him to delete them one by one.
To DenSter,
It does not. I thought I saw this somewhere on the forum.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Hmm - Autoreplace = No always prevents overwriting for me :-k
http://www.BiloBeauty.com
http://www.autismspeaks.org
"Hmm - Autoreplace = No always prevents overwriting for me"
Yes, that is right, but only when invoices not posted yet.
As soon as I post invoices N.1, N.2, N.3 they disapper.
When I (let's say mistakenly) import them again. System allows me to do this but when I am trying to post them it tells me that invoices with this Vendor Inovice No. already exist.
In this case I have to delete all imported invoices (what a huge work if I imported 1000)
So I want the system to identify by Invoice No. that this invoices have been already imported and posted.
Thank you
Your Not using the posted Purchase Invoice No Series.
So you want to take the Puchase Line Doc No & Search the Purch. Inv Header first to see if it exists first.
http://www.BiloBeauty.com
http://www.autismspeaks.org
But honestly it is not very clear to me.
Can you give me a hint of C/AL code for it.
Highly appreciate
Vesna
How About
OnAfterImportRecord()
http://www.BiloBeauty.com
http://www.autismspeaks.org
Yes, I am using variables to import my data.
Now, I realise that it better if I will use Vendor Invoice No. as identified point, because this number remained the same when invoice is posted, while Document No can be changed by the system according to N. Serial for Posted Purchase Invoices.
So on the basis of your code I tryed different combination but it doesn't work for me. ](*,)
The dataport accept the following code:
PurchaseHeaderRec.RESET;
If PurchaseHeaderRec. GET(VIN)
Then begin
CurrDataport.SKIP;
END;
where VIN is my variable for Vendor Invoice No.
But when I am trying to import file I see the message "The expression Text cannot be type-converted to a Option value"
If there are any ideas I appreciate greatly because I already have doubts that there is a solution for this.
:roll:
There must be more code than you're showing us.
What is VIN again? the Posted Purch Inv No? or some Order No? or something?
is VIN a key?
Is PurchaseHeaderRec a Variable for The Purchase Header or Purchase Inv Header?
http://www.BiloBeauty.com
http://www.autismspeaks.org
SalesHeader."Posting No" := varOrderNo;
SalesHeader."Shipping No" :=varOrderNo;
This way on posting all the Numbers match all the way thru from order to invoice.
This code works for us to prevent the duplication of imported orders.
If your not going to use the key - then I think a FIND function is needed
http://www.BiloBeauty.com
http://www.autismspeaks.org
good luck
Attain Navision