We are experiencing 2 different issues with blocks.
Issue #1: Block Aggregate Errors
We created 2 blocks and added aggregates to those blocks. Inside each block there are input widgets whose values depend on the aggregate's data (example: first name, last name, level, age, etc.). Inside the blocks, there are no errors. Now, when we add a block to screen A, all of those inputs light up as errors and the module cannot be published. If we look at the error by opening the Expression Editor, we can see the Scope is no longer the block, but the screen that the block was added to. Since Screen A does not have the block's aggregate and cannot see it, all of the inputs within the block are now highlighted as errors. The messages say "Cannot identify {block aggregate's name}".
If we add the block's aggregate to Screen A, all of the errors disappear and the block works as expected. However, this is not the behavior expected nor is it ideal. If we have to add the block's aggregate to any screen we want to use the block on, this defeats the whole purpose of using a block.
We verified that when examining the block only, those input values point to the block's aggregate and the Expression Editor's Scope is confined to the block as expected. Adding the block to the screen creates the scope issue.
Issue #2: Changes to a block are not updated automatically on a screen
If we make a change to a block, that change is not updated on any screen using that block. Instead, we have to manually remove the block from the screen and re-add it to the screen. Again, this defeats the point of using blocks within and across apps. It is supposed to update "automatically".
Any help on these two issues would be greatly appreciated.
Thank you.
Hello,
The solution was to remove the placeholders holding the labels and input widgets. After we removed the placeholders, changes to the blocks were updated on their parents' screens and the aggregate data pulled for the input widgets are no longer appearing as errors. Not sure why this was required when the Blocks tutorial video specifically says to use placeholders when creating a block, but this was the solution. Thank you to those that offered suggestions.
Hello Megan,
On the first issue. Do you have inputs on the blocks? when I say inputs, I say input variables.
On the second issue, do you have your blocks on the module where you have the screens or in another module?
Kind regards,
Márcio
For issue #1, the "inputs" that I was referring to are actually widgets, such as text and input widgets. But yes, there are input variables from the parent as well that the blocks need to function, such as an id number that gets passed to the block.
For issue #2, the blocks are within the same module as the "parent" screens. It is all under one single module.
I hope this helps.
Thank you,
Megan
That is not good :/
(I knew what you were referring :)
Can you share a module with what you want? Or recreate the issue?
On the inputs widgets, if you were expecting some input variable with mandatory a true, I would say that's why. But in this perspective, I cannot help you more than this, i.e, in nothing.
Just trying to help :/
In any case, I would advise you to contact support.
https://success.outsystems.com/Support
Hi Megan,
The way you want the blocks to behave (being reusable in both issues: aggregate and reflecting changes in the block) is how the behaviour should be.I notice sometimes that when I have a screen open in service studio, and change something to the block on it, it will not show immediately (just in service studio). It may help to open a different screen and then open the screen containing the block, then changes are shown.As Marcio stated, I also think it would be helpful to share a module with your problem, to underatand what is happening. Or perhaps you can re-create the issue in a module you are able to share?Kind regards,Betteco