aarong
(Aaron Gulley)
July 29, 2020, 10:16am
1
Good morning, afternoon which part of the globe you are!
I have a question for the veterans!
I have this Sales Order Entry, which I have customised by adding “Approve Order”, Order Status: Blank - I would like to click on the button for it to add “Approved” to the text box and auto print to a client printer and display a message saying it’s done with the order number
Do you know how I can do this?
I have created the UD Fields etc but now I’m stuck making that button bleedy work!
Any help at all guys would be awesome.
Kind regards,
Aaron.
Arul
(Arul Shankar)
July 29, 2020, 10:21am
2
Use Auto-Print Ready field for that purpose instead of UD field.
aarong
(Aaron Gulley)
July 29, 2020, 10:22am
3
Only reason I’m using an UD field I need to use that information in a BAQ/Dashboard later on.
The “Approved” status of that box…
aarong
(Aaron Gulley)
July 30, 2020, 9:03am
4
Anyone able to help me to get this button to fire a BPM?
Arul
(Arul Shankar)
July 30, 2020, 9:52am
5
On button click event add below code:
EpiDataView edvOrderHed = ((EpiDataView)(this.oTrans.EpiDataViews[“OrderHed”]));
if (edvOrderHed != null)
{
edvOrderHed.dataView.Table.Rows[0][“FieldName”] = value ;
oTrans.Update() ;
}
aarong
(Aaron Gulley)
July 30, 2020, 12:35pm
6
Hi Arul,
I’m getting this
----------errors and warnings------------
Error: CS1056 - line 85 (979) - Unexpected character ‘“’
Error: CS1056 - line 85 (979) - Unexpected character ‘”’
Error: CS1056 - line 88 (982) - Unexpected character ‘“’
Error: CS1056 - line 88 (982) - Unexpected character ‘”’
** Compile Failed. **
private void btnApprove_Click(object sender, System.EventArgs args)
{
EpiDataView edvOrderHed = ((EpiDataView)(this.oTrans.EpiDataViews[“OrderHed”]));
if (edvOrderHed != null)
{
edvOrderHed.dataView.Table.Rows[0][“OrderHed.Approved_c”] = Approved ;
oTrans.Update() ;
}
}
}
Copy-paste error. Remove the “fancy quotes” and replace with straight quotes from your keyboard.
aarong
(Aaron Gulley)
July 30, 2020, 12:54pm
8
Mark_Wonsil:
straight quotes
Straight single or straight double Mark?
aarong
(Aaron Gulley)
July 30, 2020, 1:20pm
10
aarong:
OrderHed.Approved_c
Now I’m getting this
Compiling Custom Code …
----------errors and warnings------------
Error: CS0103 - line 74 (1036) - The name ‘value’ does not exist in the current context
** Compile Failed. **
This customisation stuff isn’t easy!
private void btnApprove_c_Click(object sender, System.EventArgs args)
{
EpiDataView edvOrderHed = ((EpiDataView)(this.oTrans.EpiDataViews["OrderHed"]));
if (edvOrderHed != null)
{
edvOrderHed.dataView.Table.Rows[0]["OrderHed_UD.Approved_c"] = value ;
oTrans.Update() ;
}
}
OK, it is saying you want to assign your Approved_c to the value of a variable called value but you never declared it. What do you want to assign to that variable? If it’s a boolean then true or false, if an integer then 0 or 1, etc.
aarong
(Aaron Gulley)
July 30, 2020, 1:34pm
12
Hi Mark,
I would like it simply to put Approved in that box
A string? If so, just replace value with “Approved” and you should be good to go.
aarong
(Aaron Gulley)
July 30, 2020, 1:36pm
14
Compiling Custom Code …
----------errors and warnings------------
Error: CS0103 - line 74 (1036) - The name ‘Approved’ does not exist in the current context
** Compile Failed. **
Just wanna cry haha!
jdtrent
(Joe D Trent)
July 30, 2020, 1:39pm
15
Put quote marks around Approved. Without quotes it’s looking for a variable named “Approved.”
Joe
And use straight quotes and not the “fancy” ones.
aarong
(Aaron Gulley)
July 30, 2020, 1:44pm
17
Compiling Custom Code …
** Custom Code Compiled Successfully. **
But the text box doesn’t update with the words “Approved” what I am I doing wrong?
I really appreciate all of your help, it’s been annoying for two days now.
aarong
(Aaron Gulley)
July 30, 2020, 1:46pm
18
This what I’ve got going on
And your textbox has it EpiBinding set to your field? (Look at the properties of the Textbox in your customizations)
josecgomez
(Jose C Gomez)
July 30, 2020, 1:51pm
20
try
edvOrderHed.dataView[edvOrderHed.Row].BeginEdit();
edvOrderHed.dataView[edvOrderHed.Row]["Approved_c"]="Approved";
edvOrderHed.dataView[edvOrderHed.Row].EndEdit();