At a quick glance, I see some issues with your ordering.
The order of the code I posted isnt important, it’s the order of the indexes [x] that count
TotalQty AND QtyPer are the same param idx 2 (the third item)
TagFormat is idx 3 (the 4th item)
Revision is idx 4 (the 5th item)
UOM is idx 5 (the 6th item)
I’d start by making it more clear, take the code I posted and trim it down so it looks like:
Yep, the display of my string looks perfect. But the form is still griping about me putting data into the wrong field. That’s what I don’t understand. For example, the latest error says "can’t store [the uom] in the VendorNum column. However, I have the UOM stored in the 5th array spot. And VendorNum is in the 12th array spot. I don’t understand what it’s doing.
Yes! That’s it exactly. The MtlTags form didn’t know I wanted to act like I was calling it from the End Activity form. Thank you for that!
Next issue is that this line of code:
launchObject.WhoAmI = “Erp.UI.EndActivityEntry”;
…gives me this error:
‘Ice.Lib.Framework.LaunchFormOptions’ does not contain a definition for ‘WhoAmI’ and no extension method ‘WhoAmI’ accepting a first argument of type ‘Ice.Lib.Framework.LaunchFormOptions’ could be found (are you missing a using directive or an assembly reference?)
…not sure if the .WhoAmI property doesn’t exist or if I really need some type of custom assembly ref added.
Ideas?
//this will NOT be in a method
public class Hack:ILaunch
{
public string WhoAmI
{
get {return “Erp.UI.EndActivityEntry”;}
}
public object Session
{
get {return "Nothing, dont return a damn thing";}
}
}
//in your method, BEFORE sending lfo to form
Hack hacky = new Hack();
LaunchFormOpts.Sender = hacky;
Chris-
Neither way seems to be firing. No new errors… the MtlTags form thinks it’s still being called from UD39 instead of End Activity. Maybe I’m not placing the code in the right place? I put the “FormImpersonator hacky…” line right before my call to the MtlTag form. Then I tried to move the entire “public class FormImpersonator:ILaunch…” code snip above the “public class Script” statement and also after the “public class Script” (but before my actual method).
Apologies for some of my newbie-type questions in here. I’m learning C# on the fly.
Any other ideas for me?
Thanks! -Sharla
(Correction)
I dont know how you are passing the lfo. Probably need to do something like:
//create our hack
Hack hacky = new Hack();
//create an LFO
var lfo = new LaunchFormOptions();
lfo.Sender = hacky; //set the sender
string currentVal = getParametersForMtlTags();
lfo.ValueIn = currentVal; //the actual data
ProcessCaller.LaunchForm(oTrans, “Erp.UIRpt.MtlTags”,lfo); //pass the lfo
}
Chris-
Yes, that’s basically how I was calling the form and passing the params.
Here’s (the important parts of) my current code. It still thinks I’m calling it from UD39 form (which I am) instead of faking that it’s from End Activity. Do you see anything wrong below?
Thanks, Sharla
//using statements…
public class Hack:ILaunch
{
public string WhoAmI
{
get {return “Erp.UI.EndActivityEntry”;}
}
public object Session
{
get {return "Nothing, dont return a damn thing";}
}
No, I’m basing my conclusion on the fact that I still get the error below (like it’s being called from PO Receipt with the expected parameters in a different sequence). So, it must still think I’m still calling it from UD39.
Are you able to pass a JobNum in your parameters and have it show on the Material Tag “report”? I see it’s blank in your screenshot.
Hi Chris.
When I changed the line: ProcessCaller.LaunchForm(hacky, “Erp.UIRpt.MtlTags”,lfo); //to pass hacky instead of oTrans
…then I got the following 2 errors one right after the other:
Here’s my code around the call. Do you see anything else out of place?
Thanks, Sharla