Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Avid Listener
Posts: 17
Registered: ‎04-03-2009

Need help to Move BusinessRules

Hi,

 

Very new to Web Client. Trying to implement my first Biz Rule.

 

This is what I did:

 

1) Account --> Events --> OnBeforeUpdate --> Primary Steps --> Add

2) Created a very simple method :

 

public static void OnBeforeUpdateStep( IAccount account, ISession session)

{

// TODO: Complete business rule implementation

if(account.Employees.ToString() == "")

throw new ValidationException("EE cannot be empty- Veronka first Biz Rule.");

}

 

3) Build Interface, Build Web Platform, Deploy (to a remote machine)

4) Nothing happened when I eneterd some value into Account.Emmployee field

 

5) Moved Biz Rule from PrimarySteps to PostExecuteSteps. Now I have following error when trying to build Web Platform:

 

ERROR - C:\Documents and Settings\vcapone\Application Data\Sage\Platform\Output\Sage.SnippetLibrary.CSharp\src\Sage.SnippetLibrary.CSharp.@.d9f45533-69f5-42a4-b6a7-030b7d0e11ad.codesnippet.cs(35,28):Type 'Sage.BusinessRules.CodeSnippets.AccountBusinessRules' already defines a member called 'OnBeforeUpdateStep' with the same parameter types

 

I tried to delete Output folder from my Local machine, no luck.

 

Any help please?

 

Thanks.

Avid Listener
Posts: 17
Registered: ‎04-03-2009

Re: Need help to Move BusinessRules

I fixed this problem hopefully this post will help others who run into this issue:

 

1) Before removing a rule from AA, you need to remove the code from codesnippet xxx.cs file. To easyly find which file you need to modify, force an error into your biz rule (remove ; at the end of your statement for example)

2) Remove you Biz Rule Step clicking Remove link in your Biz Rule step

3) Save and Build everithing again and now you can move your biz rule somewhere else.