Hi,
I've created an app and it's working fine but once I publish it the button for Patch function is not working!! Is there anything that I have to do to make the app working as it should be in the development stage?
You can find the code that I'm using for Submission.
Thank you all.
I followed each line and indeed one of them was causing this issue which is this line :
'Order ID': gID.Text,
I tried to make a variable for it to be like this :
Set(
orderid,
Text(
Upper (
Concatenate(
Left(
User().FullName,
2
),
"-",
Text(
varCurrentDateTime,
"hhmmss"
)
)
)
)
);
Then I replaced the old line with this new formula:
ForAll(
galCart.AllItems,
Patch(
'Abudawood''s Cafe 1',
Defaults('Abudawood''s Cafe 1'),
{
Quantity: Value(TextInput1.Text),
Drinks: ThisRecord.Item.Title,
'Office Number': dd3.Selected.Title,
'Office Zone': dd4.Selected.Title,
'User Name': usrNam.Text,
'Order ID': orderid,
'Date And Time ': Text(
Now(),
"mm/dd/yyyy hh:mm:ss"
)
}
)
);
Now the patch is working, I don't know why it wasn't work earlier but now it's okay.
Thank you.
When you click the patch button, is any data being patched back to your data source? If so, then the error might be in the later half of your code.
If data isn't being patched at all, try commenting out one line of the Patch code at a time until the Patch works to find where the error lies. Maybe there is something wrong with the way one of the fields is written for your data source. If the Patch works with some of the fields commented out, then you'll know that there was something wrong with that line of code.
Hi @fhamm ,
No there is no error message appears, It seems like nothing is happening and it should goes to another screen which contains the order reference after pressing the submit button.
Hi @ANB ,
there are no codes in the item property, Only to display the list content.
Is there a particular error message that is popping up when you try to push the button for the Patch function?
@kamel7777 Can you confirm what is the Items property of your gallery? Is there any specific code on item property, if yes, please share that too.
Thanks,
ANB
I'm not using Dataverse at all , Only Sharepoint list.
Answering your question that yes once I publish the application to try it before send it to other employees the patch button not working.
//Patch all records to Abudawood's Cafe 1 List
ForAll(
galCart.AllItems,
Patch(
'Abudawood''s Cafe 1',
Defaults('Abudawood''s Cafe 1'),
{
Quantity: Value(TextInput1.Text),
Drinks: ThisRecord.Item.Title,
'Office Number': dd3.Selected.Title,
'Office Zone':dd4.Selected.Title,
'Order ID': gID.Text,
'User Name': usrNam.Text,
'Date And Time ': Text( Now(), "mm/dd/yyyy hh:mm:ss" )
//'Order Ref': Value(gID.Text)
}
)
);
//Patch all records to Orders Report List
ForAll(
galCart.AllItems,
Patch(
'Orders Report',
Defaults('Orders Report'),
{
Quantity: Value(TextInput1.Text),
Drinks: ThisRecord.Item.Title,
'Office Number': dd3.Selected.Title,
'Office Zone': dd4.Selected.Title,
'Order ID': gID.Text,
'User Name': usrNam.Text,
'Date And Time ': Text( Now(), "mm/dd/yyyy hh:mm:ss" )
}
)
);
//Reset dropdown lists values
Reset(dd3);
Reset(dd4);
//clear cart box
Clear(colProductOrder);
Navigate(
ConfirmationScreen,
ScreenTransition.Fade
);
//ID generator variable
Set(varCurrentDateTime, Now());
You should double check your Patch function - If there is any error or required field set on Dataverse, you should include it on the patching.
I dont know if I got it right. It was working and after publishing it stopped ?
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional