PROTECT a BO?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Rem
Posts: 216
Joined: Wed Oct 03, 2007 8:58 am
Location: Sweden
Contact:

PROTECT a BO?

Post by Rem »

I´m trying to use the PROTECT Action to protect BO:s, that have been printed out, from modification.

The BO:s are information for invoicing, so it would not be good to alter them after they have been printed out for that purpose.

I have a process that checks if a BO is ready for invoicing and if it is, it marks it and prints it. But now I also want to protect it.

However, when I put in the PROTECT action the process stops to work and the BO:s doesn´t get marked (and not protected).

Is this not what the PROTECT is for or do I do something else wrong?

/Rem
christopherb
Posts: 304
Joined: Fri Jun 22, 2007 8:26 pm

Post by christopherb »

Rem,
Without a clear picture of you app I would say that you need to have an attribute showing that the invoice has been printed such as Invoice.InvoicePrinted='Yes' or whatever you choose.

From there you can evaluate that attriute in a rule or process and apply the PROTECT You can find a sample of that in the Odering sample application in the Purchase Order OB

Good luck

Chris
Rem
Posts: 216
Joined: Wed Oct 03, 2007 8:58 am
Location: Sweden
Contact:

Post by Rem »

Yes, that is exactly how I do it. (I.E. changing a -1 value to a positive one so I can keep track)

So when I mark the invoice as printed it works fine, it looks like this:

FIND Jobb WHERE Jobb.Slutfort='Yes' AND Jobb.Fakturabatch=-1
...
Jobb.Fakturabatch=SystemSettings.Aktuellt_fakturabatchnr
SystemSettings.Aktuellt_fakturabatchnr=SystemSettings.Aktuellt_fakturabatchnr+1

But if I put in the line (at the dots): PROTECT Jobb FROM ALL

it doesn´t work any more.

/Rem
christopherb
Posts: 304
Joined: Fri Jun 22, 2007 8:26 pm

Post by christopherb »

Try this..........

If ob.attribute=’value’ Then PROTECT ob FROM
ALL EXCEPT System


Chris
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Post by greg »

Add this protection rule to the object not to a process.
Rem
Posts: 216
Joined: Wed Oct 03, 2007 8:58 am
Location: Sweden
Contact:

Post by Rem »

But the whole thing starts in a process. How can I then add it to the object?

/Rem
christopherb
Posts: 304
Joined: Fri Jun 22, 2007 8:26 pm

Post by christopherb »

Without seeing your app I would likely....

1. Create a flag attribute in your OB. When your process executes and if the value is found(or whatever) set the flag in the OB

2. Add a rule to watch for the flag in the OB. If flag is present then PROTECT ALL blah blah blah


Good luck...

Christopher
Rem
Posts: 216
Joined: Wed Oct 03, 2007 8:58 am
Location: Sweden
Contact:

Post by Rem »

Well, this Awareway of thinking really takes some time to get used to!

Thanks, it worked! Had yo use the "except SYSTEM" otherwise my routine for flaging the BO:s stoped to work and that I don´t understand. I did like you said, I put in a rule that is on the form for the BO. When my process for flaging starts it doesn´t use that form in any why..

But, anyhow it works and thats the main thing!

Thanks again and a happy new year to all of you!!

/Rem
christopherb
Posts: 304
Joined: Fri Jun 22, 2007 8:26 pm

Post by christopherb »

Snippet from the User Guide......

By default protection applies not only to changes done via the user interface, but
also to changes done by a process. It is possible to distinguish between these two
situations by specifying System as the access level, for example:
If Account.STATE <> ’NEW’ THEN PROTECT Account.Balance FROM ALL
EXCEPT System
In this case users will not be able to change the account balance when the state of the
account is not new, however, it is possible to configure the process rules that change the
account balance.

Hope that helps
Rem
Posts: 216
Joined: Wed Oct 03, 2007 8:58 am
Location: Sweden
Contact:

Post by Rem »

Well, well, read and thou shall learn!

Thanks!

/Rem
Post Reply