If expressions in templates

Hello guys, 

I am trying to print the 4 barcode codes of the product, but only if printing is enabled in the client table, I have it this way but it does not print

 

I am trying to print the last 4 barcode codes of the product, but only if printing is enabled in the customer table, I have it this way but it does not print

<<Start: [Related InvoiceDetails]>><<[ProductID].[Producto]>><<If:([CustomerID].[PrintCodBarra]=Si)>>
<<RIGHT[ProductID],4>>
<<EndIf>>
<<[Quantity]>>
<<[Price]>>
<<[Total]>><<End>>

where the formula is wrong

LeviP_0-1685395550661.png

 



Solved Solved
0 5 192
1 ACCEPTED SOLUTION

It is already solved, the detail is that it does not have a reference in the detail of the invoice, only in the header, that is why the formula was changed
ANY(SELECT(Customers[PrintCodBarra]

View solution in original post

5 REPLIES 5


@LeviP wrote:

[CustomerID].[PrintCodBarra]=Si


If PrintCodBarra is a Yes/No type column, confirm whether this syntax works elsewhere in your app. If it doesn't, consider revising Si to Y or true or even just eliminating =Si. If it's a Text type column, try enclosing Si in quotes: "Si".


@LeviP wrote:

RIGHT[ProductID],4


Try RIGHT([ProductID],4).

 

Yes/No, I have it as Si/No in Spanish
LeviP_0-1685398076603.png

This way works very well, however I need the condition of the Customer.PrintCodBarra table (Yes/No) so that it prints if it is true
<<Start: [Related InvoiceDetails]>><<[ProductID].[Producto]>>
<<RIGHT([ProductID],4)>>

LeviP_0-1685399753790.png

 

At some point I am writing the condition wrong or I am not applying the correct logic

And in this way it doesn't work, it doesn't even generate the pdf

LeviP_0-1685402017591.png

 

It is already solved, the detail is that it does not have a reference in the detail of the invoice, only in the header, that is why the formula was changed
ANY(SELECT(Customers[PrintCodBarra]

Top Labels in this Space