web
You’re offline. This is a read only version of the page.
close
Skip to main content
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;

                }
            }

        }

    }




}

 

I have the same question (0)
  • nagatak Profile Picture
    65 on at
    RE: changing the visual of the field after deleting the image.

    Thank you very much for your wonderful information.

  • nagatak Profile Picture
    65 on at
    RE: changing the visual of the field after deleting the image.

    Thanks for the advice.

    I will try the communities you referred me to.

  • nagatak Profile Picture
    65 on at
    RE: changing the visual of the field after deleting the image.

    I appreciate your help resolving the problem.

    Thanks a lot ,@Suresh Kulla!!!

  • Verified answer
    Suresh Kulla Profile Picture
    50,080 Super User 2025 Season 2 on at
    RE: changing the visual of the field after deleting the image.

    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);

  • Suggested answer
    JAngle Profile Picture
    117 on at
    RE: changing the visual of the field after deleting the image.

    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

  • Suggested answer
    Andy Sather Profile Picture
    on at
    RE: changing the visual of the field after deleting the image.

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,885

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,405

#3
Sumit Singh Profile Picture

Sumit Singh 2,837

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans