cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rkaur
Level: Powered On

Re: Patch records from child gallery to parent entity record. Related child entity added as a subgrid in parent entity form

Hi Kris,

Is the logic of using display names under Patch function only for CDS entities or in general ?

it works now with a warning message at "TaskName.Text" stating it may not work with large data sets.

 

and as you may have seen teh screen shot of my custom entity. Job card is a lookup to Case entity. so i have passed caseid to it. you may notice simple 'Cases' was not being shown in green so i used teh same way to display datasource [@'Cases']. I hope this is correct ?

 

plz see the  attachment.for all with [] and display names.png

 

ON clicking Save patch isnt still happening possiby coz of warning msg. Plz suggest How to avoid it ?

 

 

Fotr the second option, i changed my collection also to usee display names instaed of logical names but now the warning message changed to "The specified column 'Completed' doesn't exist. 

Collect(
JobTasks,
{
'Completed': If(Checkbox3.Value=true,'Completed (Service Tasks)'.Yes,'Completed (Service Tasks)'.No),
'Task Type': TaskName.Text,
'Job Card': _varCaseId
}
)

- i tried by putting COmpleted under single quotes too

- also tried to pass value to it in teh same fashion as we are doing in option 1 since its a two option set attribute

'Completed': If(Checkbox3.Value=true,'Completed (Service Tasks)'.Yes,'Completed (Service Tasks)'.No),

 

still same warning message.

Kindly help.

Rkaur
Level: Powered On

Re: Patch records from child gallery to parent entity record. Related child entity added as a subgrid in parent entity form

HI,

 

Any help on the warning message please ?

this delegation warning is not allowing the PATCH to happen.  

Community Support Team
Community Support Team

Re: Patch records from child gallery to parent entity record. Related child entity added as a subgrid in parent entity form

Hi @Rkaur ,

Could you please share a bit more about the "TaskName" you mentioned in your formula?

Based on the formula you provided, I think there is something issue with it. You have missed a '}' symbol within your Patch formula.

ForAll(
         ChecklistGallery.AllItems,
         Patch(                           
                  [@'Service Tasks'],            
                   Defaults([@'Service Tasks']),    
                   {
                      Completed: If(CheckBox3.Value = true, 'xyz_completed (EntityName)'.Yes, 'xyz_completed (EntityName)'.No),
'Task Type': LookUp(TaskNameEntity, 'Primary Name' = TaskName.Text),
'Job Card': LookUp(CaseEntity, 'Case Title' = BrowseGallery1.Selected.'Case Title') } /* <-- Please do not miss the '}' sumbol here on your side */ ) )

 

For the Delegation warning, if the amount of your 'Service Task Types' Entity records is not more than 2000 records, you could ignore this warning issue.

 

For your second issue, there is something wrong with your Collect formula, please modify it as below:

Collect(
         JobTasks,
         {
            Completed: If(Checkbox3.Value=true,'Completed (Service Tasks)'.Yes,'Completed (Service Tasks)'.No),  /* <-- Completed column should not be wrapped with single quote (''). Please type Completed rather than 'Completed' */
           'Task Type': TaskName.Text,
           'Job Card': _varCaseId
         }
)

Note: If there is a space within your field name (e.g. 'Task Type', 'Job Card', ...), when you reference it, please wrap it with a single quote (''). If there is no space within your field name, do not wrap it with single quote ('').

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Rkaur
Level: Powered On

Re: Patch records from child gallery to parent entity record. Related child entity added as a subgrid in parent entity form

Hi Kris,

 

Thankyou so much for helping out here.

and for identifying the missed "}" curly bracket.

Im able to successfuly push teh records to CRM with PATCH. 

With Collection option, i tried putting my column "Completed" within single quotes and without it also. as mentioned above but probably needs to be checked more not sure whats wrong.

Rkaur
Level: Powered On

Re: Patch records from child gallery to parent entity record. Related child entity added as a subgrid in parent entity form

Hi @v-xida-msft 

can you please help me understand one thing. i moved my app onto another environment (CDS) but here the same Patch function is now only referencing the last selected item in the gallery when looping. and prints that record n number of times ( n is the gallery count)

However there is one change, in order to access my gallery item now, without the disambiguate operator it dosnt refrence it.

ANy thoughts here ?

@ operator.PNG

Highlighted
Rkaur
Level: Powered On

Re: Patch records from child gallery to parent entity record. Related child entity added as a subgrid in parent entity form

Any help please.

Im really stuck with the function not working. The same Patch logic is being used at some other place also in the app where again same problem is caused. Last selected item in the gallery is being patched n number of times in the datasource  ( N is the count of rows in gallery)

Seems like disambiguate operator has been causing it, as this is the only change in my function, between the two environments where my app is running.

Without "@" my gallery item isnt being referenced only. It doesnt highlight

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 108 members 4,190 guests
Please welcome our newest community members: