Notifications
Announcements
No record found.
while importing csv file into table. how can i check record is already exist or not
*This post is locked for comments
You can query it from sql. check if it imported or not.
also it based on which import tool you are using custom or AX standard import tool.
AX give you info log contains imported tables.
thank you Ramy,
This is my code for importing file
CommaIo File; container File_container; Counter counter1,Line_counter; counter1 =0; Line_counter =0;
File = new CommaIo("D:\\Temp\\Example.csv",'r'); if(File) { HeaderTable.insert();
while(File.status()==IO_Status::Ok)
{
try{ File_container = File.read(); Line_counter++;
if(File && Line_counter>0 && (con2Str(File_container))!='') { ign_Ume_LineTable.PurchaseId= str2int(conPeek(File_container,1)); ign_Ume_LineTable.Qty = str2int(conPeek(File_container,2)); ign_Ume_LineTable.Price= str2int(conPeek(File_container,3)); Ign_Ume_LineTable.ID= HeaderTable.RecId; ign_Ume_LineTable.insert();
counter1++; info(strFmt(" - %1 - %2 -%3 -%4",conPeek(File_container,1),conPeek(File_container,2),conPeek(File_container,3),HeaderTable.RecId));
}
} catch {
info(strFmt("Exception at line %1",Line_counter));
info(strFmt('%1 records inserted out of %2',Counter1,Line_counter)); }
when next time this code execute..i want to check records are exist or not into table ..?
Ok, you can run
select ign_Ume_LineTable where <YourTableId> == <Insered Field ID>
if ( !ign_Ume_LineTable)
// Run Your code for insertion Here
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Priya_K 4
Martin Dráb 4 Most Valuable Professional
Sukrut Parab 2 Moderator