Sales order: Hide a message in packing slip

Hi all, I’m newbie in dynamic AX, and I’m having a question.

On packing slip we showing a message in the footer by calling the display method:

display FormLetterTxt Txt()
{
return FormLetterRemarks.Txt;

}

I need hide this message in case when we do an international process. As a filter I can use ItemID(where all international items are starting with prefix: INT)

If I could use simple logic:

display FormLetterTxt Txt()

{
str name;
str res;
;
name = ‘INT-WX350’;
res = substr(name,1,3);

if(res == ‘INT’)
{
return ’ ';
}
else
{
return FormLetterRemarks.Txt;
}
}

Any thoughts?

Thanks much for the help!

Alex

Hi,

Better you add noyes enum type field in Inventtable.For international item you enable this flag at the time of creation.

Your display method like below

display FormLetterTxt Txt()

{

if (Inventtable::find(your itemid).yourfield)
{
return “”;
}
else
{
return FormLetterRemarks.Txt;
}
}

Thank you so much for reply, Saju!

As you suggested, I have added a enum field into InventTable.

I have updated the single row and tested the script(please see below):

display FormLetterTxt Txt()

{

;
if (InventTable::find(CustPackingSlipTrans.ItemId).ItemNumIntOrDomestic)
{
return “”;
}
else
{
return FormLetterRemarks.Txt;
}
}
but unfortuantely, when I debugged this script there is no return value in (CustPackingSlipTrans.ItemId=" ")…not sure is it syntax or logic?

Would you able to help me?

Thanks much!

-Alex

Hi,

When you debug check CustPackingSlipTrans buffer has value(record) or not.

Sorry, would you please to direct me how to check the buffer?

Hi,

If you item is an international item(ItemNumIntOrDomestic = yes) then system will return null value.

else

system will return txt value.

Check in inventtable whether ItemNumIntOrDomestic flag is enabled or not.If it is enabled it will return null value.

Note: ItemNumIntOrDomestic field which you have added is new.Old items it will show (No) value.

Debugging:

Drag and drop CustPackingSlipTrans variable to watchwindow.you can see the custpackingslip record values.

Thank you for reply, Saju!

Unfortunately, there’s no value in CustPackingSlipTrans.itemId.
That’s why the condition is not working…

I have created a method [itemId()] under CustPackingSlipTrans table and as a test, dropped a string control on the report and binded with this data method and itemId is showing…

Is there way I can use this method inside of condition?

looks like I have stuck…Any help you can give would be greatly appreciated.

Alex

Hi Saju,

Thank you very much for your help!

it worked.