Skip to main content
Solved

Error in value of GetExtension code

  • 22 December 2020
  • 2 replies
  • 598 views

Hello,

 When I set the value of GetExtension, the variable gets null.         

 foreach (SOLine soline in listOfLine1)
            {
                SOLine line = new SOLine();

                //…. code

                var lineExt = SOGraph.Transactions.Current.GetExtension<Objects.SO.SOLineExt>();

                lineExt.UsrMargeLine = GetPercentMargin(line);

                SOGraph.Transactions.Insert(line);
                SOGraph.Actions.PressSave();

            }


Best regards.

2 replies

Userlevel 7
Badge +19

Hi @mohamed1walha 

Can you please add this line of code and verify

SOLineExt lineExt = Base.Transactions.Cache.GetExtension<PX.Objects.SO.SOLineExt>(line);

Hope this helps!!

Userlevel 2

thanks @Naveen B  for your answer, i will test with it.

Reply