web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Pass-thru sanscript via Continuum fails on simple test

(0) ShareShare
ReportReport
Posted on by 1,588

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 have the same question (0)
  • JamesLyn Profile Picture
    360 on at

    open form 'PM_Transaction_Entry';

    You forgot the single quotes around the form name.

    James

  • chadbruels Profile Picture
    1,588 on at

    You do not require single quotes around an entity name if it does not have spaces. Besides, adding single quotes yields the same error message.

  • JamesLyn Profile Picture
    360 on at

    Weird, copying your code executes fine for me. Are you using a custom/modified form?

  • JamesLyn Profile Picture
    360 on at

    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?

  • chadbruels Profile Picture
    1,588 on at

    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.

  • JamesLyn Profile Picture
    360 on at

    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.

  • JamesLyn Profile Picture
    360 on at

    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.

  • Suggested answer
    Community Member Profile Picture
    on at

    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.

  • Verified answer
    chadbruels Profile Picture
    1,588 on at

    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?

  • JamesLyn Profile Picture
    360 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans