using Microsoft.Dynamics.GP.eConnect;
[WebMethod]
public string NextSopDocumentNumber(string TransactionType, string salesDocID)
{
GetNextDocNumbers sopTransNumber = new GetNextDocNumbers();
string nextTransactionNumber = string.Empty;
try
{
///string sConnectionString = ConfigurationManager.ConnectionStrings["GpeConnectConnectionString"].ToString();
string sConnectionString = ="server=YourServerName;database=YourDatabaseName;Integrated Security=SSPI;persist security info=False
string sConnectionString = ="server=YourServerName;database=YourDatabaseName;Integrated Security=SSPI;persist security info=False
switch (TransactionType)
{
case "SalesQuote":
nextTransactionNumber = sopTransNumber.GetNextSOPNumber(IncrementDecrement.Increment, salesDocID, SopType.SOPQuote, sConnectionString);
break;
case "SalesOrder":
nextTransactionNumber = sopTransNumber.GetNextSOPNumber(IncrementDecrement.Increment, salesDocID, SopType.SOPOrder, sConnectionString);
break;
case "SalesInvoice":
nextTransactionNumber = sopTransNumber.GetNextSOPNumber(IncrementDecrement.Increment, salesDocID, SopType.SOPInvoice, sConnectionString);
break;
case "SalesReturn":
nextTransactionNumber = sopTransNumber.GetNextSOPNumber(IncrementDecrement.Increment, salesDocID, SopType.SOPReturn, sConnectionString);
break;
case "SalesBackOrder":
nextTransactionNumber = sopTransNumber.GetNextSOPNumber(IncrementDecrement.Increment, salesDocID, SopType.SOPBackOrder, sConnectionString);
break;
}
return nextTransactionNumber;
}
catch (Exception ex)
{// If an error occurs, diplay the error information to the user
throw ex;
}
finally
{
sopTransNumber.Dispose();
}
}Below are eConnect schemas to get other transaction type Next Doucment Number.
http://msdn.microsoft.com/en-us/library/ff623613.aspx
To Rollback Transactions
Number:
[WebMethod]
public void RollBackMyDocumentNumber(string strTransactionType,
string strDocNumber)
{
DocumentRollback TransRollback = new DocumentRollback();
string sConnectionString = ConfigurationManager.ConnectionStrings["GpeConnectConnectionString"].ToString();
try
{
switch (strTransactionType)
{
case "SOP":
TransRollback .Add(TransactionType.SOP, strDocNumber);
break;
case "Adjustment": //Adjustment
TransRollback.Add(TransactionType.IVTrans, strDocNumber);
break;
case "IVTransfer":
TransRollback.Add(TransactionType.IVTransfer, strDocNumber);
break;
case "POPReceipt":
TransRollback.Add(TransactionType.POPReceipt, strDocNumber);
break;
}
}
catch (Exception ex)
{// If an error occurs, diplay
the error information to the user
throw ex;
}
finally
{
TransRollback.Dispose();
}
Below is more details on RollBackDocument
Feel free to email me if you need any further assistance or please share your code for same.
Happy coding!!!
Thanks
Sandip
I wants to thank for the wonderful read because of the informative information and sharing the thoughts to us....
ReplyDeleteHI, is there any eConnect 10.0 schema or WS to enter Sales Invoices entry to GP. Any help is highly appreciated. Please respond to me in my email n_shrestha@yahoo.com. Thanks.
ReplyDelete@Shrestha,
DeleteWeb Method SalesInvoice is available in Dynamics GP Web Service. Here is link http://msdn.microsoft.com/en-us/library/cc508459
Thanks
Sandip
helpful post!! keep up this sweet stuff
ReplyDeleteAlso visit my web-site ... RGV Realty
Hi Sandip!
ReplyDeleteIn this post 'string salesDocID' representing to what?
And how to get the type of a transaction in c#?
Plz Help me, I am new to GP.
Hi,
DeleteSalesDocID is your sales order type like STDORD.
TransactionType I differentiate like 'SalesQuote' for Quote, SalesOrder for Order etc
If you need Next Sales Order Number and your sales order type is 'STDORD' then you need to pass ("SalesOrder","STDORD") to web service.
My email id is: sandipdjadhav@hotmail.com feel free to email me your code and details I will give my best.
Thanks
Sandip
This comment has been removed by a blog administrator.
ReplyDeleteHello Sandip,
ReplyDeleteWe are facing problems while setting Bank Deposit Posting we are getting following Error
Error Number = 7408 Stored Procedure= taBRPostBankDeposits Error Description = The Deposit Number for the Checkbook passed in does not exist to be posted
Node Identifier Parameters: taBRPostBankDeposits
CHEKBKID = GENERALCHEKING
depositnumber = RCPTTEST12
Related Error Code Parameters for Node : taBRPostBankDeposits
CHEKBKID = GENERALCHEKING
depositnumber = RCPTTEST12
Thanks and Regards,
Sanjay Parab
Sanjay,
ReplyDeleteCan you try not to enter Deposit Number? Do not supply Deposit Number and try to integrate your transaction.
Feel free to email me on : sandipdjadhav@hotmail.com
Thanks
Sandip
HI, Thanks for the code, is there any eConnect or WS to enter an Inventory transfer with Serial-Lot Control
ReplyDeleteteddy_gdl@hotmail.com. Thanks.
I have just send email to your Hotmail.
DeletePlease let me know if you need any additional information.
Thanks
Very Help full information shared with us keep it up Sandip Jadhav :)
ReplyDeleteDynamics GP Partner in UAE
Hi Sandip,
ReplyDeleteI am trying to avoid eConnect in a test.
How can I get the next IV document number for doing a bin transfer by executing the underlying stored procedures? Which stored procedure should I use and what are the parameters please?
Thanks