data type code

Navi_LearnerNavi_Learner Member Posts: 356
edited 2006-03-09 in Navision e-Commerce
Hi I created two variables with Sales as Record and Associate as code based on the customer table, but it doesn't work, here is my code:

Associate :='';
If Sales.get(Customer."Salesperson Code") Then
Associate := Sales.SalesAssoc;
How to deal with code data type? Thanks in advance!

Comments

  • bbrownbbrown Member Posts: 3,268
    What table does Sales reference?

    Is the primary key for Sales a single field, and does its datatype match that of Customer."Salesperson Code"?

    Does the datatype of Associate match that of Sales.SalesAssoc?

    What error do you get?
    There are no bugs - only undocumented features.
  • Navi_LearnerNavi_Learner Member Posts: 356
    Yes. The error message says: The expression code cannot be type converted to option value
  • DenSterDenSter Member Posts: 8,307
    It looks to me like your Sales.SalesAssoc field is an option type field. If you need to 'translate' an option value into a text string or a code variable, you'd do FORMAT(Sales.SalesAssoc), but the best way would be to simply map datatypes by type.
  • Navi_LearnerNavi_Learner Member Posts: 356
    No, the SalesAssociate'data type is code , not an option.
  • DenSterDenSter Member Posts: 8,307
    Then your Associate variable is an option.
Sign In or Register to comment.