Hello everyone.
I am working on a web services project, creating a record and inserting it via their architecture. I’ve been able to insert a header record, but I cannot seem to get lines to import. Everything right now is hard coded. Could anyone give me example code in how I would enter a couple line items for my header record? And I’m also trying to find any good sdk or book via Amazon or something I could buy to study about specifically Web Services development in NAV 2013 or NAV 2009R2? I don’t need so much on C/Side because I know that, but I couldn’t find much on Web Services NAV development. Thank you so much.
namespace PurchaseInvoiceStamp
{
using NAVSystemService;
using NAVPurchaseINVService;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// GET COMPANIES OF NAV 2013
SystemService s = new SystemService();
s.UseDefaultCredentials = true;
s.Url = “”>localhost:7047/…/SystemService";
var companies = s.Companies();
foreach (string company in companies)
{
MessageBox.Show("The available companies are: " + company);
}
}
private void cmdImportStamp_Click(object sender, EventArgs e)
{
// create service obj and set credentials
Purchase_Invoice_Service p = new Purchase_Invoice_Service();
p.UseDefaultCredentials = true;
// new obj to set fields
Purchase_Invoice PurchaseINV = new Purchase_Invoice();
PurchaseINV.Buy_from_Vendor_No = “10000”;
PurchaseINV.Vendor_Invoice_No = “123334”;
// new obj to set lines
Purch_Invoice_Line lines = new Purch_Invoice_Line();
lines.Key = “1”;
lines.Type = (Type)2;
lines.Description = “Bicycle”;
lines.No = “1000”;
lines.Quantity = 1;
lines.Line_Amount = 1;
// insert into RTC client for 51 Purchase Invoice page
p.Create(ref PurchaseINV);
}
}
}