Out of range error by segmented entry - axapta

I have new table. In which I created two new fields
1) Name --> Dimension, EDT--> DimensionDynamicAccount
2) Name --> AccountType, EDT--> LedgerJournalACType
Now I want look up same as in "LedgerJournalTransDaily" form. i.e When Accounttype == Ledger then Lookup from LedgerAccount
When Accounttype == Customer then Lookup from CustTable.
For This I have followed the step in Page 19 in white paper"Implementing_the_Account_and_Financial_Dimensions_Framework_AX2012" which you find here: http://download.microsoft.com/download/4/e/3/4e36b655-568e-4d4a-b161-152b28baaf30/implementing_the_account_and_financial_dimensions_framework_ax2012.pdf
Always when i go into my form, the error message "Argument to method getFieldValue out of range." is shown.
So i set an debug point in "loadSegments" in the row "ledgerDimAccContr.parmControl(this);"
i run into this method and there is a line "if(this.isNonLedgerAccount())" and when i step into this method the call "DimensionHierarchyType hierarchyType = this.getHierarchyType();" throws the error.
Have anybody a idea how to solve this?
You can find my Code here: https://community.dynamics.com/ax/f/33/t/231980
BG James

Related

How to ensure ordering of response for two different nodes in gremlin?

For my data model, I have the following:
type defines an item
The project owns an item
Type is connected to anchors (Suppose the anchor is country)
Item is connected to a particular anchor instance (anchor instance
will have corresponding value for anchor, suppose US)
I am trying to read an item along with the type, anchorNames and anchorValues.
Following is the query I have written:
g.V().hasLabel('Type').as('t')
.outE('DEFINES').inV().hasLabel('Item').has('dataId',’test-id').has('version','1').as('i')
.inE('OWNS').outV().hasLabel('Project').select('i')
.project('i','t','anchorNames','anchorValues')
.by(__.valueMap(true))
.by(__.in().hasLabel('Type').valueMap(true))
.by(out().in().hasLabel('Anchor').values('name').fold())
.by(out().as('AnchorInstance').select('AnchorInstance')
.by(values('value','secondaryValue').fold()).fold())
I get i and t but the result for anchorNames and anchorValues is as follows:
{anchorNames=[status, status, country], anchorValues=[[OK], [US], [FAIL]]}
However I am expecting the following:
{anchorNames=[status, status, country], anchorValues=[[OK], [FAIL], [US]]}
I need the ordering between the anchorNames and anchorValues as shown above.
I think the best approach will be to get the name and the corresponding values together.
g.V().hasLabel('Type').as('t')
.out('DEFINES').hasLabel('Item').has('dataId',’test-id').has('version','1').as('i')
.in('OWNS').hasLabel('Project').select('i')
.project('i','t','anchors')
.by(__.valueMap(true))
.by(__.in().hasLabel('Type').valueMap(true))
.by(out().project('anchorNames','anchorValues')
.by(__.in().hasLabel('Anchor').values('name'))
.by(values('value','secondaryValue').fold()).fold())

BMC Remedy ticket status change error in asp net

I'm using MVC to manage the BMC ticket raise and resolve. However for certain groups there are additional fields that opens up after choosing the type of change as 'Resolved'
I tried input values to those fields but still I'm not able to resolve the incident.
Below is the code used,
StagingRequest.Incident_Nature = "NA";
StagingRequest.Network_Infrastructure = "NA";
StagingRequest.Incident_Element = "NA";
String ss = _WS1.HelpDesk_Modify(_AI1, StagingRequest.Incident_Number, StagingRequest.Type_of_Change, StagingRequest.Status_Reason, StagingRequest.Group_Name, StagingRequest.Assignee_Login_ID, StagingRequest.Resolution, StagingRequest.Incident_Nature, StagingRequest.Network_Infrastructure, StagingRequest.Incident_Element, StagingRequest.WorkLog_SupportDiary, StagingRequest.Work_Info_Notes, StagingRequest.Expiry_Date);
Note that I tried entering the actual dropdown values in those 3 fields still the same error "Unable to Modify :ERROR (100000308): ; Please choose the value for the following fields before resolving the ticket; 'Incident Nature', 'Network Infrastructure' and 'Incident Element'. "
The other groups for which additional fields is not required worked with the below code,
String ss = _WS1.HelpDesk_Modify(_AI1, StagingRequest.Incident_Number, StagingRequest.Type_of_Change, StagingRequest.Status_Reason, StagingRequest.Group_Name, StagingRequest.Assignee_Login_ID, StagingRequest.Resolution, null, StagingRequest.Cause_for_SLA_Violation, StagingRequest.SLA_Comments, StagingRequest.WorkLog_SupportDiary, StagingRequest.Work_Info_Notes, StagingRequest.Expiry_Date);
Analysis the the difference in group in Remedy. Some groups are differently customized in remedy while resolving the incidents

rkafka.read() doesn't return a message (Returns double quotes only)

Trying to return a message through rkafka library in R.
Followed the same rkafka documentation # https://cran.r-project.org/web/packages/rkafka/vignettes/rkafka.pdf
Output returns "" without the actual message in it. Kafka tool confirms that the message is sent by the producer.
CODE:
prod1=rkafka.createProducer("127.0.0.1:9092")
rkafka.send(prod1,"test","127.0.0.1:9092","Testing once")
rkafka.closeProducer(prod1)
consumer1=rkafka.createConsumer("127.0.0.1:2181","test")
print(rkafka.read(consumer1))
Output:
[1] ""
Desired Output would return "Testing once".
In order to read the messages of a topic that have already been written to the topic (before the consumer has been started) you need to set offset value to the smallest possible (equivalent to --from-beginning). According to rkafka docs autoOffseetReset argument defaults to largest
autoOffsetReset
smallest : automatically reset the offset to the
smallest offset largest : automatically reset the offset to the
largest offset anything else: throw exception to the consumer
Required:Optional Type:String default:largest
In order to be able to consume messages you need to set autoOffsetReset to "smallest".
consumer1=rkafka.createConsumer("127.0.0.1:2181","test", autoOffsetReset="smallest")
Update: This Code Works:
library(rkafka)
prod1=rkafka.createProducer("127.0.0.1:9092")
rkafka.send(prod1,"test","127.0.0.1:9092","Testing once")
rkafka.send(prod1,"test","127.0.0.1:9092","Testing twice")
rkafka.closeProducer(prod1)
consumer1=rkafka.createConsumer("127.0.0.1:2181","test",groupId = "test-consumer-
group",zookeeperConnectionTimeoutMs = "100000",autoCommitEnable = "NULL",
autoCommitInterval = "NULL",autoOffsetReset = "NULL")
print(rkafka.read(consumer1))
print(rkafka.readPoll(consumer1))
rkafka.closeConsumer(consumer1)
The key is to restart Kafka after deleting the logs it generates.

Provide a list of numbers to Alexa

I want to create a lottery skill that takes 6 numbers from the user.
I'm currently learning by going through the samples and developer guides, and I can go through the guides and get a working skill that will take one input and then end the session. But I believe I need to create a dialog somehow, which is where I get stuck.
Design-wise, I'd like the dialog to go like this:
Alexa: Please provide the first number
User: 1
Alexa: and now the second...
User: 2
etc etc
But I think it would be OK if it went like this:
Alexa: Please call out 6 numbers
User: 1, 2, 3, 4, 5, 6.
Is this even possible? Will I have to create a custom slot type called "Numbers" and then put in the numbers, eg 1-50 or whatever the limit is?
At best, I can currently get it to ask for one number, so its really the dialog interaction that I'm stuck on. Has anyone ever even done anything like this?
Thanks.
Yes to both questions. You could string together a response with 6 different custom slots. "User: My numbers are {num1}, {num2}, {num3}, {num4}, {num5}, {num6} " and make them all required using the skills beta developer. However, it will be a rather bad user experience if the user does not phrase their answer appropriately and Alexa has to ask follow up questions to obtain each number. The last problem you'll run into is that while a custom slot could be defined to contain the numbers 1-50 alexa will generally recognize similar values to those provided in a custom slot, such as numbers from 50-99. It would then be up to you to check that the values you receive are between 1 and 50. If not you'd want to ask the user to provide a different number in the appropriate range.
Conclusion: You'll want to have individual interactions where a user provides a single number at a time.
Alexa:"you will be prompted for 6 numbers between 1 and 50 please state them one at a time. Choose your first number."
User:"50"
Alexa:"Your First number is 50, Next number."...
You can implement this using a single intent. let's name that intent GetNumberIntent. GetNumberIntent will have sample uterances along the line of
{number}
pick {number}
choose {number}
where {number} is a custom slot type or simply AMAZON.NUMBER. It will then be up to you to check that the number is between 1 and 50.
I program in Node.js using the SDK. Your implementation may vary depending upon your language choice.
What I would do is define 6 different state handlers. Each handler should have the GetNumberIntent. When a GetNumberIntent is returned if the slot value is apropriate store the value to the session data and or dynamodb and move forward to the next state. If the slot value is invalid stay for example at state "NumberInputFiveStateHandlers" until a good value is received then change state to the next "NumberInputSixStateHandlers"
var NumberInputFiveStateHandlers = Alexa.CreateStateHandler(states.NUMFIVEMODE, {
'NewSession': function () {
this.emit('NewSession'); // Uses the handler in newSessionHandlers
},
//Primary Intents
'GetNumberIntent': function () {
let message = ` `;
let reprompt = ` `;
let slotValue = this.event.request.intent.slots.number.value;
if(parseInt(slotValue) >= 1 && parseInt(slotValue) <= 50){
this.handler.state = states.NUMSIXMODE;
this.attributes['NUMBERFIVE'] = this.event.request.intent.slots.number.value;
message = ` Your fifth number is `+slotValue+`. please select your sixth value. `;
reprompt = ` please select your sixth value. `;
}else{
message = ` The number `+slotValue)+` is not in the desired range between 1 and 50. please select a valid fifth number. `;
reprompt = ` please select your fifth value. `;
}
this.emit(':ask',message,reprompt);
},
//Help Intents
"InformationIntent": function() {
console.log("INFORMATION");
var message = ` You've been asked to choose a lottery number between 1 and 50. Please say your selection.`;
this.emit(':ask', message, message);
},
"AMAZON.StopIntent": function() {
console.log("STOPINTENT");
this.emit(':tell', "Goodbye!");
},
"AMAZON.CancelIntent": function() {
console.log("CANCELINTENT");
this.emit(':tell', "Goodbye!");
},
'AMAZON.HelpIntent': function() {
var message = `You're playing lottery. you'll be picking six numbers to play the game. For help with your current situation say Information. otherwise you may exit the game by saying quit.`;
this.emit(':ask', message, message);
},
//Unhandled
'Unhandled': function() {
console.log("UNHANDLED");
var reprompt = ' That was not an appropriate response. Please say a number between 1 and 50.';
this.emit(':ask', reprompt, reprompt);
}
});
This is an example of the fifth request. You'll have 6 identical states like this one that string back to back. Eventually you'll end up with 6 session values.
this.attributes['NUMBERONE']
this.attributes['NUMBERTWO']
this.attributes['NUMBERTHREE']
this.attributes['NUMBERFOUR']
this.attributes['NUMBERFIVE']
this.attributes['NUMBERSIX']
You can then use these values for your game.
If you have not used the alexa-sdk before you must remember to register your state handlers and add your modes to the states variable.
alexa.registerHandlers(newSessionHandlers, NumberInputOneStateHandlers, ... NumberInputSixStateHandlers);
var states = {
NUMONEMODE: '_NUMONEMODE',
...
...
NUMSIXMODE: '_NUMSIXMODE',
}
This answer is not intended to cover the basics of coding using Alexas-SDK. There are other resourced for more specific questions on that topic.
Alternatively, because your intent is identical [GetNumberIntent], you may be able to get by with a single StateHandler that pushes new valid numbers onto an array until the array is the desired length. That would simply require more logic inside the Intent Handler and a conditional to break out of the state once the array is of length 6.
Try the code above first because it's easier to see the different states.

Cant get ExtededDataGrid in Flex to filter with ComboBox on multiple columns

LATEST UPDATE: Issue answered here. Some one else at stackoverflow had a similar issue and it was resolved. Solution provided for convenience. This is the line of code I was missing:
comboHeaderColumn.useLabelFunctionForFilterCompare = true;
that line is followed by these:
comboHeaderColumn.filterComboBoxBuildFromGrid = true;
comboHeaderColumn.labelFunction = formatState;
where formatState is a local method that formats the data for the combobox.
UPDATE: I've now got the combobox's loading with the correct data, but when I select a value nothing happens. The combo boxes load only data that is in the column, and when you select a value in the combobox, it's supposed to filter the rows on that value. It doesn't.
Thanks for looking. I'm having trouble getting multiple filters to work in Flex in Flash Builder 4 using the ExtendedDataGrid and ComboBox's. Here is an image of part of the grid:
The User Name and City filter properly if you type text into the box's above the column header and the Request Date lets you select date ranges if you click on the Custom bar, but the Request Reason and State ComboBoxes do not list anything. I've created them using comboHeaderColumn.filterComboBoxBuildFromGrid = true; but all it does is put "[object Object]" as the only other selection under All.
I've used this article but it will only allow you to use a single filter for the entire grid.
My finished grid will have about 20 columns and from 20,000 to 450,000 rows of data so the filters are really important and I'll need more than one.
The code is very straight forward and loops through all the returned data and if the column is identified as a filter column it does this:
comboHeaderColumn.filterComboBoxDataProvider = codeValuePairs;
comboHeaderColumn.filterComboBoxLabelField = "Value";
comboHeaderColumn.filterControl = "ComboBox";
comboHeaderColumn.filterOperation = FilterExpression.FILTER_OPERATION_TYPE_EQUALS;
comboHeaderColumn.headerText = ac.Header;
comboHeaderColumn.dataField = ac.Name;
if( ac.Header == "State" || ac.Header == "Request Reason" )
{
comboHeaderColumn.filterComboBoxBuildFromGrid = true;
}
ProfileDataColumns.push(comboHeaderColumn);
This creates 2 entries in the combo box: All and [object Object]
What am I missing??? Anyway, after half a day searching I decided to reach out.
Any suggestions or direction to an article would be very much appreciated.
Thanks.

Resources