Home / Forum / Latest posts

Hi Kobina,

I have no idea how you setup you field to achieve this, but this is beside the point. :)

I've used the following setup, first attachment:
- The picker has four options (1)
- A business rule contains two of these options, which returns all rows (2)
- On the value change a form rule checks whether the current picker Id in in the collection of values returned by the business rule.

This works quite well, second attachment. If A is selected, which is not part of the business rule options, the message is displayed and it gets deleted. If B is selected the other message is displayed and the values is kept.

Best regards,
Daniel

In reply to: Thanks for the answer first and foremost!

I tried it out right now, but I get the error that "PublishPluginsPackage.ps1" is not digitally signed so I cannot publish my extension.

I already tried "Set-ExecutionPolicy unrestricted" on my local machine which sadly did not work

Do you know any way around that or how to fix that?

Thanks in advance

Hi Fabian,


it's strange that the policy wasn't changed. Have you executed PowerShell as an administrator when you set the execution policy? I just noticed that you receive an error, when you don't do it.

I'm not sure whether a restart of Visual Studio would make any difference.

I just stumbled about this question. But it's from a long time ago and I don't believe that you are using Visual Studio in 32bit on a 64 bit machine.
https://stackoverflow.com/questions/6142914/powershell-executionpolicy-is-wrong-when-run-through-visualstudio

Nevertheless, if you only have SDK actions, without React components, you an simply put together the .zip file with the required files yourself.

Here's are two replies how to do this:
https://community.webcon.com/forum/thread/677

Best regards,
Daniel

In reply to: Hi Fabian,

if you only need this in one step, you could simply break the inheritance. This will allow you to create a completely different layout.
I personally hate this option, but there are these cases where you have to fall back to it.
The reason why I hate this: You always have to remember that reapply all changes regarding field order / visibility. Something which is easily forgotten.

Of course you could achieve the same with two form types. As far as I'm aware there's no action for changing the form type but you can create a SDK action:

public class UpdateDocumentType : CustomAction<UpdateDocumentTypeConfig>
{
public override void Run(RunCustomActionParams args)
{
if (!int.TryParse(this.Configuration.FormTypeIdAsString,out int formTypeId))
{
throw new ApplicationException($"Value '{this.Configuration.FormTypeIdAsString}' could not be parsed to integer.");
}
args.Context.CurrentDocument.UpdateDocumentType(formTypeId);
}
}

public class UpdateDocumentTypeConfig : PluginConfiguration
{
[ConfigEditableText(DisplayName = "Form Type")]
public string FormTypeIdAsString { get; set; }

}

Best regards,
Daniel

Thanks for the answer first and foremost!

I tried it out right now, but I get the error that "PublishPluginsPackage.ps1" is not digitally signed so I cannot publish my extension.

I already tried "Set-ExecutionPolicy unrestricted" on my local machine which sadly did not work

Do you know any way around that or how to fix that?

Thanks in advance

Hi Fabian,

if you only need this in one step, you could simply break the inheritance. This will allow you to create a completely different layout.
I personally hate this option, but there are these cases where you have to fall back to it.
The reason why I hate this: You always have to remember that reapply all changes regarding field order / visibility. Something which is easily forgotten.

Of course you could achieve the same with two form types. As far as I'm aware there's no action for changing the form type but you can create a SDK action:

public class UpdateDocumentType : CustomAction<UpdateDocumentTypeConfig>
{
public override void Run(RunCustomActionParams args)
{
if (!int.TryParse(this.Configuration.FormTypeIdAsString,out int formTypeId))
{
throw new ApplicationException($"Value '{this.Configuration.FormTypeIdAsString}' could not be parsed to integer.");
}
args.Context.CurrentDocument.UpdateDocumentType(formTypeId);
}
}

public class UpdateDocumentTypeConfig : PluginConfiguration
{
[ConfigEditableText(DisplayName = "Form Type")]
public string FormTypeIdAsString { get; set; }

}

Best regards,
Daniel

Hi everyone,

I just stumbled about an action which executions hasn't been logged. The reason is simple, the according checkbox wasn't ticked.

If you want to verify that all you actions are logged you can run this SQL statement. It displays all actions which aren't logged. Maybe for a reason or due to some misconfiguration:

SELECT AGR_Name, APP_Name, DEF_Name, WF_Name, STP_Name, ACT_Name
FROM [dbo].[WFActions] actions join WFSteps on ACT_STPID = STP_ID
join WorkFlows on STP_WFID = WF_ID join WFDefinitions on WF_WFDEFID = DEF_ID
join WFApplications on DEF_APPID = APP_ID
join WFApplicationsGroups on APP_AGRID = AGR_ID
where ACT_LogExecution = 0 and ACT_IsDeleted = 0
order by AGR_Name, APP_Name, DEF_Name, WF_Name, STP_Name

Even so it's tempting, you shouldn't use an SQL statement to change these. :)

Best regards,
Daniel

In reply to: Hi Klaus,

maybe you can change your procedure to a table-valued function, than you could easily use it in an select statement.
An example using one of the provided table-valued functions in the BPS content db:
select item
from dbo.SplitToTable('a,b,c,d',',')

Otherwise you could test this approach, which I didn't test myself.
http://www.techbrothersit.com/2014/08/tsql-how-to-execute-stored-procedure-in.html

Best regards,
Daniel

Hi Daniel,

the hint with the table-valued function was great. I have to chance the setup a bit, because the gain in speed wasn't as expected, but I have plenty of ideas to use this.

The approach shown in the link doesn't work as I can't change the database to allow "Data Access".

Kind regards
Klaus

Hi Klaus,

maybe you can change your procedure to a table-valued function, than you could easily use it in an select statement.
An example using one of the provided table-valued functions in the BPS content db:
select item
from dbo.SplitToTable('a,b,c,d',',')

Otherwise you could test this approach, which I didn't test myself.
http://www.techbrothersit.com/2014/08/tsql-how-to-execute-stored-procedure-in.html

Best regards,
Daniel