Records already exist (VendTable)

Hi,

Someone please help me,how can i solved this problem…because i need to update the records
then, it become error.

thank you,

Can you be more clear please?

What are you trying to do and which version are you using?

Im using version ax2012, just now i want to use the existing data for update in VendTable.After i run i got the error message which is “Cannot Create The Records (AccountNum) already exists”.

What are you actually doing - trying to create a new vendor or trying to run an update on existing records - how are you running an update if it is an update (tool, setting and process)?

i want to update the existing records in vend table… i also already using ’ .Update() ’ .its still got error…

Please elaborate.

just now, i creating code to update records in vend table, but its still cannot update…

the error appear like this “Cannot create records (Vendtable) the record (AccountNumber) is already is in Vendtable”

Kindly your help,
Thanks,

paste your Coding here!!

here my codes,

first, i assign the variable,

straccountno = _sqldatareader.get_Item(“AccNum”);
tblVend = VendTable::find(straccountno,true);
edtName = tblVend.Name;
edtpartyRecId = DirPartyTable::createNew(DirPartyType::Organization,edtName).RecId;

if(!tblVend)

{

tblVend.clear();

tblVend.initValue();

tblVend.AccountNum = straccountno;

tblVend.Name = _tblprofile.Name;

tblVend.Party = edtpartyRecId;
tblVend.Dimension = strDimension;
tblVend.insert();
}
else
{
tblVend.AccountNum = straccountno;
tblVend.Name = _tblprofile.Name;
tblVend.Party = edtpartyRecId;
tblVend.update();
}

here my codes,

first, i assign the variable,

straccountno = _sqldatareader.get_Item(“AccNum”);
tblVend = VendTable::find(straccountno,true);
edtName = tblVend.Name;
edtpartyRecId = DirPartyTable::createNew(DirPartyType::Organization,edtName).RecId;

if(!tblVend)

{

tblVend.clear();

tblVend.initValue();

tblVend.AccountNum = straccountno;

tblVend.Name = _tblprofile.Name;

tblVend.Party = edtpartyRecId;
tblVend.Dimension = strDimension;
tblVend.insert();
}
else
{
tblVend.AccountNum = straccountno;
tblVend.Name = _tblprofile.Name;
tblVend.Party = edtpartyRecId;
tblVend.update();
}

Try to debug and find where it exactly fails.