mercredi 2 mai 2018

a field initializer cannot reference the nonstatic field method or property RecordVerifyBase.purchTable_purchLine_purchQtyGrid

I recorded a purchase scenario with task recorder on dyamics ax 7, and I imported it on a C # perfSDK project, and then I want to check if the value of the total amount "PurchTable_PurchLine_LineAmountGrid" is equal to the quantity "PurchTable_PurchLine_PurchQtyGrid" * the price "PurchTable_PurchLine_PurchPriceGrid".

I created a method to check the resulat of the test with the expected result:

private decimal result_expected = PurchTable_PurchLine_PurchQtyGrid*PurchTable_PurchLine_PurchPriceGrid;;

         private bool test;

     public void TestEquals (decimal _expected, decimal _actual, string _message)          {              test = _expected.Equals (_actual);             

if (test == false)                 

Console.WriteLine ("the total amount is incorrect");               }

this error message is displayed:

a field initializer can not reference the nonstatic field method or property RecordVerifyBase.purchTable_purchLine_purchQtyGrid

Aucun commentaire:

Enregistrer un commentaire