Create a ASCII file from Navision buffer

SuperSage77
Member Posts: 101
Hi!
How then I to make to generate an ASCII file asc starting from data text exit of a File XML :
Following the Code + the error message turned over .
Checksum - Import::OnAfterAssignVariable()
RecEnteteVente_g."Visual Cryptogram" := DecodeChecksum(Checksum);
DecodeChecksum(TxtEncodedChecksum_p : Text[1024]) : Text[1024]
TxtEncodedChecksum_p:=Checksum;
ret:=SHELL (RecGeneralLedgerSetup_l."RSA Path"+'decode.cmd', TxtEncodedChecksum_p + 'Checksum.asc');
It return error message following/
"The length of the source exceeds the size of the destination buffer."
Thank's for Answer
How then I to make to generate an ASCII file asc starting from data text exit of a File XML :
Following the Code + the error message turned over .
Checksum - Import::OnAfterAssignVariable()
RecEnteteVente_g."Visual Cryptogram" := DecodeChecksum(Checksum);
DecodeChecksum(TxtEncodedChecksum_p : Text[1024]) : Text[1024]
TxtEncodedChecksum_p:=Checksum;
ret:=SHELL (RecGeneralLedgerSetup_l."RSA Path"+'decode.cmd', TxtEncodedChecksum_p + 'Checksum.asc');
It return error message following/
"The length of the source exceeds the size of the destination buffer."
Thank's for Answer
0
Comments
-
SuperSage77 wrote:Checksum - Import::OnAfterAssignVariable()
RecEnteteVente_g."Visual Cryptogram" := DecodeChecksum(Checksum);
DecodeChecksum(TxtEncodedChecksum_p : Text[1024]) : Text[1024]
TxtEncodedChecksum_p:=Checksum;
ret:=SHELL (RecGeneralLedgerSetup_l."RSA Path"+'decode.cmd', TxtEncodedChecksum_p + 'Checksum.asc');
1) I do not understand your code. Why you are calling DecodeChecksum with parameter Checksum and in the function you do TxtEncodedChecksum_p := Checksum??? It is nonsense...
2) Where you are returning the result in the DecodeChecksum function? Are you using result variable? Do not do it... There were bugs in history and I am not sure if they are solved. Return the value through calling EXIT(Value)...
3) The error means, that for example you are trying to past String with length 20 into parameter with max. size 10... check, if the RSA Path is not too long etc.0 -
Hi Kine and thank's for your answer ...
Yours items :
1) Indeed you are right this code is not used for nothing it is redundant
2)In fact I launch a cmd file which is a Java routine for decrypter the parameter "Checksum" in an ASCII file asc whose contents will be then read by INSTREAM and stocked in a Order field "Payment tool"etc... The value "Cheksum" is an XMLPort élement with the text type length 1024....
3) When I launch the decode.cmd in Dos mode in a Dos window with the character strings length 1024 follow-up of the name of the file checksum.asc that functions correctly and created me the file..... my problem is of launching this line of order starting from Navision
CommandLine Dos :
decode.cmd "ijK72Wz+6hqSjFdwwjSM1xXajMtIr+DSQnl/o5bvIMwGSgHyLJIG4EWYcziOFTOdjrhP+VANV7vWRxRTrjjyGUsFrMDACNGkpO4tm8w4bwf1UGKGFZEaEba5ATG/T9p9HdrSrpQ01RZYwz9ariug6KXLThH+gHDdwpVgJ0E0nCWbnQWfJkXYHBoA2lkOr7Jg5tL5Rrm/VlzCtTChtSH8mjo5ZRtoQydFrus7g+MjOHyxtS2ozeK7d08pdFq21OcRJuQ9iiNdAAFpOICQZGRMKT9Vk5jZ3H0MncMhQrY2nqExkwFZOg7RaObu9jJ4BhG2Qa8fVuSofCdhMmI5/PDlWA==" checksum.asc ==> the result is a file checksum.asc wich contain the decrypted result "414".0 -
And because the string is too long, the SHELL command raise error... :-)
Try to write your command into <somename>.cmd and run this batch file to run the tool. You will not have the problem with the buffer than... (after running the batch, you can delete the file...)
It means: create file runit.cmd with this content:call decode.cmd "ijK72Wz+6hqSjblablablbalbladhMmI5/PDlWA==" checksum.asc
and do justret:=SHELL ('runit.cmd');
0 -
Hi Kine !
Indeed it is a good idea I will test that thank you !!!!
Rudy.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions