Options

Writing BigText to file in Role Tailored Client

Nav_NoobNav_Noob Member Posts: 25
edited 2009-05-14 in NAV Three Tier
Hello,

I have a code unit that writes some data to a file using a BigText variable. The code runs fine in the classic client but when I run the same code from the role tailored client I run into some problems when working with the BigText variable. Here are the errors I'm getting...

The line that is causing the error is:
"BigTextVariable".AddText('some text');

I get the following error:
Compilation of module '...' failed. This could be caused by differences between binaries in your installation or your database. Enusre that all installation components are consistent and up to date. Error details: The best overloaded method match for 'Microsoft.Dynamics.Nav.Runtime.NavBigText.ALAddText(Microsoft.Dynamics.Nav.Runtime.NavBigText, string)' has some invalid arguments: error CS1503: Argument '2': cannot convert from 'byte' to 'string'.

So I commented that line and tried to write the empty BigText variable to the file like this:
"My File".WRITE("BigTextVariable");

In this case, I get the following error:
ALStream.ALWrite, invalid stream mode: FileText

Any ideas on what might be going wrong? This code is working just fine in the classic client. Any ideas would be greatly appreciated.

Thanks,
Adam

Answers

  • Options
    freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    Could you copy the exact code lines for us?
    I have a feeling of dejavu when I saw this, but I cannot find the error.
    I think you should try replacing this:

    "BigTextVariable".AddText('some text');

    with

    strvar := 'some text';
    "BigTextVariable".AddText(strvar);

    and see whether that fixes your problem.

    Reg. the write, I think you need to use

    "BigTextVariable".WRITE(OutStream)

    on an OutStream you have created based on the file - when writing a BigText to a file.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Options
    Nav_NoobNav_Noob Member Posts: 25
    freddy.dk wrote:
    I think you should try replacing this:

    "BigTextVariable".AddText('some text');

    with

    strvar := 'some text';
    "BigTextVariable".AddText(strvar);

    and see whether that fixes your problem.
    Thanks, that works perfectly!

    freddy.dk wrote:
    Reg. the write, I think you need to use

    "BigTextVariable".WRITE(OutStream)

    on an OutStream you have created based on the file - when writing a BigText to a file.
    That also worked perfectly, thanks again!
Sign In or Register to comment.