Skip to main content
Solved

Error in value of GetExtension code

  • 22 December 2020
  • 2 replies
  • 617 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.

Best answer by Naveen Boga

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!!

View original
Did this topic help you find an answer to your question?

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • Answer
  • December 22, 2020

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!!


  • Author
  • Jr Varsity II
  • 22 replies
  • December 22, 2020

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings