I could use an assist on this. I can’t seem to write a patch that creates a new line in 'Subcontractor Buyout List' from information on 2 screens in my app.
This is what I’ve got for my submit button and it's supposed to update the existing subcontractor, or create a new one. But, it doesn’t do anything:
If(Screen2_SUBCONTRACTOR.Mode = New,
Patch('Subcontractor Buyout List', Defaults('Subcontractor Buyout List'),
Screen2_SUBCONTRACTOR.Updates,
Screen3_BUDGET.Updates
),
Patch('Subcontractor Buyout List', LookUp('Subcontractor Buyout List', 'Company Name'= 'Company Name_DataCard1_1'.Default),
Screen2_SUBCONTRACTOR.Updates,
Screen3_BUDGET.Updates
)
);
Notify("Selected Successfully",Success); RequestHide()
I’m getting a couple errors:
I’m not sure if I’m identifying the item correctly with the lookup. I'm a n00b at this. I attached the app itself if that helps.
Thanks for any help
Solved! Go to Solution.
Hi @CraigBarbieri ,
I think your issue is in the second Patch with the Default reference - with the below
If(
Screen2_SUBCONTRACTOR.Mode = New,
Patch(
'Subcontractor Buyout List',
Defaults('Subcontractor Buyout List'),
Screen2_SUBCONTRACTOR.Updates,
Screen3_BUDGET.Updates
),
Patch(
'Subcontractor Buyout List',
{'Company Name':'Company Name_DataCard1_1'.Selected.xxxx},
Screen2_SUBCONTRACTOR.Updates,
Screen3_BUDGET.Updates
)
);
Notify("Selected Successfully",Success);
RequestHide()
xxxx will be whatever the valid output of your drop-down / combo box is (Result / Value / Field name)
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.
Hi @CraigBarbieri ,
I think your issue is in the second Patch with the Default reference - with the below
If(
Screen2_SUBCONTRACTOR.Mode = New,
Patch(
'Subcontractor Buyout List',
Defaults('Subcontractor Buyout List'),
Screen2_SUBCONTRACTOR.Updates,
Screen3_BUDGET.Updates
),
Patch(
'Subcontractor Buyout List',
{'Company Name':'Company Name_DataCard1_1'.Selected.xxxx},
Screen2_SUBCONTRACTOR.Updates,
Screen3_BUDGET.Updates
)
);
Notify("Selected Successfully",Success);
RequestHide()
xxxx will be whatever the valid output of your drop-down / combo box is (Result / Value / Field name)
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.
Hi @CraigBarbieri ,
Just checking if you got the result you were looking for on this thread. Happy to help further if not.
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.
Thanks for the help. I've tried a bunch of options there and unfortunately I'm still getting "Invalid argument".
This is the latest code:
If(Screen2_SUBCONTRACTOR.Mode = New,
Patch('Subcontractor Buyout List', Defaults('Subcontractor Buyout List'),
Screen2_SUBCONTRACTOR.Updates,
Screen3_BUDGET.Updates
),
Patch('Subcontractor Buyout List', LookUp('Subcontractor Buyout List', 'Company Name'= 'Company Name_DataCard1_1'.Selected.Text),
Screen2_SUBCONTRACTOR.Updates,
Screen3_BUDGET.Updates
)
);
I've tried value, text, but am not clear on how to identify the ID in the lookup.