Skip to main content

When adding a new custom feature switch i get an error when changing another feature due to the null value in the new feature switch field. How can i prevent this?

[PXDefault(false, PersistingCheck = PXPersistingCheck.Nothing)] doesn’t help here!

 

 

I have always used CustomPlugin class to set the values in the db. Essentially ran the sql equivalent of:

update featuresset set Newfield=false where Newfield is null 

 

When you publish the vales will be set to whatever you want the defaults to be, and once set, even if the customplugin runs again, nothing happens as your filter is for when there is no value.


@Shawn Burt this could be a solution but i can’t beleve that there isn’t a more simple approach.


The problem I found is that the default tools are for new records, given that featuresset only has one record, the default doesn't seem to work correctly.  Not sure but think it's related to how the screen and the feature attribute works. 


For existing records with uninitialized user fields we have “PXDefaultAttribute(PersistingCheck = PXPersistingCheck.Nothing)]”. But unfortunately this doesn’t work here.


Yeah, it's like the feature attribute overrides that,  that's why i had to set the values in the CustomPlugin 


@priekenberg40  I’d like to make sure that the feature switch you are adding is confirmed with your Technical Account Manager at Acumatica. Because the feature switches are controlled by Acumatica licensing server, if it is not registered in the licensing server you’ll not be able to activate this feature in a licensed Acumatica instance.


Hi @priekenberg40  Yes, as indicated by Dmitrii, this customization normally will work with the trial version license, to work with the real Acumatica license, we need to inform to Acumatica add this module/integration in the license and whoever buys this module will get this feature.

 

For the customization, you can refer - https://asiablog.acumatica.com/2021/10/add-new-custom-feature-to-the-enable-disable-features-screen-cs100000.html 


@Dmitrii Naumov we are developing extensions for Haufe.X360 (Germany). No issue there.


@Naveen Boga This is no issue here. The setup of the custom feature switch is done already, as shown in initial post. The problem is the null value in the new user field in the FeatureSet record.


@priekenberg40  As I indicated in my blog post, can you please try like below.

  Feature(false, typeof(FeaturesSet.commerceIntegration), null, DisplayName = "New Feature")]

 

Above, the highlighted text is missing your DAC file. Which is the default value for the field.

 


@Naveen Boga i also tried it with setting default value to false first. Same result.
Screenshot is from the last of several tries.


@priekenberg40  That should work and it is working for me with the same code.

Not sure why it is not working for you, please reach out to the Acumatica support team by creating a support case OR @Dmitrii Naumov can help you with this.

 


@Naveen Boga  Are you sure? You create a new switch and then enable/disable another feature switch in CS.10.00.00 and leave the new one untouched and don’t get an error?


FeatureAttribute constructor needs one change:
 

 


Yes, @priekenberg40  I did not see any issues.

I don’t think any changes are required to the FeatureAttribute.

if we provide like the below at the DAC level, internally automatically it will invoke the constructor and taken care of the default value as FALSE

oFeature(false, typeof(FeaturesSet.commerceIntegration), null, DisplayName = "New Feature")]

 


@Naveen BogaOkay, if you don’t see any issues it may be related to multi language or to our local version here in Germany (Haufe.X360). Reproduced in 2021 R2 and 2022 R1.

@Shawn Burt, which version are you using when you face this issue? Are you using multi language?


Reply