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

Leave Enrollments record cannot be created

Hi all,

I'm building a PowerApp, and part of it requires a Leave Enrollment record to be made and associated to a Worker record. Unfortunately, I'm having trouble creating it.

Using SubmitForm('FormName') doesn't actually create a record or return any errors, it just fires OnSuccess and does nothing.

I tried using the Patch function instead, but ran into a strange issue - it told me the issue was the fact that the 'Accrual Frequency' field isn't part of the record I'm creating (even though according to documentation, there is no 'Accrual Frequency' field in the Leave Enrollment entity). I created a custom Option Set and field to compensate, but then when I attempted to include it in the Patch function it informed me that the column does not exist.

Screenshot of the errors shown when hovering over the Patch function.Screenshot of the errors shown when hovering over the Patch function.Not sure where to go from here, so I'm looking for any suggestions. Is this an issue with the environment?

Thanks in advance!

 

Kind regards,

Ciara Lynch

5 REPLIES 5
Highlighted
Community Support
Community Support

Re: Leave Enrollments record cannot be created

Hi @CiaraL ,

 

To better understand your issue:

1. Do you mean the type of 'Accrual Frequency' field is Option set?

2. It seems that you use combo box(or dropdown) to select 'Accrual Frequency' , right? Can you share the items property of it?

3. Are all these errors related to Accrual Frequency' field?

 

I have made a test on my side, please refer to my example:

If you use a combo box to select 'Accrual Frequency', the items property of combo box should be:

Choices('Leave Enrollment'. 'Accrual Frequency' )

And modify that part of formula as below

'Leave Enrollment':customAccrualFrequencyValue.Selected.Value,

Please have a try and check if your issue is fixed.

Best regards,

Sik

If this post helps, then please click on “Accept as Solution” to help the other members find it more quickly.

 

Highlighted
Frequent Visitor

Re: Leave Enrollments record cannot be created

Hi Sik,

 

1. Yes, the type of the 'Accrual Frequency' field is an Option Set.

2. Yes, I created an Option Set and accompanying field (called 'Custom Accrual Frequency'), here is an image of the items property:

items.PNG

3. I believe there was an issue with the way I was setting up the Leave Plan field value I was submitting. I changed the formula to 'Accrual Frequency': customAccrualFrequencyValue.Selected.Value, and the remaining errors are that the Accrual Frequency column doesn't exist and that the function 'Patch' has some invalid arguments.

 

When I remove the Accrual Frequency part from the Patch function, the errors disappear, but unfortunately the record still isn't being made when I test the app. 

There could be an issue with the 'Leave Plan' part of the formula, as I'm using a LookUp function to try and return a Leave Plan ID.

> 'Leave Plan': LookUp('Leave Plans', Name in leavePlanValue.Selected.Name)

 

Thank you for your response!

 

Kind regards,

Ciara

Highlighted
Community Support
Community Support

Re: Leave Enrollments record cannot be created

Hi @CiaraL ,

 

It is really weird that the system always can't find the column. Have you ever changed name 'Accrual Frequency' field? Can you go to check the Name of field in Entity -Field, and use Name instead of display name in formula?

Annotation 2019-10-28 104731.png

To your 'Leave Plan' part of formula, if possible, i think you can also delete the that part to check if the lookup makes error . If it is true that there is something wrong with the lookup function, please share more details, e.g. field type, related controls.

Best regards,

Sik

Highlighted
Frequent Visitor

Re: Leave Enrollments record cannot be created

Hi Sik,

 

I did a bit more digging into the problem last Friday, and found that after some changes to the formula I was able to actually make records. I found them using PowerBI, and they seem to be the same record (same Leave Enrollment Number). I've inserted an image of what I patch as part of creating the Leave Enrollment record, and the resulting records in PowerBI.

create.PNG

powerbi.PNG

I use this formula to find the last Leave Enrollment Number and increment the number part by 1, could this be the issue?

 

Concatenate("LEAVEENROLL000",(Text(Value(Substitute(Last('Leave Enrollments').LeaveEnrollmentNumber, "LEAVEENROLL",""))+1)))

 

Thanks,

Ciara

Highlighted
Frequent Visitor

Re: Leave Enrollments record cannot be created

I forgot to add that these records aren't being pushed to Talent, so the Worker is never actually assigned to the specified Leave Type.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (3,704)