Add data to plugin and document type.  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Re: Add data to plugin and document type.

Postby Mike.Sheen » Sun Jul 02, 2017 1:41 pm

I suspect that the following line is the problem:

Code: Select all
pluginfieldvalue.Contents = "string";


Because the preceding line:
Code: Select all
var pluginfieldvalue = s_task.CustomFieldValues.get_ItemFromSettingName("PluginFieldName", "PluginName");


is probably returning a null value into pluginfieldvalue.

There are only two possible causes:
  • You have the PluginFieldName or PluginName incorrect
  • The plugin the custom field is defined in failed to compile when the service logs on

I bet the plugin is failing to compile (if it was defined in a different plugin). Verify first by commenting out the one line
Code: Select all
pluginfieldvalue.Contents = "string";
but leave the first line inside the for loop in.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Add data to plugin and document type.

Postby nexio » Mon Jul 03, 2017 5:20 pm

Hi Stuart,

Thanks for the reply. We already tried the application pool and identity. Complied directly for 32 bit and copied all the DLLs in the bin directory, still same error.

But in the development workstation, where the application is working, when we remove the DLLs in Compile and Runtime from C:\ProgramData\Jiwa Financials\Jiwa 7\7.0.157\Admin_User\Database_Host_Server\Database_Name\Plugins\Admin_User, it automatically created new files but the application failed in the development workstation too. But when we replaced those newly created DLL files with the original DLL files, which were previously removed from Compile and Runtime, it worked in the development machine. We, then copied those DLL files in the target machine in the same folder in ProgramData, but it does not work there. Copied those DLLs to bin in the hosted application in target machine, still didnt work on target machine, but it works Ok in development machine.

Hi Mike,

Thanks for the reply, I tried commenting the line:
Code: Select all
pluginfieldvalue.Contents = "string";

It still does not work, and returns null value. The code is same for both development machine and target machine, but yet it works on development one and sends the data to the plugin and it shows in Jiwa, but on target server, its not working. I have also checked that the plugin and value field is there, checked their names. The plugin however does use another plugin for performing inventory actions, but that is called inside the service manager plugin.

Thanks.
nexio
Occasional Contributor
Occasional Contributor
 
Posts: 24
Joined: Thu Jun 08, 2017 6:32 pm

Re: Add data to plugin and document type.

Postby Mike.Sheen » Mon Jul 03, 2017 5:57 pm

nexio wrote:Thanks for the reply, I tried commenting the line:
Code: Select all
pluginfieldvalue.Contents = "string";

It still does not work, and returns null value. The code is same for both development machine and target machine, but yet it works on development one and sends the data to the plugin and it shows in Jiwa, but on target server, its not working. I have also checked that the plugin and value field is there, checked their names. The plugin however does use another plugin for performing inventory actions, but that is called inside the service manager plugin.

Thanks.


Now I'm confused. What do you mean by "does not work"? I thought you were getting a null reference exception with the lines inside the for loop - I wanted to isolate which line was causing the issue by commenting out the second line - are you saying you've commented out the second line and you still are getting a null reference exception?

I also assumed, from the wording of your previous posts, that you had left the for loop in place and commented out the lines inside the loop and did not get the exception? Is that the case or not?

I point you back to this post in this thread where I suggested you provide the resources necessary for us to reproduce the issue.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Add data to plugin and document type.

Postby nexio » Tue Jul 04, 2017 5:04 pm

Hi Mike,

Apologies for the confusion. What I meant was that after commenting the second line, it still gives null reference exception. And if the inside lines were commented in the for loop, it does not throw null reference exception.

Although the issue is fixed now, turns out, the target machine was indeed missing few DLLs in the ASP.NET folder in C:\ProgramData\Jiwa Financials\Jiwa 7\7.0.157, which were present in the development machine, including the DLL for the plugin we were referring to. We were matching the admin folder, where all DLLs are present, but ASP was using its own user and that's where all the DLLs needed to be.

Regarding the plugin, I don't know how to create one, but sure would love to start working on creating a plugin :) .

Thanks
nexio
Occasional Contributor
Occasional Contributor
 
Posts: 24
Joined: Thu Jun 08, 2017 6:32 pm

Previous

Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 10 guests