Options

Translate Option in NAV into ASP.NET DropdownList

philipuskdphilipuskd Member Posts: 36
edited 2011-10-28 in NAV Three Tier
is there anyway to translate the option field in NAV webservice to dropdown list in ASP.NET?

if only I can fetch the options fields value one by one, maybe I can user ddl.Items.Add(ddlItem); which ddl is the dropdownlist and ddlItem is the ListItem which has the text and value of options field that I fetch. the problems is I couldn't find any way to retrieve the options.

is there any way to do this?

Comments

  • Options
    wmstreetwmstreet Member Posts: 9
    If you parse the WSDL file for the service, you can find all the valid enumerations (restrictions) for an Option field. Here is a partial listing of the Customer Card WSDL showing all the option fields.


    <xsd:simpleType name="Blocked">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="Ship"/>
    <xsd:enumeration value="Invoice"/>
    <xsd:enumeration value="All"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Copy_Sell_to_Addr_to_Qte_From">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Company"/>
    <xsd:enumeration value="Person"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Tax_Identification_Type">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Legal_Entity"/>
    <xsd:enumeration value="Natural_Person"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Application_Method">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Manual"/>
    <xsd:enumeration value="Apply_to_Oldest"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Reserve">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Never"/>
    <xsd:enumeration value="Optional"/>
    <xsd:enumeration value="Always"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Shipping_Advice">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Partial"/>
    <xsd:enumeration value="Complete"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Bank_Communication">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="E_English"/>
    <xsd:enumeration value="F_French"/>
    <xsd:enumeration value="S_Spanish"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Check_Date_Format">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="MM_DD_YYYY"/>
    <xsd:enumeration value="DD_MM_YYYY"/>
    <xsd:enumeration value="YYYY_MM_DD"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Check_Date_Separator">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="_minus_"/>
    <xsd:enumeration value="_dot_"/>
    <xsd:enumeration value="_slash_"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Components_on_Sales_Orders">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="Show"/>
    <xsd:enumeration value="Do_Not_Show"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Components_on_Shipments">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="Show"/>
    <xsd:enumeration value="Do_Not_Show"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Components_on_Invoices">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="Show"/>
    <xsd:enumeration value="Do_Not_Show"/>
    </xsd:restriction>
    </xsd:simpleType>
    Wm. Matthew Street (Matt)
    http://www.wmmatthewstreet.com
  • Options
    philipuskdphilipuskd Member Posts: 36
    wmstreet wrote:
    If you parse the WSDL file for the service, you can find all the valid enumerations (restrictions) for an Option field. Here is a partial listing of the Customer Card WSDL showing all the option fields.


    <xsd:simpleType name="Blocked">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="Ship"/>
    <xsd:enumeration value="Invoice"/>
    <xsd:enumeration value="All"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Copy_Sell_to_Addr_to_Qte_From">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Company"/>
    <xsd:enumeration value="Person"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Tax_Identification_Type">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Legal_Entity"/>
    <xsd:enumeration value="Natural_Person"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Application_Method">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Manual"/>
    <xsd:enumeration value="Apply_to_Oldest"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Reserve">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Never"/>
    <xsd:enumeration value="Optional"/>
    <xsd:enumeration value="Always"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Shipping_Advice">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Partial"/>
    <xsd:enumeration value="Complete"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Bank_Communication">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="E_English"/>
    <xsd:enumeration value="F_French"/>
    <xsd:enumeration value="S_Spanish"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Check_Date_Format">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="MM_DD_YYYY"/>
    <xsd:enumeration value="DD_MM_YYYY"/>
    <xsd:enumeration value="YYYY_MM_DD"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Check_Date_Separator">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="_minus_"/>
    <xsd:enumeration value="_dot_"/>
    <xsd:enumeration value="_slash_"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Components_on_Sales_Orders">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="Show"/>
    <xsd:enumeration value="Do_Not_Show"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Components_on_Shipments">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="Show"/>
    <xsd:enumeration value="Do_Not_Show"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="Components_on_Invoices">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="_blank_"/>
    <xsd:enumeration value="Show"/>
    <xsd:enumeration value="Do_Not_Show"/>
    </xsd:restriction>
    </xsd:simpleType>


    Hi Matt,

    thanks for the reply. I'm new in ASP.net and NAV webservice as well. would you mind show me a sample code to fetch the option field, knowing the WSDL above?

    Regards,

    Philipus
  • Options
    philipuskdphilipuskd Member Posts: 36
    http://mibuso.com/forum/viewtopic.php?f=32&t=31925

    I found this is very useful \:D/
Sign In or Register to comment.