web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

changing the visual of the field after deleting the image.

(0) ShareShare
ReportReport
Posted on by 65

Hi, All.

 

I hava a issue which i'd like to solve.

See the pictures below as examples for more info.

_B930AF30EA30FC30F330B730E730C330C830_-2021_2D00_01_2D00_15-190824.png

After deleting the image, the visual is different from before inserting the image.

How can I make it look the same as before I inserted the image?

Here is the source code:

pageextension 50249 "CompanyInfo PageExt01" extends "Company Information"
{
    layout
    {
        addlast(Payments)
        {
            field("Stamp Picture"; "Stamp Picture")
            {
                Caption = '社印';
                ApplicationArea = All;
                ToolTip = '文書に印刷する会社の社印に使用する画像を指定。';

                trigger OnValidate()
                begin
                    CurrPage.SaveRecord;
                end;
            }
        }
        modify("Ship-to Name")
        {
            Caption = '出荷先名';
        }
        modify("Ship-to Address")
        {
            Caption = '出荷先住所';
        }
        modify("Ship-to Address 2")
        {
            Caption = '出荷先住所2';
        }
        modify("Ship-to City")
        {
            Caption = '出荷先市区町村';
        }
        modify("Ship-to Country/Region Code")
        {
            Caption = '出荷先国/地域コード';
        }
        modify("Ship-to Contact")
        {
            Caption = '出荷連絡先';
        }
    }

    actions
    {

        
        addlast(navigation)
        {   
            group(DeletePicture2)
            {
                Caption = '画像の削除';

                action(DeleteCompanyLogo2)
                {
                    ApplicationArea = all;
                    Caption = '会社ロゴの削除';
                    trigger OnAction()
                    var
                        Answer: Boolean;
                        OutS: OutStream;
                        Text1: Text;
                    begin
                        Answer := Dialog.Confirm('会社ロゴを本当に削除しますか?', true);
                        if not Answer
                        then
                            exit
                        else
                            Clear(OutS);
                        Clear(Text1);
                        Rec.Picture.CreateOutStream(OutS);
                        OutS.Write(Text1);
                        Rec.Modify(true);
                    end;

                }
                action(DeleteCompanyStamp2)
                {
                    ApplicationArea = all;
                    Caption = '社印の削除';
                    
                    trigger OnAction()
                    var
                        Answer: Boolean;
                        OutS: OutStream;
                        Text1: Text;

                    begin
                        Answer := Dialog.Confirm('社印を本当に削除しますか?', true);
                        if not Answer
                        then
                            exit
                        else
                            Clear(OutS);
                        Clear(Text1);
                        Rec."Stamp Picture".CreateOutStream(OutS);
                        OutS.Write(Text1);
                        Rec.Modify(true);

                    end;

                }
            }

        }

    }




}

 

  • Suggested answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

  • Suggested answer
    JAngle Profile Picture
    161 on at

    Have a look at this: www.sauravdhyani.com/.../msdyn365bc-new-series-about-integration.html

    The first blog post in the list is this one: www.sauravdhyani.com/.../msdyn365bc-test-base64-conversion-via.html

    I included the first url as it has the link to the GitHub repo. Figure you can take the code for the page and use it for your scenario as this one is already working

  • Verified answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at

    You just need to add these two lines under your action , you don't need to use create outstream and all that.

    Clear("Stamp Picture");

    Modify(true);

  • nagatak Profile Picture
    65 on at

    I appreciate your help resolving the problem.

    Thanks a lot ,@Suresh Kulla!!!

  • nagatak Profile Picture
    65 on at

    Thanks for the advice.

    I will try the communities you referred me to.

  • nagatak Profile Picture
    65 on at

    Thank you very much for your wonderful information.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 545 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 354 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 228 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans