I'm trying to build a macro that will delete a menu item from a previous round - the caveat is that the employee does not have the right to do this, and I want to authorize that operation as part of the macro.
The menu item is a placeholder for some other stuff, and the larger objective is to replace it (in reality replace its reference, if anyone has an idea to do that).
Locating the detail and determining if the employee has rights or not is already in place, the question is why Simphony still prompts for prev void round auth...
The Invoke method in the bottom is just a helper method to ensure that we execute on the right thread.
I have not tried to build the macro on the page design, but I assume the result will be the same.
Any ideas?
The menu item is a placeholder for some other stuff, and the larger objective is to replace it (in reality replace its reference, if anyone has an idea to do that).
Locating the detail and determining if the employee has rights or not is already in place, the question is why Simphony still prompts for prev void round auth...
Code:
public void DeleteDetail(int detailLink, int reason, int auth)
{
var commands = new List<OpsCommand>
{
new OpsCommand {Command = OpsCommandType.DetailSelected, Number = detailLink},
new OpsCommand {Command = OpsCommandType.Void},
new OpsCommand {Command = OpsCommandType.EnterKey},
};
if (auth != 0)
{
commands.Add(new OpsCommand { Command = OpsCommandType.AsciiData, Text = auth.ToString() });
commands.Add(new OpsCommand { Command = OpsCommandType.EnterKey });
}
if (reason != 0)
{
commands.Add(new OpsCommand { Command = OpsCommandType.AsciiData, Text = reason.ToString() });
commands.Add(new OpsCommand { Command = OpsCommandType.EnterKey });
}
Invoke(() => OpsContext.ProcessCommand(new OpsCommand { Command = OpsCommandType.Macro, Data = commands }));
}
The Invoke method in the bottom is just a helper method to ensure that we execute on the right thread.
Code:
protected void Invoke(Action a)
{
OpsContext.InvokeOnCommandThread(delegate
{
a.Invoke();
return null;
}, null);
}
I have not tried to build the macro on the page design, but I assume the result will be the same.
Any ideas?