none
New to C#, getting help but now running into Left-Hand side of an assignment must be a variable RRS feed

  • Question

  • I am new to C# and have gotten a lot of assistance from our programmer at work. Using Epicor ERP, I have code that keeps giving me the error: The left-hand side of an assignment must be a variable, property or indexer.

    Here is my code:


    var ttInvcDtl_results = (from ttInvcDtl_Row in ttInvcDtl 
                             where (ttInvcDtl_Row.RowMod == "U") select ttInvcDtl_Row);
    foreach (var ttInvcDtl_xRow in ttInvcDtl_results)
    {
      var Company = ttInvcDtl_xRow.Company;  
      var OrderNum = ttInvcDtl_xRow.OrderNum;
      var OrderLine = ttInvcDtl_xRow.OrderLine;
      var OrderDtl_Row = (from ttOrderDtl_Row in Db.OrderDtl 
                           where (ttOrderDtl_Row.Company == Company) select ttOrderDtl_Row).FirstOrDefault();
      ttInvcDtl_xRow.UDField<decimal>("RCTrkQty_c") = OrderDtl_Row.RCTrkTtlQty_c;
      
    }

    It errors on the last line of the code highlighted in bold. I thought this would be simple but nothing I have done has worked.

    Thanks

    Charles

    Thursday, August 9, 2018 5:54 PM

Answers

  • User Defined Field. In Epicor you can add User Defined Fields within an existing table. 

    I may be in the wrong forum to ask. I just need some help understanding why I'm getting this error. 

    There are methods (and properties) which are get/set while others are get only. I would suggest hover your mouse over the method, does it provide help?

    In regards to the wrong forum, for help with Epicor, that is not a Microsoft product so there are no forums for it here.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by CWDINGAS Thursday, August 9, 2018 7:19 PM
    Thursday, August 9, 2018 6:44 PM
    Moderator

All replies

  • For a DataRow Field to be set use SetField. Is this a DataRow?

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, August 9, 2018 6:05 PM
    Moderator
  • It's a UD Field within a Table on a Row. Again new to C# so still learning a bit of the language, so I am going to say yes..?

    I should also state that I did get some assistance for our programmer here at work when I exhausted the other means that can be used within Epicor.

    • Edited by CWDINGAS Thursday, August 9, 2018 6:21 PM
    Thursday, August 9, 2018 6:19 PM
  • It's a UD Field within a Table on a Row. Again new to C# so still learning a bit of the language, so I am going to say yes..?

    I should also state that I did get some assistance for our programmer here at work when I exhausted the other means that can be used within Epicor.

    What is a UD field ???

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, August 9, 2018 6:28 PM
    Moderator
  • User Defined Field. In Epicor you can add User Defined Fields within an existing table. 

    I may be in the wrong forum to ask. I just need some help understanding why I'm getting this error. 

    Thursday, August 9, 2018 6:36 PM
  • User Defined Field. In Epicor you can add User Defined Fields within an existing table. 

    I may be in the wrong forum to ask. I just need some help understanding why I'm getting this error. 

    There are methods (and properties) which are get/set while others are get only. I would suggest hover your mouse over the method, does it provide help?

    In regards to the wrong forum, for help with Epicor, that is not a Microsoft product so there are no forums for it here.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by CWDINGAS Thursday, August 9, 2018 7:19 PM
    Thursday, August 9, 2018 6:44 PM
    Moderator