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
Copper Contributor
Posts: 13
Registered: ‎08-18-2009

Show Message from Insert Account Screen

I need to pop up a dialog from a button on the Insert Account and Insert Contact/Account screen.

When I try to use dialog.ShowMessage, I'm unable to use Carriage returns to format my lengthy list of items that I need to display.

I'm unable to make an Account smart part work from a button as well, it just does nothing when I click.

I need to display a list of Codes and Descriptions, it's about 40 items longs.

Does anyone have any suggestions?

 

 

Highlighted
Nickel Elite Contributor
Posts: 81
Registered: ‎04-13-2009

Re: Show Message from Insert Account Screen

You can use Ext.Dialog to show the message and within the contents of the dialog use Html to format your list. Just register a startup script doing the work.

Mark
Highlighted
Silver Contributor
Posts: 1,262
Registered: ‎04-08-2009

Re: Show Message from Insert Account Screen

Hi Mark,

 

could you post a small sample how to do this and use the ext.dialog thing?

 

Thanks!  Alexander

Highlighted
Copper Contributor
Posts: 13
Registered: ‎08-18-2009

Re: Show Message from Insert Account Screen

Hey Mark,

 

I'd greatly appreciate an example of that too.

 

Thanks,

-Chris

Highlighted
Nickel Elite Contributor
Posts: 81
Registered: ‎04-13-2009

Re: Show Message from Insert Account Screen

I'll try to whip something up when I get some free time.
Highlighted
Bronze Super Contributor
Posts: 141
Registered: ‎02-22-2010

Re: Show Message from Insert Account Screen

Hi All,

 

1. Copy the save business rule code from the InsertAccount.ascx file first and then place it in c# code snippet in the same event.  

 

After that

 

2. Write the appropriate Condition for which field you want to  make madatory or display a message box.

 

Write the below code

 

ScriptManager.RegisterClientScriptBlock((Page)HttpContext.Current.Handler, HttpContext.Current.Handler.GetType(), "MyScript5", "alert( 'Phone is Mandatory)", true);

 

 

Note: In the above part of code you can replace a string builder object (with alert(''Phone is Mandatory')) which contains a java script function

 

 

Thanks,

Jack

Highlighted
Nickel Elite Contributor
Posts: 81
Registered: ‎04-13-2009

Re: Show Message from Insert Account Screen

As said in previous post the power is in the RegisterClientScriptBlock Call to show your dialog.

 

You can also throw a Sage.Platform.Application.ValidationException(string) with your html encoded string as well. I have done this in a project and using the included class created a somewhat consistent way of doing multi error reporting. Its crude but works well.

 

so do something like

 

FormatterErrors errors = ValidateAllRequiredFormValues();

string result = errors.Errors();

if (string.isNullOrEmpty(result)) throw new Sage.Platform.Application.ValidationException(result);

 

inside of your validation code add the required checks

 

public FormatterErrors ValidateAllRequiredFormValues() {

   FormatterErrors errors =new FormatterErrors();

 

   if (string.IsNullOrEmpty(a.AccountName) errors.AddFormatted("{{Account Name}} is a required Field.");

 

   return errors;

}

 

Kindest,

Mark