Thanks Howard Swerdloff for writing on this.
Yes, that I can do. But my purpose is to do it by using the GP Web Service. There is method called GetGLUnitAccountList but it is not working correctly for me. Because it is returning the data but for specific criteria.
Following is example:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using DynamicsGPWebServiceSample.DynamicsGPService;
namespace DynamicsGPWebServiceSample
{
class Program
{
static void Main(string[] args)
{
CompanyKey companyKey;
Context context;
LikeRestrictionOfString accountIdRestriction;
GLUnitAccountCriteria unitAccountCriteria;
GLUnitAccountSummary[] unitAccountSummaries;
// Create an instance of the web service
DynamicsGP wsDynamicsGP = new DynamicsGP();
// Be sure the default credentials are used
wsDynamicsGP.UseDefaultCredentials = true;
// Create a context with which to call the web service
context = new Context();
// Specify which company to use (sample company)
companyKey = new CompanyKey();
companyKey.Id = (-1);
// Set up the context object
context.OrganizationKey = (OrganizationKey)companyKey;
context.CultureName = "en-US";
// Create a restriction object
accountIdRestriction = new LikeRestrictionOfString();
accountIdRestriction.Like = "%9010%";
// Create a GL unit account criteria object
unitAccountCriteria = new GLUnitAccountCriteria();
unitAccountCriteria.GLAccountId = accountIdRestriction;
// Retrieve the list of GL unit account summary objects
unitAccountSummaries = wsDynamicsGP.GetGLUnitAccountList(unitAccountCriteria, context);
// Display the account number and description of each member of the summary list
StringBuilder summaryList = new StringBuilder();
foreach (GLUnitAccountSummary a in unitAccountSummaries)
{
summaryList.AppendLine("Account: " + a.Key.Id + " Description: " + a.Description);
}
MessageBox.Show(summaryList.ToString());
}
}
}
Here it is retuning data for 9010 but if I am search for 4444 then it is not returning the data. I don’t know what is going wrong in it.
I have doubt in LikeRestrictionOfString because it is searching on those parts which are not null. As I mentioned in above, I have five account formats and I am looking for the fifth format and for the fifth format there are some null value and because of that it is not returning data.
Thanks
Krunal Panchal