Customisation Support

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.

Use Auto-Print Ready field for that purpose instead of UD field.

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… :confused:

Anyone able to help me to get this button to fire a BPM?

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() ;
}

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.

Straight single or straight double Mark?

I’d use double.

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.

Hi Mark,

I would like it simply to put Approved in that box :confused:

A string? If so, just replace value with “Approved” and you should be good to go.

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! :smiley:

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.

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.

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)

try

edvOrderHed.dataView[edvOrderHed.Row].BeginEdit();
edvOrderHed.dataView[edvOrderHed.Row]["Approved_c"]="Approved";
edvOrderHed.dataView[edvOrderHed.Row].EndEdit();