Question

Form plugin code -- getMetaConfig(): Promise NintexPlugin versus Promise PluginContract

  • 17 June 2024
  • 3 replies
  • 26 views

Userlevel 2
Badge +6

I started a form plugin C# / Lit project using the Nintex Form Plugin Starter project available at https://github.com/NTX-XT/ntx-form-plugin-starter

and it has this line,

export class PageHighlight extends LitElement {
    static getMetaConfig = (): Promise<PluginContract> | PluginContract => config;

 

and I used it to build a web component that allows a user to select a date from the calendar. 

I now want to store the selected date for use in the form or workflow, so I am trying to follow the example code at https://help.nintex.com/en-US/formplugins/Examples/CreatePlugin_MaterialTextField.htm

which tells me to insert this line,

static getMetaConfig(): Promise<NintexPlugin> | NintexPlugin

As you can see, it uses Promise<NintexPlugin> instead of Promise<PluginContract>.

So which one do I use, and what is the difference between them?

Where is the documentation on how to use getMetaConfig?

 

 


3 replies

Userlevel 5
Badge +13

Hi @PabloL 

For you project it should remain as PluginContract, the promise may different between projects.

 

Here is the NPM for the plugin contract that is added as a dependency for this starter kit.

https://www.npmjs.com/package/@nintex/form-plugin-contract

 

Jake 

 

 

Userlevel 5
Badge +13

Hi @PabloL 

I just published the template I use, I prefer to use JavaScript over TypeScript so the starter template I use is a little different but I find more friendly.

 

https://github.com/JSDenintex/neo-plugin-template

 

Hope this helps

Jake 

Userlevel 2
Badge +6

Thanks. I can see now that those are simply 2 different methods to call to getMetaConfig and I can modify the file sk-hello-world.config.ts to include the properties that I want from the example.

I still don’t have it completely working yet. It allows me to select the date but it does not store it and is not available to use in the form or workflow.

Here is my code if you want to look and see:

https://github.com/grahampasmurf/ntx-form-plugin-demo1

 

 

Reply