Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Some Item Descriptions are coming and some are not coming.

Posted on by 50

Hi All,

       I am doing a processing only report where it has to show a message, where  if the purchase description is " ", for a item then it has to take from the sales description of my item pageextension but if the purchase description is null also only some items are showing its sales description but some are not showing the sales description, why it is coming like that can anyone help me my code is

Trigger OnafterGetRecord()

begin

clear(Description_Custom);

 if Item.Get("Purchase Line"."No.") then

 if item."Purchase Decription" = '' then

 Description_Custom := Item."Sales Decription"

 else

 Description_Custom := Item."Purchase Decription";

Message('%1,%2',Item.No., Item.Description_Custom);

end;

Below I am attaching the message, if anybody know why it is coming like this help me.

pastedimage1678704250991v1.png

pastedimage1678704330264v2.png

Thanks & Regards

Satish.

Categories:
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Some Item Descriptions are coming and some are not coming.

    Seems that you are not able to describe your requirement, can you please put some screen shot or brief it more

    Thanks

  • Sarath9999 Profile Picture
    Sarath9999 50 on at
    RE: Some Item Descriptions are coming and some are not coming.

    Hi Nithin,

             I have tried in the way what you said but again also it is not coming, can you have any other suggestions, Thank you very much for your help.

    Thanks & Regards

    Satish.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Some Item Descriptions are coming and some are not coming.

    Can you try this?

               Trigger OnafterGetRecord()

               begin

                   clear(Description_Custom);

                   if "Purchase Line".type = "Purchase Line".type::Item then begin

                       if Item.Get("Purchase Line"."No.") then

                           if item."Purchase Decription" <> '' then

                               Description_Custom := Item."Purchase Decription";

                           if item."Sales Decription" <> '' then

                               Description_Custom := item."Sales Decription";

                       Message('%1,%2', Item.No., Description_Custom);

                   end;

               end;

  • Sarath9999 Profile Picture
    Sarath9999 50 on at
    RE: Some Item Descriptions are coming and some are not coming.

    Hi Nitin,

                I am doing a processing only report, I want to show a message of the item No., item Description, in the item table I have given two custom fields, where purchase description and sales description, if the purchase description is blank, it has to take the value from sales description, but for some items it is taking the sales description values for some items and for some items it is showing null, I didn't insert any values in the purchase description.

    Thanks & Regards

    Satish

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: Some Item Descriptions are coming and some are not coming.

    You code seems right to me, where is the problem I did not get you properly.

    Thanks

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans