We are working on a Data Directive BPM on the OrderHed Table using (In Transaction)
What we want to do is when the orderHed.Checkbox02 is checked or unchecked in Company TGU it will update the OrderHed.Checkbox01 field in the GNC company.
The criteria for linking is stripping some characters off the end of the PO in TGU company and then linking that value to the OrderNum in the GNC company.
We have worked out code to strip the characters off the PO but too poor in the C# world to put it together. Here is the code Convert.ToInt32(ttOrderHedRow.PONum.Remove (ttOrderHedRow.PONum .Length -4,4))
We have also attached the starting BPM located in the TGU company.export.bpm (27.0 KB)
Hereâs a post showing how to directly update a UD field in a DB. Youâd want to tweak it so that the Company being referenced is the target company, and not the ClientContext.CurrentCompany
Yours would be something like:
Int32 oNum = Convert.ToInt32(ttOrderHedRow.PONum.Remove (ttOrderHedRow.PONum .Length -4,4));
// probably want to check that oNum has a non-zero value before doing the following
Db.OrderHed.Where( r =>r.Company == 'GNC' && r.OrderNum==oNum).FirstOrDefault().Checkbox01=1; // maybe "= true;"
Db.Validate();
I am getting an error of âToo many characters in Character Literalâ. The MyOrder and MyPrepared are variables I have set in the BPM prior to the custom code.