Developer forum

Forum » Development » Use UserParameterEditor and UserGroupParameterEditor for custom tax provider

Use UserParameterEditor and UserGroupParameterEditor for custom tax provider

Rui Silva
Reply

I have a solution that needs a custom parameter to select some users and/or groups to be ignored on the tax calculation.

I've tried to use the UserParameterEditor in the AddInParameter but this is returning an error:

Message: Object reference not set to an instance of an object.
StackTrace: at Dynamicweb.Extensibility.UserSelector.GetRadioListItem(String label, String value) at Dynamicweb.Extensibility.UserSelector.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at Dynamicweb.Extensibility.Editors.UserParameterEditor.Render(ConfigurableAddIn addIn, String name, Object value, Hashtable options, String label) at Dynamicweb.Extensibility.Editors.UserParameterEditor.Render(ConfigurableAddIn addIn, String name, Object value, Hashtable options) at Dynamicweb.Extensibility.AddInConfigurator.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at Dynamicweb.Admin.eComBackend.EcomConfigurableAddin_GetParameters.Page_Load(Object sender, EventArgs e)
Source: Dynamicweb
No innerexception

 

For the UserGroupParameterEditor the editor does not work and shows a message when entering the tax configuration:

 

I've tried this in two different versions 9.2.17 and 9.4.1 and the errors are the same.

 

Thanks,

Rui Silva

 

 

 


Replies

 
Nicolai Pedersen
Reply

Could you please zip and add your code file to this thread?

Thanks!

Nicolai

 
Rui Silva
Reply

Hi Nicolai,

See the project in attach.

Thanks,

Rui Silva

 
Peter Leleulya
Reply

Is there a solution to this?

 
Nicolai Pedersen
Reply

You can see the docs with example here:

https://doc.dynamicweb.com/api/html/6a1f7a3d-0491-4378-335f-e40cb2b07038.htm

If you have any issues, please provide your code and the exception and we will take a look at it.

Thanks, Nicolai

 
Peter Leleulya
Reply
public class MyFormSaveProvider : FormSaveProvider
    {
        #region Parameters
        [
            AddInLabel("UserGroup"),
            AddInParameter("UserGroup"),
            AddInParameterEditor(typeof(UserGroupParameterEditor), "multiple=false;")
        ]
        public string UserGroup { getset; }
 
        #endregion
 
        public override bool Save(FormSetting form, Dictionary<stringobject> keysAndValues)
        {
            //TODO: Add code here
            throw new NotImplementedException("This method is not implemented yet.");
        }
 
        public override bool Save(FormSetting form, Dictionary<stringobject> keysAndValues, string settings)
        {
            //TODO: Add code here
            throw new NotImplementedException("This method is not implemented yet.");
        }
    }

 

This form save provider which I wanted to extend with a GroupSelector gave the same error as Imar described.
I added the scripts Imar mentioned in https://doc.dynamicweb.com/forum/dynamicweb-9-0-upgrade-issues/dynamicweb-9-0-upgrade-issues/error-loading-addin-with-user-selector to the ParagraphEditModule.aspx to create a workaround.
Can you fix this in the core?

 
Nicolai Pedersen
Reply

I'll have someone look into if that can be done!

 
Peter Leleulya
Reply

Thanks Nicolai, otherwise I'm afraid the functionality will be broken again after the next core update ...

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi all,

New TFS 54506 has been created against the issue, will be fixed on further DW95 hotfix/DW96 release. Thanks.

BR, Oleg QA

 

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply

Hi Rui and Peter

The problem regarding #54506 "Unable to use UserParameterEditor and UserGroupParameterEditor for custom tax provider" has now been resolved in Dynamicweb version 9.4.20 and 9.5.1

To upgrade please choose this version from backend or download from here:

http://doc.dynamicweb.com/releases-and-downloads/releases

Let me know if you need any more help regarding this

Kind Regards
Dynamicweb Support
Kristian Kirkholt

 

You must be logged in to post in the forum