cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can we set mandatory for attachments

AnjaniAL
Explorer
0 Likes
793

Can we make attachments(Files Section) mandatory on the detail screen?
Just to ensure a file is attached. Can we do it with Entity Edits?

Accepted Solutions (1)

Accepted Solutions (1)

PhillipButts38
Product and Topic Expert
Product and Topic Expert

Yes,

You can do this with an edit with a QBQuery based expression.

NOTE: This Entity Edit may have a significant impact on Posting Performance

1. Create a QBQuery (QBQueryID = 'EE_Test' for this example) with Query Context of Expression with the following SQL (assuming that you want to check for attachments on the Broker record

  select count(e.entityattno as num from entityatt e
    inner join broker b on b.brokerno=e.entvalue and e.entname='BROKER'
    and b.brokerno=${brokerno)

2, Create an Entity Edit for the Broker Entity with the following expression  (using the QBQueryId of the Query above)

  att=query('EE_Test',1,BrokerNo)
    if(att > 0 )
    return true 
    else return false

3. This Entity Edit will prevent a Broker record from being saved if there are no attachments for this broker.

Hope this helps!

Phillip Butts

 

AnjaniAL
Explorer
0 Likes
Thank you for your answer. Can we also limit the entity edit to a particular custom form? My understanding is that entity edit is triggered whenever anything is saved to the said entity.
PhillipButts38
Product and Topic Expert
Product and Topic Expert
0 Likes
AnjaniAL, The entity typcically can only be edited from the Detail Form for the Entity. Is there another form that you are looking to prevent executing the entity edit from?
PhillipButts38
Product and Topic Expert
Product and Topic Expert

You can try something like if(formId == 'BrokerDFI') <-BrokerDFI is the form name and is case sensitive

"do Entity edit stuff"

else return false

AnjaniAL
Explorer
0 Likes
I have a slightly modified form in Broker Portal so was looking to trigger the Entity Edit only if the information is edited in the form that is accessed in the Broker Portal. Thank you for your answer. I will try with the formID condition that you suggested.
AnjaniAL
Explorer
0 Likes
Thank you for your answer and for responding to my follow-up questions as well. They were a great help.

Answers (0)