Method Directive to Prevent User from Posting

This worked perfect! Putting it back together here's the code:

Find First GLJrnGrp Where GLJrnGrp.Company = Cur-Comp
And GlJrnGrp.GroupID = groupID
No-lock No-Error.

IF DCD-UserID = GLJrnGrp.CreatedBy
Then DO:

define variable body as character no-undo.


define variable body_cnt as integer no-undo.
assign body = body + 'This GJ journal group was created by you. Groups are not allowed to be posted by the created. Another user willl need to review and post this group.~n~nThank You.'.

{lib/PublishEx.i &ExMsg = body
&ExType = {&MESSAGE_ERR}
}

End.

--- In vantage@yahoogroups.com, "netrippers" <osen.tom@...> wrote:
>
> Bruce,
>
> Finally got back to this. You need to do 2 things.
>
> 1) You need to put some other system defined condition to go along with your advanced code. Without this the custom code wasn't being written to the .p. So the custom code never fired. This may be a bug at my level 9.05.701
> 2) You need to fire of the error message in the custom code.
>
> Then Do:
> define variable body as character no-undo.
>
>
> define variable body_cnt as integer no-undo.
> assign body = body + 'This GJ journal group was created by you. Groups are not allowed to be posted by the created. Another user willl need to review and post this group.~n~nThank You.~n~nEpiocr 9'.
>
>
> {lib/PublishEx.i &ExMsg = body
> &ExType = {&MESSAGE_ERR}
>
> }
>
>
>
>
>
> --- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@> wrote:
> >
> > I'm still at a loss with this. All of the code I've tried always denies posting whether the DCD-UserID is the same or not. How can I verify what it is being compared to, whether it be the entire GLJrnGrp table or the single currently opened record trying to be posted?
> >
> > I have the Epicor training manuals on BPM but they are very lacking in detail. Is there somewhere else I can study to figure this out?
> >
> > Thanks again!
> >
> > --- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@> wrote:
> > >
> > > I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
> > >
> > > For the condition (custom) I have:
> > >
> > > for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
> > >
> > > Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
> > >
> > > I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
> > >
> > > Thanks!
> > >
> >
>
I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.

For the condition (custom) I have:

for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.

Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.

I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.

Thanks!
Bruce,

The problem with your condition is that it is looking at all of the GLJrnGrp records that have ever existed that have a user ID that matches the created by. I think you just need to add an extra filter in there so that it is only looking at the group that is attempting to be posted. Something like:

for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy AND GLJrnGrp.GroupID = {postGroupID}.

If you want to spit out debugging data what I normally do is create an ABL action and use the MESSAGE statement to send debugging data out to the log. For example, for this scenario:

for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy AND GLJrnGrp.GroupID = {postGroupID} no-lock.
message "debugging lines for posting BPM:".
message DCD-UserID.
message GLJrnGrp.CreatedBy.
end.

Then just go to your appserver log and you will see the output. You can also make them pop-ups instead but it is a bit more work. You end up using something like this:

{lib/PublishInfoMsg.i &InfoMsg = "'User ID Is' + DCD-UserID"}.

Hope this helps!
Adam

--- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@...> wrote:
>
> I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
>
> For the condition (custom) I have:
>
> for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
>
> Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
>
> I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
>
> Thanks!
>
Bruce,

Here is the code you need for your advance code. I just happen to be creating this same code. You should put this on the CheckBeforePost method. That way the users can use either posting method.

Find First GLJrnGrp Where GLJrnGrp.Company EQ Cur-Comp
And GlJrnGrp.GroupID = groupID
No-lock No-Error.

IF DCD-UserID = GLJrnGrp.CreatedBy
Then DO:

{&CALL_DESIGNED_CONDITIONS}

End.


Tom



--- In vantage@yahoogroups.com, "saberlogic_aellis" <aellis@...> wrote:
>
> Bruce,
>
> The problem with your condition is that it is looking at all of the GLJrnGrp records that have ever existed that have a user ID that matches the created by. I think you just need to add an extra filter in there so that it is only looking at the group that is attempting to be posted. Something like:
>
> for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy AND GLJrnGrp.GroupID = {postGroupID}.
>
> If you want to spit out debugging data what I normally do is create an ABL action and use the MESSAGE statement to send debugging data out to the log. For example, for this scenario:
>
> for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy AND GLJrnGrp.GroupID = {postGroupID} no-lock.
> message "debugging lines for posting BPM:".
> message DCD-UserID.
> message GLJrnGrp.CreatedBy.
> end.
>
> Then just go to your appserver log and you will see the output. You can also make them pop-ups instead but it is a bit more work. You end up using something like this:
>
> {lib/PublishInfoMsg.i &InfoMsg = "'User ID Is' + DCD-UserID"}.
>
> Hope this helps!
> Adam
>
> --- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@> wrote:
> >
> > I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
> >
> > For the condition (custom) I have:
> >
> > for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
> >
> > Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
> >
> > I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
> >
> > Thanks!
> >
>
All groups, that makes sense. I tried this code but {postGroupID} gives an error: "PostGroupID" was not found. When I remove the {} and "post" the code runs but still yields the same result. Nobody can post anything.

--- In vantage@yahoogroups.com, "saberlogic_aellis" <aellis@...> wrote:
>
> Bruce,
>
> The problem with your condition is that it is looking at all of the GLJrnGrp records that have ever existed that have a user ID that matches the created by. I think you just need to add an extra filter in there so that it is only looking at the group that is attempting to be posted. Something like:
>
> for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy AND GLJrnGrp.GroupID = {postGroupID}.
>
> If you want to spit out debugging data what I normally do is create an ABL action and use the MESSAGE statement to send debugging data out to the log. For example, for this scenario:
>
> for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy AND GLJrnGrp.GroupID = {postGroupID} no-lock.
> message "debugging lines for posting BPM:".
> message DCD-UserID.
> message GLJrnGrp.CreatedBy.
> end.
>
> Then just go to your appserver log and you will see the output. You can also make them pop-ups instead but it is a bit more work. You end up using something like this:
>
> {lib/PublishInfoMsg.i &InfoMsg = "'User ID Is' + DCD-UserID"}.
>
> Hope this helps!
> Adam
>
> --- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@> wrote:
> >
> > I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
> >
> > For the condition (custom) I have:
> >
> > for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
> >
> > Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
> >
> > I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
> >
> > Thanks!
> >
>
This code runs without error but the result is the same, no users can post any groups. Also, I tried to use the CheckBeforePost method but it does not exist under GLJrnGrp. Maybe that's something from E9?

--- In vantage@yahoogroups.com, "netrippers" <osen.tom@...> wrote:
>
> Bruce,
>
> Here is the code you need for your advance code. I just happen to be creating this same code. You should put this on the CheckBeforePost method. That way the users can use either posting method.
>
> Find First GLJrnGrp Where GLJrnGrp.Company EQ Cur-Comp
> And GlJrnGrp.GroupID = groupID
> No-lock No-Error.
>
> IF DCD-UserID = GLJrnGrp.CreatedBy
> Then DO:
>
> {&CALL_DESIGNED_CONDITIONS}
>
> End.
>
>
> Tom
>
>
>
> --- In vantage@yahoogroups.com, "saberlogic_aellis" <aellis@> wrote:
> >
> > Bruce,
> >
> > The problem with your condition is that it is looking at all of the GLJrnGrp records that have ever existed that have a user ID that matches the created by. I think you just need to add an extra filter in there so that it is only looking at the group that is attempting to be posted. Something like:
> >
> > for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy AND GLJrnGrp.GroupID = {postGroupID}.
> >
> > If you want to spit out debugging data what I normally do is create an ABL action and use the MESSAGE statement to send debugging data out to the log. For example, for this scenario:
> >
> > for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy AND GLJrnGrp.GroupID = {postGroupID} no-lock.
> > message "debugging lines for posting BPM:".
> > message DCD-UserID.
> > message GLJrnGrp.CreatedBy.
> > end.
> >
> > Then just go to your appserver log and you will see the output. You can also make them pop-ups instead but it is a bit more work. You end up using something like this:
> >
> > {lib/PublishInfoMsg.i &InfoMsg = "'User ID Is' + DCD-UserID"}.
> >
> > Hope this helps!
> > Adam
> >
> > --- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@> wrote:
> > >
> > > I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
> > >
> > > For the condition (custom) I have:
> > >
> > > for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
> > >
> > > Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
> > >
> > > I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
> > >
> > > Thanks!
> > >
> >
>
I'm still at a loss with this. All of the code I've tried always denies posting whether the DCD-UserID is the same or not. How can I verify what it is being compared to, whether it be the entire GLJrnGrp table or the single currently opened record trying to be posted?

I have the Epicor training manuals on BPM but they are very lacking in detail. Is there somewhere else I can study to figure this out?

Thanks again!

--- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@...> wrote:
>
> I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
>
> For the condition (custom) I have:
>
> for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
>
> Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
>
> I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
>
> Thanks!
>
In the forums here there is a helpful ABL command that will display a messagebox. Use them liberally to see what is happening. Put one at the beginning to make sure the BPM is even getting triggered. Add a second that shows you the DCD-UserID value. Add a third that shows you the GLJrnGrp.CreatedBy.

As ABL does not allow line by line debugging you can use these message boxes to see what is going on.

{lib/Publishinfomsg.i &InfoMsg = YOURVARIABLEGOESHERE }.

Tom Christie | Information Technology Manager | AGM Container Controls, Inc. | tchristie@...<mailto:tchristie@...> | t: 520.881.2130 ext 2176

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of brucewbrannan
Sent: Wednesday, March 27, 2013 7:14 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Method Directive to Prevent User from Posting



I'm still at a loss with this. All of the code I've tried always denies posting whether the DCD-UserID is the same or not. How can I verify what it is being compared to, whether it be the entire GLJrnGrp table or the single currently opened record trying to be posted?

I have the Epicor training manuals on BPM but they are very lacking in detail. Is there somewhere else I can study to figure this out?

Thanks again!

--- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, "brucewbrannan" <bruce.brannan@...<mailto:bruce.brannan@...>> wrote:
>
> I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
>
> For the condition (custom) I have:
>
> for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
>
> Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
>
> I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
>
> Thanks!
>



[Non-text portions of this message have been removed]
Wouldn't you want to use the ttGLJrnGrp to only compare on the current record as opposed to the entire GLJrnGrp table? There would most always be a true statement in that case.

Brenda

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of brucewbrannan
Sent: Wednesday, March 27, 2013 10:14 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Method Directive to Prevent User from Posting



I'm still at a loss with this. All of the code I've tried always denies posting whether the DCD-UserID is the same or not. How can I verify what it is being compared to, whether it be the entire GLJrnGrp table or the single currently opened record trying to be posted?

I have the Epicor training manuals on BPM but they are very lacking in detail. Is there somewhere else I can study to figure this out?

Thanks again!

--- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, "brucewbrannan" <bruce.brannan@...<mailto:bruce.brannan@...>> wrote:
>
> I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
>
> For the condition (custom) I have:
>
> for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
>
> Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
>
> I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
>
> Thanks!
>



[Non-text portions of this message have been removed]
Bruce,

Finally got back to this. You need to do 2 things.

1) You need to put some other system defined condition to go along with your advanced code. Without this the custom code wasn't being written to the .p. So the custom code never fired. This may be a bug at my level 9.05.701
2) You need to fire of the error message in the custom code.

Then Do:
define variable body as character no-undo.


define variable body_cnt as integer no-undo.
assign body = body + 'This GJ journal group was created by you. Groups are not allowed to be posted by the created. Another user willl need to review and post this group.~n~nThank You.~n~nEpiocr 9'.


{lib/PublishEx.i &ExMsg = body
&ExType = {&MESSAGE_ERR}

}





--- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@...> wrote:
>
> I'm still at a loss with this. All of the code I've tried always denies posting whether the DCD-UserID is the same or not. How can I verify what it is being compared to, whether it be the entire GLJrnGrp table or the single currently opened record trying to be posted?
>
> I have the Epicor training manuals on BPM but they are very lacking in detail. Is there somewhere else I can study to figure this out?
>
> Thanks again!
>
> --- In vantage@yahoogroups.com, "brucewbrannan" <bruce.brannan@> wrote:
> >
> > I'm using the GLJrnGrp.PostGroupJournals, Pre-Processing to try to prevent the user who created the Journal Group from Posting the Journal Group by throwing an exception message when DCD-UserID = GLJrnGrp.CreatedBy. It throws the message regardless of whether the condition is true or false.
> >
> > For the condition (custom) I have:
> >
> > for each GLJrnGrp where DCD-UserID = GLJrnGrp.CreatedBy. end.
> >
> > Any ideas why this doesn't work? Or is there a better way? Also, we're using 8.03.409.
> >
> > I've also read that you can use messageboxes to display data in fields, like it would be nice if I could simply show a message with what is currently in DCD-UserID and GLJrnGrp.CreatedBy, just so I now what is actually being compared. I just don't know how to create the message with fields.
> >
> > Thanks!
> >
>