Stimulsoft StiMvcViewer can't "save as" - stimulsoft

stimulsoft StiMvcViewer can't "save as"
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:
System.NullReferenceException: Object reference not set to an instance of an object.

Check that you have added the necessary actions for the Viewer.
"MvcViewer1", new StiMvcViewerOptions() {
Actions =
{
GetReportSnapshot = "GetReportSnapshot",
ViewerEvent = "ViewerEvent"
}

Related

Migration to EWS API for sending emails

I have the following code to send a email through EWS API,
ExchangeService service = new ExchangeService();
service.setUrl(new URI(**MyExchangeURL**));
ExchangeCredentials credentials = new WebCredentials(**UserName**, **Password**);
service.setCredentials(credentials);
EmailMessage message = new EmailMessage(service);
message.setSubject("EWS Test Mail");
message.setBody(MessageBody.getMessageBodyFromText("This is a test mail from EWS"));
message.getToRecipients().add("Test#gmail.com");
message.send();
With the above code, I facing a null pointer exception when message.send() is called.
Log:
Exception in thread "main" microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException: The request failed. null
at microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:74)
at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:158)
at microsoft.exchange.webservices.data.core.ExchangeService.internalCreateItems(ExchangeService.java:598)
at microsoft.exchange.webservices.data.core.ExchangeService.createItem(ExchangeService.java:657)
at microsoft.exchange.webservices.data.core.service.item.Item.internalCreate(Item.java:245)
at microsoft.exchange.webservices.data.core.service.item.EmailMessage.internalSend(EmailMessage.java:147)
at microsoft.exchange.webservices.data.core.service.item.EmailMessage.send(EmailMessage.java:258)
at EWS.main(EWS.java:28)
Caused by: java.lang.NullPointerException
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.readResponse(ServiceRequestBase.java:369)
at microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:63)
... 7 more
When debugged further there is a mismatch in the attribute name.
In request, the attribute is contentType is setted in request. But while reading the response, we are getting Null as code used have Content-type. There is a mismatch in the attribute name being set and read.
Is anyone else facing this issue or any workaround?

Officejs add/activate a new worksheet throw a GeneralException

We are building an Excel add-in by using a dialog. The dialog box will delivery a message to its parent/opener workbook. The function file will call a simple function as example:
const populateTable = (officeMessage)=>{
Excel.run(async context => {
const workbook = context.workbook;
const worksheets = workbook.worksheets;
const sheet = worksheets.add();
sheet.getCell(0,0).values = [[officeMessage]];
await context.sync();
}).then(()=>{
showDialogEvent.completed();
dialog.close();
}).catch(handleError);
}
Two workbook/excel desktop have been opened (Excel1 and Excel2). The dialog is opened in Excel1. However, if I focus another workbook(Excel2) before this function is triggered. Officejs API will create a new worksheet in Excel2 instead Excel1, and an error will be thrown as below:
{"description":"There was an internal error while processing the request.","name":"RichApi.Error","code":"GeneralException","traceMessages":[],"innerError":null,"debugInfo":{"code":"GeneralException","message":"There was an internal error while processing the request.","errorLocation":"WorksheetCollection.add","statement":"var add=worksheets.add();","surroundingStatements":["var workbook=context.workbook;","var worksheets=workbook.worksheets;","// >>>>>","var add=worksheets.add();","// <<<<<","var cell=add.getCell(...);","// Instantiate {cell}","cell.values=...;"],"fullStatements":["Please enable config.extendedErrorLogging to see full statements."]},"stack":"GeneralException: There was an internal error while processing the request.\n at Anonymous function (https://appsforoffice.microsoft.com/lib/1.1/hosted/excel-win32-16.01.js:24:286584)\n at Anonymous function (https://cdn.jsdelivr.net/npm/promise-polyfill#8/dist/polyfill.min.js:1:822)"}
Note: I tried to save the first workbook's Request Context in memory and pass it into Excel.run, but it doesn't work.
Is there any way to solve this problem?
Thanks #Ericl for your report.
This is a known issue, we are working on a new feature (3743479) to fix this issue, A uservoice request was created , you could also upvote this request.
Please listen to this user voice, we will keep posted once we release this feature
The workaround currently is to force to open another instance/process of Excel to solve this problem.

Call Web Service via crm workflow

Currently i'm working on a crm project. In this project i have to send data to web service and take refined data back. This operation must be work on custom workflow but i'm stuck infact i have no idea how to do it? Any suggestions?
Here is my service code;
var tmpIncident = getIncidentById(organizationServiceContext);
if (tmpIncident != null) //if we have decent incident we connect service and proceed the data.
{
GetCustomerInfoService.TransactionServiceClient client = new GetCustomerInfoService.TransactionServiceClient();
GetCustomerInfoService.TransactionRequest request = new GetCustomerInfoService.TransactionRequest();
#region authentication
request.AuthenticationData.UserName = "user";
request.AuthenticationData.Password = "pass";
#endregion
Guid id = Guid.NewGuid(); //create random guid
request.RequestId = id.ToString();
request.OrderNumber = tmpIncident.vrp_ordernumber;
GetCustomerInfoService.TransactionResponse response = client.GetTransactionByOrderNumber(request);
tmpIncident.CustomerId = new EntityReference("Contact", new Guid(response.Message));
this.updateChanges(organizationServiceContext, tmpIncident);
client.Close();
}
When i tested plugin, i received that error;
Error Message:
Unhandled Exception: System.InvalidOperationException: Could not find default endpoint element that references contract 'GetCustomerInfoService.ITransactionService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.ConfigurationEndpointTrait1.CreateSimplexFactory()
at System.ServiceModel.ClientBase1.CreateChannelFactoryRef(EndpointTrait1 endpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
at Vrp.Crm.PluginLibrary2013.GetCustomerInfoService.TransactionServiceClient..ctor() in :line 0
at Vrp.Crm.PluginLibrary2013.CustomWorkflows.SetCumstomerIdToIncident.Execute(CodeActivityContext context) in c:\Veripark\Projects\gisik\DRCRM.VERITOUCH.CRM2013\PluginLibrary2013\CustomWorkflows\CheckSubIncidentForMainIncident.cs:line 72
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Assuming that you are using Dynamics CRM. This is a high-level overview:
Create a custom workflow activity that makes the actual call to the webservice. This should help you get started: https://msdn.microsoft.com/en-us/library/gg328515.aspx
The custom activity would have output parameters that would return the results from the webservice back to the calling CRM workflow.
Finally create the workflow and its triggers that would make use of your custom activity. More info:
http://crmbook.powerobjects.com/system-administration/processes/workflows/
https://msdn.microsoft.com/en-us/library/gg328264.aspx
I hope this is enough information to get you heading down the right path.

How to Authenticate Microsoft dynamics CRM for liveid using C#

I am using windows application to connect with Microsoft Dynamics CRM . Here I can login using online federation and on-Premise types but when I try to login with Live Id credentials, I am getting security error like "An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."
So pls tell me how can I get login using with live id details.
Note: I am using SDK authenticationwithnohelp code for login
The best way to troubleshoot this kind of thing is to look at the inner fault details that are generated when a call to the CRM web service fails. The exception type thrown is usually:
System.ServiceModel.FaultException<Microsoft.Xrm.Sdk.OrganizationServiceFault>
Wrap your code in a try / catch block and examine the exception Detail and Detail.InnerFault objects:
try
{
// Connection code here
}
catch (System.ServiceModel.FaultException<Microsoft.Xrm.Sdk.OrganizationServiceFault> ex)
{
string exceptionMessage = ex.Message;
int errorCode = -1;
// Check for fault detailed information
if (ex.Detail != null)
{
// Check for the Detail InnerFault
if (ex.Detail.InnerFault != null)
{
// Get the inner fault message and code - this is where the useful information is
exceptionMessage += " - " + ex.Detail.InnerFault.Message;
errorCode = ex.Detail.InnerFault.ErrorCode;
}
else
{
// No InnerFault was defined, get the Detail message and code
if (exceptionMessage != ex.Detail.Message)
{
// The Detail.Message will usually be the same as the outer exception
exceptionMessage += " - " + ex.Detail.Message;
}
errorCode = ex.Detail.ErrorCode;
}
}
// Output exceptionDetails and errorCode here
Trace.WriteLine("Exception message: " + exceptionMessage);
Trace.WriteLine("Exception code: " + errorCode);
}
The exception error code property can also be helpful. The error code is returned as a format decimal, for example -2147167730
You can cross-reference this against the list of error codes returned by the CRM web service on MSDN here: http://msdn.microsoft.com/en-us/library/gg328182.aspx
However, first you need to convert the error code from decimal to the hex format used on MSDN.
Using the example error code -2147167730:
Open the Windows Calculator
Select Programmer mode (Alt + 3)
Select Dec (Decimal) and paste in the error code (-2147167730)
Select Hex, and the code will be converted to 'FFFFFFFF8004D20E'
Remove the leading FFFFFFFF characters, and then look on the MSDN error code page for '8004D20E'

Followup Activity plugin error Dynamics CRM 2011

I have developed a windows services which work to send email for neglected lead after 7 days.
When I run code in my machine it work and continue. But when I install in a Windows services then some error occurs:
using (OrganizationServiceProxy serviceProxy =
new OrganizationServiceProxy(OrganizationUri, HomeRealmUri, Credentials, null))
{
IOrganizationService service = (IOrganizationService)serviceProxy;
ColumnSet Indexcol = new ColumnSet(new string[] { columnname });
QueryByAttribute indexattribute = new QueryByAttribute();
indexattribute.EntityName = EntityName;
indexattribute.Attributes.AddRange(RangeAttribute);
indexattribute.Values.AddRange(RangeValues);
indexattribute.ColumnSet = Indexcol;
RetrieveMultipleRequest req_index = new RetrieveMultipleRequest();
req_index.Query = indexattribute;
try {
// Error occurs when this line executes
RetrieveMultipleResponse resp_index =
(RetrieveMultipleResponse)service.Execute(req_index);
EntityCollection mcs_index = resp_index.EntityCollection;
}
}
and error is
The server was unable to process the request due to an internal error.
For more information about the error, either turn on
IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute
or from the configuration behavior) on the server in
order to send the exception information back to the client, or turn on
tracing as per the Microsoft .NET Framework 3.0 SDK documentation and
inspect the server trace logs.
kindly guide me I am stuck here. :(

Resources