cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
koolsin
Frequent Visitor

my toggle Can't lock

if Someone Lock Job , the other can't get this job  but my Toggle can't Lock

if(IsBlank(LookUp(EBAN_Access_DB,ชื่อ=job_1).ITID_NameJob), DisplayMode.Edit, Office365Users.MyProfileV2().displayName=LookUp(EBAN_Access_DB,ชื่อ=job_1).ITID_NameJob, DisplayMode.Edit, !(Office365Users.MyProfileV2().displayName=LookUp(EBAN_Access_DB,ชื่อ=job_1).ITID_NameJob), DisplayMode.View)

Please Help me and thank Advance

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @koolsin ,

Are you wanting to "lock" a record? If so you need to know who locked it otherwise Mr A cannot edit the record either.

How are you recording who is doing the job (have you got something like the value of the user's name in a field)?

View solution in original post

Thank you for your Code ,  my new world for me

I use 

Disablemode.diable  substitute Disablemode.view.

It ' work , the Other can't uncheck this toggle .  i don't know why microsoft make Toggle Control different from Other Control. it' s make me confuse a little.   

i still wanna thank you very much , WarrenBelz   


View solution in original post

6 REPLIES 6
WarrenBelz
Super User III
Super User III

Hi @koolsin ,

I this what you are looking for?

With(
   {
      wAccess:
      LookUp(
         EBAN_Access_DB,
          ชื่อ=job_1
      ).ITID_NameJob
   },
   If(
      IsBlank(wAccess) || wAccess=User().FullName,
      DisplayMode.Edit,
      DisplayMode.View
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thank WarenBelz

My point is my toggle , whatever displaymode.edit or displaymode.view .....

it's not lock for my job (the other can't edit my toggle) 

i think   displayMode.view     is fail 

(i try separate case to one to one  for checking case   But Your Code is Great...  Thank for New Knowledges  ) 

@koolsin ,

You have not explained what field and/or control is on the toggle and what/when exactly is it supposed to lock.

Thank WarrenBelz

"Reserve Job " Process is
First  , Mr. A  come in to PowerApps   then toggle OnCheck ( write  Mr. A  to SharePoint List in field  "ITID_NameJob" and  "yes" in Field "Doing_Job" )
Then ,  Mr. B  can't change Toggle (and Other Object )
but if Mr.A   Done  he Toggle OnUnCheck (Write "No" in Field "Doing_Job")    
Then Mr.B can change Toggle (And Other Object

Remark I think DisplayMode.View is Not work for Toggle

Please Help me WarrenBelz

Hi @koolsin ,

Are you wanting to "lock" a record? If so you need to know who locked it otherwise Mr A cannot edit the record either.

How are you recording who is doing the job (have you got something like the value of the user's name in a field)?

View solution in original post

Thank you for your Code ,  my new world for me

I use 

Disablemode.diable  substitute Disablemode.view.

It ' work , the Other can't uncheck this toggle .  i don't know why microsoft make Toggle Control different from Other Control. it' s make me confuse a little.   

i still wanna thank you very much , WarrenBelz   


View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,449)