How to confirm If current request from EP AX 2012 - axapta

I am sure there will be some helper method/class to confirm whether the current request originated from Enterprise Portal or from Client in AX2012R2. I just cant find it. Can you please point me to it?
Thanks

Look in \Classes\TradeWorkflow
The method: activatingFromWeb will tell you if it is being triggered from EP.
Hope this helps.

You could check if Global::webSession() returns a valid object:
if (webSession())
{
// Do some web-specific stuff
}

Related

Why the parameter TransitRadius in HERE Routing API with public transport do not change the response

Trying to use the parameter TransitRaduis in the routing API of HERE. It works well with 'car mode' but when using it with 'public transport' it seems to me that it changes nothing !
So setting one waypoint with the following three differents ways, gives the same result !
&waypoint0=geo!37.7914050,-122.3987030
&waypoint0=geo!37.7914050,-122.3987030;50
&waypoint0=geo!37.7914050,-122.3987030;500
To request a public transport route using the CalculateRoute service you need to specify a departure time as
https://route.api.here.com/routing/7.2/calculateroute.json?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE}&waypoint0=geo!52.530,13.326&waypoint1=geo!52.513,13.407&departure=now&mode=fastest;publicTransport&combineChange=true
For further details kindly go through the documentation
https://developer.here.com/documentation/routing/topics/request-public-transport-routes.html
Good Luck !

Allow access to web application only when my server redirects to it

My question is very very similar to this one
The idea is the following.
I have an app written in Node (specifically Sails.js) it a simple form for invoices.
And another one in Laravel.
So what I want is that the user can only access that form (Sails app) if one Controller of the Laravel app redirects to it.
On the link above it says that I could use sessions but as you can see this are very different applications. So I'm looking for the simplest and best way to do it.
Any advice is well received or if you have some better approach to solve this please let me know. Thanks
Probably the most simple way is to use the referer header in your Sails controller and do a simple comparison check.
For example:
getinvoice : function(req, res, next) {
var referer = req.headers.referer;
if(referer != 'http://somedomain.com/pageallowedtocallgetinvoice'){
return res.forbidden();
} else {
...
}
}

Unabale to find Amazon.RegionEndpoint.EUWest2

My Amazon S3 bucket's location is London so when I am trying upload document to this bucket I need to use Amazon.RegionEndpoint.EUWest2 as a region.
Amazon.S3.IAmazonS3 client;
using (client = Amazon.AWSClientFactory.CreateAmazonS3Client(_awsAccessKey, _awsSecretKey,Amazon.RegionEndpoint.EUWest1))
{
var request = new Amazon.S3.Model.PutObjectRequest()
{
};
client.PutObject(request);
}
But somehow I am not able to see any region with name EUWest2 only availble Europe regions are EUWest1 and EUCentral1.
Because of this incorrect regions am getting error as
The bucket you are attempting to access must be addressed using the
specified endpoint
What can be a reason for it, I am using AWSSDK.dll's 2.3.55.2 version. which I found latest today on Amazon S3 site.
I know this is a late reply but it may help someone.
I had the same problem and tried this method.
Instead of using RegionEndpoint.EUWEST... You can try using the GetBySystemName(string)
RegionEndpoint.GetBySystemName("eu-west-2")
Hope this helps
It just happens to me, the problem is that we have installed AWSSDK nugget instead of AWSSDK.Lambda nugget
Desintalling AWSSDK (if needed) and installing AWSSDK.Lambda, should fix the error for you as did for me.

what are PayPal CallBack parameters

Update 2:
I have found the right QueryString.
Update 1:
I think, QueryString should be the right type to use in this case.
But I tried to use it and found it's not the ASP.NET WebForm Response.QueryString instead, it is
Microsoft.Owin.QueryString.
Do I need to add some references in order to use the Response.QueryString?
Thank you for any feedback and help
I'm very close to the right direction, but need you help.
I have a PayPal callback method in my ASp.NET MVC controller called: PayPalCallBack(FormCollection form)
The problem is I cannot get any values(e.g. cm(custom), st(payment_status) etc.) from this form variable.
But when the method is finished, I did see the return url came with those values
https://www.mywebsite.net/Event/PayPalCallBack?tx=4KT34448LJ0584918&st=Completed&amt=0%2e11&cc=AUD&cm=3%2f23%2f2014%2011%3a00%3a00%20AM%7c3%2f23%2f2014%2012%3a00%3a00%20PM%7cWinTech%7cmr%7cWinston%7cFan%7cfranva008%40gmail%2ecom%7c0425620666%7c1&item_number=
So, I guess, I am using a wrong type of variable to receive its return values.
My question are
1. what should be the right type of parameter used in my PayPalCallBack( values)?
what parameters can the return_url have?
I am so close to the last step, my friends please help me out.
Note: I am asking the return values/parameters in return_url, not the notify_url which is used in PayPal IPN. Thanks
Thank you!

Broad cast message to specific page using signalr

suppose i have forum where people post their question and another people post the answer. say for example person A post a question "What is signalr ?" and stand at that page. other person also open that page for answering. if other person post any answer then i want that that answer will be shown in that page open by other users. suppose five user open that page and one of them answer then five user will see that answer.
normally when we like to broadcast any message to all then we use syntax like at server end
Clients.All.broadcastMessage(name, message);
so according to my above situation what kind of syntax i need to use?
here are few guide i found for broad cast message type and those are follows
// Call send on everyone
Clients.All.send(message);
// Call send on everyone except the caller
Clients.Others.send(message);
// Call send on everyone except the specified connection ids
Clients.AllExcept(Context.ConnectionId).send(message);
// Call send on the caller
Clients.Caller.send(message);
// Call send on everyone in group "foo"
Clients.Group("foo").send(message);
// Call send on everyone else but the caller in group "foo"
Clients.OthersInGroup("foo").send(message);
// Call send on everyone in "foo" excluding the specified connection ids
Clients.Group("foo", Context.ConnectionId).send(message);
// Call send on to a specific connection
Clients.Client(Context.ConnectionId).send(message);
which one i need to use ? please explain & thanks.
You could have a div on the page that has an id of the question. So you would have something like:
<div id="theAskedQuestionId"><!-- the answer will be inserted here--></div>
so for example:
<div id="12345"><!-- the answer will be inserted here--></div>
And then you can use jquery to inject the answer into the div. An example of this is:
var messagePublisher = $.connection.yourHubName;
messagePublisher.client.broadcastMessage = function(divId, message){
$(divId).html(message); //note: divId will be something like #12345
};
This will allow you to only show the message to the users that are looking at the specific question instead of broadcasting the message to users looking at any question. I think this is what you were asking for help on.

Resources