I have the nex situation:
I have one dataport, where the next code is:
Gen. Journal Line - OnAfterImportRecord()
"Line No." := NextLineNo;
IF "Currency Code"='' THEN BEGIN
TGLSetup.RESET; //TGLSetup is from table General Ledger Setup
TGLSetup.GET();
IF TGLSetup.FIND('-') THEN
CurrencyCode:=TGLSetup."LCY Code";
END ELSE
CurrencyCode:="Currency Code";
VALIDATE("Currency Code",CurrencyCode);
The problem is when the dataport finish any "currency code" is posted in the field currency code in table 81 (Genreal Jornal Line).
Any body know what is happening?
Thanx
0
Comments
Could you explain it more. I don't seem to understand what exactly you mean...
Your dataitem is General Journal Line - isn't it?
usually a setup table has one value
TGLSetup.GET();
IF TGLSetup.FIND('-') THEN
so the find part might not be necessary.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I´m trayin to validate this currency code and post this in table 81.
When my datapot ends to run, any "Currency Code" is posted in my table 81, all the fileds are populate except the "Currency Code" field.
Do you know what happends whit this field?
Also, when you go with .GET(Primary Key) the RESET is ignored...
For your problem I think we'll need more info like which fields you fill, which variables you use etc...
But the power lies in the "Debugger"...
Your code is like "if it's blank then get it from the setup table".
So do you always want to "get it" or sometimes do you "have it"?
If you sometimes "have it" I would import it into a variable & then validate it.
http://www.BiloBeauty.com
http://www.autismspeaks.org
//*********************
0
7400010025040
9/23/2008
0
JG15
500.67
1
9/2/2008
XXSA01
XX25S2
XXXPST
K60007
SA0001
Purchase of Office Supplies
SAR
//**********************
My Dataport fieds are:
Enabled SourceExpr StartPos Width
Yes "Account Type" 0 0
Yes "Account No." 0 0
Yes "Posting Date" 0 0
Yes "Document Type" 0 0
Yes "Document No." 0 0
Yes Amount 0 0
Yes "Gen. Posting Type" 0 0
Yes "Document Date" 0 0
Yes "External Document No." 0 0
Yes InME 0 0
Yes InCC 0 0
Yes InProject 0 0
Yes InICME 0 0
Yes InICLE 0 0
Yes InRef 0 0
Yes Description 0 0
Yes "Currency Code" 0 0
I filled some fields with code like, Line No. etc etc,
In debugger I can watch my information filled correctly, but when I run form 39, I don´t have the field "currency code", I don't get any error, or problem with or withou debbuger...
How are you achieveing you line no?
"Line No." := "Line No." +10000;
Why not type in CurrencyCode into your dataport fields instead of
"Currency Code"
Import the info into your variable & then map it back to it's proper field later on.
Infact I would do this with all the fields. It's very possible a validate from the one of the other fields is clearing your "currency code"
TGLSetup."LCY Code" does have a value right?
as per my assumptions of possible causes.
Also your text file shows 15 fields and your dataport fields you have 17????????????? :-k
http://www.BiloBeauty.com
http://www.autismspeaks.org
You're right, just I need to have saved the Currency Code value in a global variable, before to execute the Validate.
Regards
ilianadlb