Exceptions and Requirement
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Exceptions and Requirement
Can somebody provide me an example of adding exceptions and requirements for an order?
-
- Posts: 91
- Joined: Wed Sep 10, 2008 3:33 pm
- Location: Raleigh, NC
- Contact:
Re: Exceptions and Requirement
Can you post what you have so far and let us know where you're having problems?
Melissa McBerkowitz
VP of Product Strategy, SoftPro
VP of Product Strategy, SoftPro
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Re: Exceptions and Requirement
I don't have much to share. I just want to open an order and then add exceptions and requirements to that order.
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Re: Exceptions and Requirement
Can you please provide a quick sample?
Re: Exceptions and Requirement
IOrder order;
dynamic title = order["Title"];
dynamic commitment = title.Commitments[0];
bool areRequirements = true;
dynamic reqExp = areRequirements ? order.CreateNew("Requirement"): order.CreateNew("Exception");
if (areRequirements)
{
commitment.Requirements.Add(reqExp);
}
else
{
commitment.Exceptions.Add(reqExp);
}
dynamic title = order["Title"];
dynamic commitment = title.Commitments[0];
bool areRequirements = true;
dynamic reqExp = areRequirements ? order.CreateNew("Requirement"): order.CreateNew("Exception");
if (areRequirements)
{
commitment.Requirements.Add(reqExp);
}
else
{
commitment.Exceptions.Add(reqExp);
}
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Re: Exceptions and Requirement
This is the error I get when I try to add an exception to the order.
"System.MemberAccessException: Cannot access member. at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) at ERprjNA2SPS_CPutData.ERmodNA2SPS_CPutData.UpdateOrderReqEx(IOrder&
spsOrder, Object& spsCommitment, XmlDocument& xmlMessage, String strType) in C:\SVO\SmartServiceBus\Adapters\NextAce\ERprjNA2SPS_CPutData\ERprjNA2SPS_CPutData\ERmodNA2SPS_CPutData.vb:line 275"
Here is the piece of code, I am using.
Dim ospsReqEx
ospsReqEx = DirectCast(spsOrder, IOrder).CreateNew("Exception")
ospsReqEx.text = strDesc
ospsReqEx.Code = GetNode(xmlNode, "Code", "")
spsCommitment.Exceptions.add(ospsReqEx)
"System.MemberAccessException: Cannot access member. at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) at ERprjNA2SPS_CPutData.ERmodNA2SPS_CPutData.UpdateOrderReqEx(IOrder&
spsOrder, Object& spsCommitment, XmlDocument& xmlMessage, String strType) in C:\SVO\SmartServiceBus\Adapters\NextAce\ERprjNA2SPS_CPutData\ERprjNA2SPS_CPutData\ERmodNA2SPS_CPutData.vb:line 275"
Here is the piece of code, I am using.
Dim ospsReqEx
ospsReqEx = DirectCast(spsOrder, IOrder).CreateNew("Exception")
ospsReqEx.text = strDesc
ospsReqEx.Code = GetNode(xmlNode, "Code", "")
spsCommitment.Exceptions.add(ospsReqEx)
Re: Exceptions and Requirement
In the code you have below, it should be ".Text"
try...
ospsReqEx.Text = strDesc
try...
ospsReqEx.Text = strDesc
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Re: Exceptions and Requirement
That didn't work. I even try after removing that line, I am still getting the same error message.
Re: Exceptions and Requirement
Can you share the code where you are getting this error message? line 275?
C:\SVO\SmartServiceBus\Adapters\NextAce\ERprjNA2SPS_CPutData\ERprjNA2SPS_CPutData\ERmodNA2SPS_CPutData.vb:line 275"
C:\SVO\SmartServiceBus\Adapters\NextAce\ERprjNA2SPS_CPutData\ERprjNA2SPS_CPutData\ERmodNA2SPS_CPutData.vb:line 275"
-
- Posts: 94
- Joined: Mon Dec 28, 2009 3:43 pm
Re: Exceptions and Requirement
When I add the requirement to the order.
spsCommitment.Exceptions.add(ospsReqEx)
Let me know if you need more information.
spsCommitment.Exceptions.add(ospsReqEx)
Let me know if you need more information.