Closed ermancio closed 7 years ago
I'm using Plomino 1.15.....
It should work the way it is, but I guess this will a better Title formula:
if plominoContext.getItem('State') == 'Open':
return"Document O"
if plominoContext.getItem('State') == 'Archived':
return"Document F"
if plominoContext.getItem('State') == 'Null':
return"Document N"
Great! It works perfectly. Thank you
One more question: I need to define the ID Formula only for new document and leave the assigned ID for edited document.
I try to do in this way:
if plominoContext.isNewDocument(): if plominoContext.getItem('State') == 'Open': return"Document O" if plominoContext.getItem('State') == 'Archived': return"Document F" if plominoContext.getItem('State') == 'Null': return"Document N"
and that's fine. But I miss the "else" condition. How can I leave the id as already defined?
Thank you
The document ID formula is executed only once at creation time. The id is not meant to change at anytime after that.
Hello everybody. I set the document title formula to compute the document title. I need to change it when an event occurs. Is it possible? The problem arises because I set one calculated field (ID_state) which must change when it is saved (onsave event). For example: in document Title formula I have:
"Document" + ' ' + str(plominoDocument.ID_state)
but onsave document I have
_if plominoContext.getItem('State') == 'Open': plominoContext.setItem('ID_state', 'O')
if plominoContext.getItem('State') == 'Archived': plominoContext.setItem('ID_state', 'F')
if plominoContext.getItem('State') == 'Null': plominoContext.setItem('IDstate', 'N')
Thank you