I have the posted sales invoice which was generated when the customer have no business posting group. Now, the customer is updated with the business posting group.
Now, I want to cancel/ create credit memo from that posted sales invoice. But, when I cancel posted sales invoice/ create the credit memo, the business posting group is not found. An error occurred.
From the credit memo, if I copy the posted sales invoice to reverse, there also problems occurred due to the business posting group.
Now, how can I update the sales line with the business posting group?

When I do the cancel from posted sales invoice.

When I post from the sales credit memo.