I am trying to use Continuum for the first time but even the simplest test fails resulting in the message :
Unknown Identifier 'PM_Transaction_Entry'
What am I not seeing?
class Program
{
static void Main(string[] args)
{
Dynamics.Application gpApp = (Dynamics.Application)Activator.CreateInstance(Type.GetTypeFromProgID("Dynamics.Application"));
string errMessage = "";
string codeString = "";
codeString = "open form PM_Transaction_Entry; " + Environment.NewLine;
int compilerError = gpApp.ExecuteSanscript(codeString, out errMessage);
if (compilerError != 0)
Console.WriteLine(errMessage);
Console.WriteLine("END OF LINE");
Console.ReadLine();
}
}
*This post is locked for comments
I'm sorry, Andrew. I abandoned this after my last message on the post. I never did look into the additional suggestions after that - namely whether I had Dexterity open or if there were copies of Dynamics.exe running in task manager that were ghosts.
I'm having the exact same problem. I cannot get it to work opening anything, it just throws an error saying "resource is not available". Did you get a proper resolution for this? I'm trying to use this as a way to pop a gp form from a browser window, i can register a protocol but it fails opening the window.
Are you by chance running Dexterity during the cases when it doesn't work? While the executable is "Dex.exe" it seems to be capture as a Dynamics.Application COM object. If this is the case Continuum is trying to send the request there, and it of course doesn't have the PM_Transaction_Entry form.
Sorry to hear about your troubles, I have been developing many applications using the SDK and haven't experienced this kind of problem.
Did you get a chance to check if there are any orphaned Dynamics.exe still running after you closed GP? If VS can't find a Dynamics.exe to latch onto, that first line of code will create a new instance which will not be logged into any company since you did not pass it any credentials. Simply closing GP will not end these instances hence manually ending them from Task Manager.
The other option is instead of running your app as a stand-alone application, build it as a class library and drop it into your gp Add-in folder. This should run your code in the same GP instance that you have logged in to.
I had to restart my machine and then it was working. I began adding more code for testing additional actions and it continued working...until it did not. Suddenly I was receiving the same error again. I closed both GP and Visual Studio and experimented with opening them in different orders but nothing worked. Only restarting the OS worked again.
Conclusion : this API is unreliable for use in an enterprise setting. Should I be surprised?
Chad, Are you using alternative form or modified form? Try to specify the current product id like gpApp.CurrentProductId = X or gpApp.ProductId = X(X can be zero or other product id) before the open form command. Hope this helps.
Try closing out of GP, open Task Manager and end task any Dynamics.exe. Re-log into GP and try again. Maybe there are some unlogged Dynamics instances that you created running your app without being logged in.
Your first line : Dynamics.Application gpApp = (Dynamics.Application)Activator.CreateInstance(Type.GetTypeFromProgID("Dynamics.Application"));
That latches onto any open Dynamics.exe, so GP is required to be open and logged into the company you want.
I am not using a modified form - I have also tried RM_Customer_Maintenance with the same result. I do have GP open and logged in - is that required by the way? Later in my testing I was wondering if running any pass thru scripts worked without GP open.
Do you have GP instance open and logged in? I can get that error if I log/close out of GP. Assuming you have GP open, maybe your code is not latching onto the GP instance?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156