Actually its all X++ code. Error occurs when I'm posting inventory transfer 

journal.

What I'm doing is inserting records in the inventory transfer journal using 

X++ and posting using InventJournalCheckPost class. I can successfully post 

when the InventJournalType is Movement but having an error when 

InventJournalType is Transfer. Any ideas?

 

See below code:

 

try

{

 

ttsbegin;

 

inventJournalName = CustomProcess::FindCreateJournalName("STK13",
InventJournalType::Transfer); //method tested and working

 

inventJournalTable.clear();

inventJournalTable.initValue();

inventJournalTable.NumOfLines = lineNum; //from text file

inventJournalTable.JournalNameId = inventJournalName.JournalNameId;

inventJournalTable.VoucherSeqId = inventJournalName.VoucherSeqId;

inventJournalTable.JournalType = InventJournalType::Transfer; //if change to
movement, can successfully post.

inventJournalTable.LedgerAccountIdOffset =
inventJournalName.LedgerAccountIdOffset;

inventJournalTable.insert();

 

fromInventDim.clear();

fromInventDim.initValue();

fromInventDim.InventLocationId = fromWhs; //from text file

fromInventDim.InventColorId = fromColor; //from text file

fromInventDim.inventBatchId = fromBatch; //from text file

 

tempInventDimFrom.clear();

tempInventDimFrom = InventDim::findOrCreate(fromInventDim);

 

toInventDim.clear();

toInventDim.initValue();

toInventDim.InventLocationId = toWhs; //from text file

toInventDim.InventColorId = toColor; //from text file

toInventDim.inventBatchId = toBatch; //from text file

 

tempInventDimTo.clear();

tempInventDimTo = InventDim::findOrCreate(toInventDim);

 

inventJournalTrans.clear();

inventJournalTrans.initValue();

inventJournalTrans.JournalId = inventJournalTable.JournalId;

inventJournalTrans.InventDimId = tempInventDimFrom.inventDimId;

inventJournalTrans.ToInventDimId = tempInventDimTo.inventDimId;

inventJournalTrans.LedgerAccountIdOffset =
inventJournalName.LedgerAccountIdOffset;

inventJournalTrans.Voucher = inventJournalTable.VoucherSeqId;

inventJournalTrans.ItemId = itemNum; //from text file

inventJournalTrans.Qty = str2int(qty); //from text file

inventJournalTrans.TransDate = SystemDateGet();

inventJournalTrans.insert();

 

checkPost =
InventJournalCheckPost::newJournalCheckPost(JournalCheckPostType::Post,
inventJournalTable);

checkPost.parmAutoBlock(true);

checkPost.run();

 

ttscommit;

}

catch

{//breakpoint here that's why I know an exception occurs

 //create log

}

 

 

From: Axapta-Knowledge-Village@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Barunava Pal
Sent: Wednesday, December 19, 2007 3:43 PM
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: Re: [Axapta-Knowledge-Village] Weird Exception in AX3

 

Hi,
Can you please tell me where you are facing that exception? what is the form
of the exception? like is it coming as an infolog/warning/error or a
dialogbox? Can you put a screenshot of the incident? 

There is certain internal script errors in the AX product, both in AX 3.0
and 4.0. If you face this kind of errors, you simply have nothing to do
other than trying some alternative path for that. You cannot catch the
reason by putting breakpoint in Add method of info class or putting a try
catch block. As for example, there is a class Sysmailer, which is used to
send emails from AX thru a SMTP/DNS server. When we have tried this class to
send auto-generated emails, it gives some "internal script error" in form of
a dialogbox. We have reported it to Microsoft and they told this was already
reported to them and they are working with it, so there was no solution for
that. We have finally opted for an alternative solution for that. 

Barunava 

----- Original Message ----
From: Earl Rey Lacsina <HYPERLINK
"mailto:elacsina%40gurango.com"[EMAIL PROTECTED]>
To: Axapta-Knowledge-Village <HYPERLINK
"mailto:Axapta-Knowledge-Village%40yahoogroups.com"Axapta-Knowledge-Village@
yahoogroups.com>
Sent: Wednesday, 19 December, 2007 7:36:09 AM
Subject: [Axapta-Knowledge-Village] Weird Exception in AX3

I'm encountering an exception in AX3 but my problem is that this exception 

have no description in the infolog. I have put a breakpoint in ADD METHOD of

the INFO CLASS but the exception doesn't pass there. I thought all exception

pass in that class? 

try

{

//do something

}

catch

{

//exception catched with no description. 

}

If I try the code below, exception is not catched.

try

{

}

catch(exception: :error)

{ }

catch(exception: :break)

{ }

catch(exception: :sequence)

{ }

catch(exception: :ddeerror)

{ }

catch(exception: :deadlock)

{ }

catch(exception: :info)

{ }

catch(exception: :internal)

{ }

catch(exception: :numeric)

{ }

catch(exception: :warning)

{ }

How can I see the description of this exception? Anyone encounter this 

problem?

Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5..476 / Virus Database: 269.9.6/865 - Release Date: 6/24/2007
8:33 AM

[Non-text portions of this message have been removed]

Share files, take polls, and discuss your passions - all under one roof. Go
to HYPERLINK
"http://in.promos.yahoo.com/groups"http://in.promos.yahoo.com/groups

[Non-text portions of this message have been removed]

 

 

Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.9.6/865 - Release Date: 6/24/2007
8:33 AM


Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.9.6/865 - Release Date: 6/24/2007
8:33 AM
 
    


[Non-text portions of this message have been removed]

Reply via email to