Create a ASCII file from Navision buffer

SuperSage77SuperSage77 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

Comments

  • kinekine Member Posts: 12,562
    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.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • SuperSage77SuperSage77 Member Posts: 101
    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".
  • kinekine Member Posts: 12,562
    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 just
     ret:=SHELL ('runit.cmd');
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • SuperSage77SuperSage77 Member Posts: 101
    Hi Kine !

    Indeed it is a good idea I will test that thank you !!!!

    Rudy.
Sign In or Register to comment.