Hi Gary,
Just following up on Mark's point (he beat me to it)....you can query for information about any record in your method account using one of the following functions.: MethodAPISelect_DataSet , MethodAPISelect_DataSetV2, MethodAPISelect_XML, MethodAPISelect_XMLV2
So continuing my example above, what if I wanted to include Amy Smith's BillAddressAddr1 and BillAddressAddr2 as part of my estimate? I can query for them something like the following
MethodAPI.Service _MethodAPI = new MethodAPI.Service();
lblMethodAPISelect_XMLV2.Text = _MethodAPI.MethodAPISelect_XMLV2(CompanyAccount, Login, Password, "", "customer", "BillAddressAddr1,BillAddressAddr2", "FullName = 'Amy Smith'", "", "", "");
_MethodAPI.Dispose();
The xml returned (which I've saved to a label in my example) would look something like(how you parse it out is your choice)
<?xml version="1.0" encoding="windows-1252" ?><MethodAPI response = "Success" MaxRecords= "False"><MethodIntegration Table='customer'> <Record> <BillAddressAddr1>someaddy1</BillAddressAddr1> <BillAddressAddr2>someaddy2</BillAddressAddr2> </Record> </MethodIntegration></MethodAPI>
I could then update my insert to look like
string[ arrInsertFieldsArray = new string[ { "Customer", "TxnDate", "BillAddressAddr1", "BillAddressAddr2" };
string[ arrInsertValueArray = new string[ { "Amy Smith", "13/jun/2013", "someaddy1", "someaddy2" };
MethodAPI.Service _MethodAPI = new MethodAPI.Service();
lblMethodAPIInsertV2.Text = _MethodAPI.MethodAPIInsertV2(CompanyAccount, Login, Password, "", "estimate", arrInsertFieldsArray, arrInsertValueArray);
_MethodAPI.Dispose();
So its just a matter of determining what you need in advance, pulling it from your account, then updating your insert to use the pulled information.
Dave