Data grid is a control for display the data in tabular format in our application. In data grid when u select any row then for getting this rows unique id write code like : Ex : here we will take ‘ dgcustomer ’ as data grid with following column name (Id,Name,RollNumber,Pass) string strid = "" ; DataRowView rowview = dgcustomer.SelectedItem as DataRowView ; strid = rowview.Row[ "Id" ].ToString(); MessageBox .Show( "ID : " + strid);
Web services is use to do operation on data of NAV from outside the NAV environment, you can’t insert, update, delete the data of NAV using web service with proper authentication. For creating the web service in NAV follow below steps. (Here we are making the web service with gives vendor name based on vendor number. And we consume this service in windows application outside the NAV area.) Open NAV development environment and create the new code unit. Make one function “GetVendorName” Function name: GetVendorName Input Parameter : VendorNumber Output (Return) parameter : VendorName Now write below code in function. IF Vendor.GET(VendorNo)THEN BEGIN EXIT(Vendor.Name); END ELSE BEGIN EXIT('Vendor Not Found'); END Now save this codeunit with proper Id and Name. Now open the client application module and search for ‘Web service’ in search text box. Open the “Web service page” and click on “NEW” button, it will ask following details Object Type: Codeunit Obj...
Format function is use to display date in various format some example given below. Format function take 3 input argument First: date which you want o display Second: number of character return by default is 0 (o means return all the string) Third: string format in witch you want to convert. Example: 1 MESSAGE('Today date is : %1 ', FORMAT(TODAY,0,'<Month Text> <Day,2> <Year4>')); OURPUT: Emaple:2 MESSAGE('Today date is : %1 ', FORMAT(TODAY,0,' <Day,2> <Month,2> <Year4>')); OUTPUT:
Comments
Post a Comment