AL icon indicating copy to clipboard operation
AL copied to clipboard

Strange behaviour on BLOB field textbox

Open kine opened this issue 8 years ago • 6 comments

Hello, I needed to add field "Work Description" to our new table in app in a same way how it is e.g. on Sales Header table (Field 200). I have added it to table, to page as a field (same as on the Sales Order page) and result is:

A) Regardless the Multiline is set to true, the textbox is displayed as one line B) If the field is not set as additional, and the page is opened in view mode, it is displayed (with the bug in A). If then the page is switched to edit mode, the field is still uneditable and page stops responding. Client fail.

C) If the field is set as additional and the page is opened, and the "show more" is clicked, the group is displayed but not the text box (when the textbox is inside special Group as on page 42). If clicked "show less" group is hidden again.

It seems that textbox over BLOB field added by extension is not working correctly and cannot be used as it is in C/AL.

Used field definition:

        field(12;"Work Description"; Blob)
        {
            Caption = 'Work Description';
            DataClassification = ToBeClassified;
        }

Used page definition:

                group (WorkDescription) {
                    Caption = 'Work Description';
                    field("Work Description";"Work Description")
                    {
                        MultiLine = true;
                        ShowCaption = false;
                        ToolTip = 'Specifies the products or service being offered.';
                        Importance = Additional;
                    }
                }

I have tried different thing (remove attributes, move field from the group etc.) but I have not find any combination working correctly.

kine avatar May 25 '18 07:05 kine

Hi Kine,

It seems that you have directly added the field to the page, you should create a Text variable and then use that in the field.

Can you please try the below changes ? Hope this solves your issue.

group(WorkDescriptionGroup)
            {
                Caption = 'Work Description';
                field(WorkDescription; WorkDescription)
                {
                    ShowCaption = false;
                    ToolTip = 'Specifies the products or service being offered.';
                    MultiLine = true;
                    ApplicationArea = All;
                    Importance = Additional;
                    trigger OnValidate();
                    begin
                        SetWorkDescription(WorkDescription);
                    end;
                }
            }

trigger OnAfterGetRecord();
    begin
        WorkDescription := GetWorkDescription();
    end;

    var
        WorkDescription: Text;

diveshbora avatar May 25 '18 18:05 diveshbora

True, I overlooked that the source expression is not "Work Description" but "WorkDescription". This solved the problem with adding the field to the page.

But still, failing client just because I have added blob field to the page is not correct behavior... ;-) I can kill BC through this and I think it should prevents me to do that.

kine avatar May 28 '18 06:05 kine

Do you still have the same issue ?

diveshbora avatar May 28 '18 07:05 diveshbora

Not with the Work Description when I use the variable of course.

But of course when using Blob directly as a Source Expr. of textbox, it will kill the client when trying to have editable textbox... there is no change on this. I will assume that the textbox will be still non-editable (because I cannot edit the value of the blob directly) or ALC will give me error when adding such a textbox to the page.

kine avatar May 28 '18 07:05 kine

Hi @kine ! Using a Blob as a source expression is a valid scenario when the PageType is set to API. I think we can implement an analyzer for this scenario that gives you a warning if you are trying to use a Blob as a source expression and the PageType is not API. What do you think?

atoader avatar Jun 13 '18 11:06 atoader

If it will give me clear info that Blob cannot be used directly on non-API page, than yes (and may be hint that I can use it through variable? or link to some documentation?). No problem with that.

kine avatar Jun 13 '18 12:06 kine