Modifying a field on page NAV 2018

Hi All,

I have a customize field(Sales Order No.) on Purchase Order page. Now requirement was when Sales Order No. get selected from lookup(this field is coming from Sales Header) all the dimension attached to Sales Order should get update on Purchase order. I did it by validating Dim. SetId field. But now I am facing the problem if sometime someone just delete Sales Order No. from Purchase order the dimesions values are not updating(It should become blank.) If I changing sales order no. written code is giving expected result. NAV 2018

Can anyone tell where I am doing wrong??

Thanks in Advance.

What happens when purchase document already has same dimensions but different value to that of sales document, do you update them?

Additionally what happens when additional dimensions are added to purchase order manually later after select sales order no and when some one removes/deletes sales order no. do those manually added dimensions need removing as well? . You got to have all the possible scenarios in place and then work on the custom solution.

Thanks Imran for more scenarios.