The following code below will create a Master record.
What I need:
I need to create a "detail" record using the ID created in the patch statement below.(from master)
The detail table is called "t_pricing_escalation_detail"
The foreign field is "RBP_MASTER_ID"
Set(MyRecord,
Patch(t_pricing_escalation_master,Defaults(t_pricing_escalation_master),
{
ESCALATION_CREATED_BY: User().FullName,
QS_RACFID: txt_QS_RACFID.Text
}
)
)
Thanks
Dave
You're storing the patch results in your MyRecord variable. This will have all of the information you need for you other patch.
Patch(t_pricing_escalation_detail, Defaults(t_pricing_escalation_detail),
{RBP_MASTER_ID: MyRecord.ID}
)
Will give you a new record with the master record ID in the RBP_MASTER_ID column.
I hope this is helpful for you.
randy, getting this error ?
Both fields are INT in sql server.
Set(MyRecord,
Patch('[dbo].[t_redbook_pricing_escalation_master]',Defaults('[dbo].[t_redbook_pricing_escalation_master]'),
{
ESCALATION_CREATED_BY: User().FullName,
QS_RACFID: txt_QS_RACFID.Text
}
)
)
;
Patch('[dbo].[t_redbook_pricing_escalation_detail]', Defaults('[dbo].[t_redbook_pricing_escalation_detail]'),
{
RBP_MASTER_ID: MyRecord.PRICING_ESCALATION_ID
}
)
If you're getting a "found type error", then something else is at play.
I would take the formula in error out for the moment and then look at the variable you are setting (MyRecord) to see what is in that column PRICING_ESCALATION_ID
This is a primary key AUTONUMBER field. PRICING_ESCALATION_ID
User | Count |
---|---|
256 | |
106 | |
92 | |
47 | |
37 |