Yes/No Field Set just one Yes

hi every one
I’m trying to create a datatype “contato” and with a field princial, that sets wich contato is the most important, but just only one number can be set as the principal

Wich is the most eficience way to do that?

I already now that i can creat in the workflow, an action to change a list of things, to set the datafield contato-principal to “no”, but i’m wundering if have a more eficience way to do that

Hi there, @eduardo_gsp_oliveira… since only one contato can be the principal at any given time, what you described should be as simple as making two changes when a contato is set as the principal. First, do a search for the first contato item where the principal field is set to yes, and set its principal field to no. Then, make changes to the contato that is being set as the new principal, and set its principal field to yes.

You might be able to do what I described by using a database trigger to make the first change, but it’s probably just as easy to do it as two steps in the same workflow. You could also consider putting the first step in a custom event to make sure it completes before the second step, but I’m guessing that wouldn’t be necessary.

Hope this helps.

Best…
Mike

Hi @mikeloc
Thanks for your help, i understand excatly your instructions

thanks a lot

1 Like