WELCOME TO THE COMMUNITY
find what you are looking for or ask a new question
Home > Forum > Latest posts

latest posts

MVP

Hi,

if you aren't familiar with javascript the easiest way would be to:
1. Create a menu action using with the "start new hyperlink" function and define the parameters
2. Create the html field and use the InvokeMenuAction function.
<button onclick="InvokeMenuAction(#{ACB:45}#)">Start workflow </button>
3. Hide the menu action in the behavior tab during load.
This will hide it from the user interface but the function will be available. Hiding it with an execution condition will also prevent the option to use it via javascript.


Best regards,
Daniel

Hello,

I have 4 HTML fields (Categories) and one Choice field (Projects), and I would like to place some hyperlinks on HTML fields that start a new instance.
Can I set 'StartElement' function on this HTML field so it can define other parameters that should auto-fill in the instance?
For example: I choose a project, then press a 'Category' button (one HTML field) that will start an instance, and in that instance, the project and category should be auto-filled.

I have already checked these links:
https://community.webcon.com/posts/post/the-hyperlink-action/65
https://community.webcon.com/posts/post/html-form-type/152

Is that possible? Or do you have any suggestions?

Thank you.

In reply to: Maksymilian Stachowiak

Ah, this one is not in the article - you could use ClearWFElemIDAdv like this:

SELECT WFD_AttChoose1, dbo.ClearWfElemIDAdv(WFD_AttChoose1) as x FROM WFElements WHERE WFD_ID = 123123

You will probably also need dbo.SplitToTable, below two possibilities how to use them:

-- ClearWFElemID Example

SELECT
dbo.ClearWfElemID(query.item) As ID,
dbo.ClearWfElem(query.item) As Value
FROM
dbo.SplitToTable((
SELECT WFD_AttChoose1 as x FROM WFElements WHERE WFD_ID = 123123
), ';') as query

-- ClearWFElemIDAdv Example

SELECT
query.item
FROM
dbo.SplitToTable((
SELECT dbo.ClearWfElemIDAdv(WFD_AttChoose1) as x FROM WFElements WHERE WFD_ID = 123123
), ',') as query

Thank you very much to both of you!!

MVP
In reply to: AndreeLl B

I have created a DB with the following query:
select dbo.ClearWFElemID(WFD_AttChoose1) as CategoryIDs, wfd_id as id from wfelements

and it is returning only the first ID from my Choice field-multiple values.

Ah, this one is not in the article - you could use ClearWFElemIDAdv like this:

SELECT WFD_AttChoose1, dbo.ClearWfElemIDAdv(WFD_AttChoose1) as x FROM WFElements WHERE WFD_ID = 123123

You will probably also need dbo.SplitToTable, below two possibilities how to use them:

-- ClearWFElemID Example

SELECT
dbo.ClearWfElemID(query.item) As ID,
dbo.ClearWfElem(query.item) As Value
FROM
dbo.SplitToTable((
SELECT WFD_AttChoose1 as x FROM WFElements WHERE WFD_ID = 123123
), ';') as query

-- ClearWFElemIDAdv Example

SELECT
query.item
FROM
dbo.SplitToTable((
SELECT dbo.ClearWfElemIDAdv(WFD_AttChoose1) as x FROM WFElements WHERE WFD_ID = 123123
), ',') as query

MVP
In reply to: AndreeLl B

I have created a DB with the following query:
select dbo.ClearWFElemID(WFD_AttChoose1) as CategoryIDs, wfd_id as id from wfelements

and it is returning only the first ID from my Choice field-multiple values.

Hi AndreeLi,

the one for returning a comma separated string with all ids is called:
ClearWFElemIDAdv

You can take a look at the content database Programmability\Functions\Scalar-valued functions

Best regards,
Daniel

In reply to: Maksymilian Stachowiak

Hi
This is by design - you can read more here: https://community.webcon.com/posts/post/indexed-choice-columns/406

If you want to get all the ID's you should look at the dbo.ClearWFElemID function - it's also mentioned in above article.

I have created a DB with the following query:
select dbo.ClearWFElemID(WFD_AttChoose1) as CategoryIDs, wfd_id as id from wfelements

and it is returning only the first ID from my Choice field-multiple values.

MVP
In reply to: Dariusz Tułacz

Could you please provide a solution for a specific table by referring to the following?

document.querySelectorAll('.header-cell__name-value').forEach(h => { h.style.textAlign='center' })

Hi Dariusz,

if you want to apply this styling only to a single item list or even one column in this, I would add an html field using this css:

<style>
#SubElems_#{WFCON:384}# th
{
text-align:center;
}
#SubElems_#{WFCON:384}# th[data-key="#{SFLD:36}#_#{DCN:36}#"]
{
text-align:left;
}
</style>

Adding the id of the item list will restrict the styling to all children of this item list.
Adding the attribute selector with data-key, will restrict the style of a table header to a single column.


This was tested in 2023.1.2.99. Depending on your version the html may look different.

Best regards,
Daniel

In reply to: Maksymilian Stachowiak

Hi Patryk,
I think underneath adding that column to the data source it creates SQL join with list items on the whole data source.

If the join happens first, then you can hide the columns, but rows are already multiplied.
The solution would be to have two different reports.

I can confirm that behavior on 2023.1.2.123.

That makes sens Maksymilian. Will go for the second report option as users do not want to have that multiplication in the main one. Thanks a lot!