I want to set an expression based on whether there is data in a binarycontent field.
This is the entity setup:
This is the data in the attribute:
If the field shows BinaryData (0 bytes) I want to have a specific value in the expression.
I tried this as it was the only thing I saw that might work, but it doesn't work.
Hello Paula,
Easy way is before or after to save check the data size.
Regards
First of all I would not use the BinaryData extension in the case of a reactive application.It's a server action, not client a client action.Second of allMaybe take the following suggestions into consideration which will also help with overall performanceUse case 1:If the record in the CustomerDocuments table does not always contain binary data I would not put the Binary data attribute in the same Entity.I would alter your relationships to the following: (example)Use your JOINS/PK's/FK's to do the checks, not the BindaryDataIt also allows you to play with JOINS in your query and only fetch the information when it is required. Improving query performanceUse case 2:If the record in the CustomerDocuments table always contain binary data, I would use the PK of CustomerDocument record to do the check, instead of the BinaryData attribute.On top of that, instead of putting the condition in your UI, you could make your join With or Without and put the condition in a calculated attribute of your query.Based on your use case both solutions would improve query performance
Hi @Paula Wright ,
If you want to check binary data size and if you want to check on the server side, you can follow the method suggested by Paulo above. For client-side validation, you can use JavaScript. I have attached an OML from which you can handle validation on the client side.
Hope It helps!
RegardsN_G
Thank you! I'll take a look at this. I believe it should be done on the client side before saving.
Sure, I hope it helps you!
I believe the easiest solution is to figure out if there is a value before saving the signature. I'm working behind someone else and I'm unfamiliar with SignaturePads so I'm still trying to figure it out.
Currently, a customer would click a button to bring up the SignaturePad. Then they have two choices - to clear or click Done. If Done is clicked then it calls a client action to update the entity but there is no check to see if there's a value. If there's nothing it pops an unnecessary empty record into the entity. I need to figure out how to check this before updating.