web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Lock box Import -Issue with reading the file

(0) ShareShare
ReportReport
Posted on by 106

Dear AX Experts,

We have a requirement to update Lockbox import process to read invoice data from "check detail record"( Record Type6 )

Before it was mapped to "Invoice Detail Record"(Record type 4) .

Please advise if this is a possible option ? More details are below

We have Lockbox processing class that reads data from .txt file, the record position,type and lenght defined in  "DATADICTIONARYDETAILS" table.

Per the above table invoice number should be populated in 4 record 13th position but the new requirement is to read Invoice number from 6 record 80th position.

So in Dev  I have updated "DATADICTIONARYDETAILS" table data ,so that 6th record 80th position data will be Invoice number and the "process File" method reading the data correct, later int the below step(highlighted in BOLD) it's throwing an error  saying "Argument to method setFieldValue out of range."

if(values != conNull() && lineType == "4")
{
//Get the tmp-Buffer instance from Base Class (FileBuffers) Method Name: GetTmp<table name from dictonary>
//recBuff = objDict.callObject("GetTmp"+currTable,this);
recBuff = objDict.callObject("GetLockboxInvoiceRecord",this);

//getting total num of records in container
_lenght = conLen(values);

//Loop through contain and load table fields container has field name, field value pair records
for (counter =1; counter <=_lenght; counter++)
{
cntRow = conNull();
cntRow=conPeek(values,counter);

typeVal = conPeek(cntRow,3);
data = conPeek(cntRow,2);
field = conPeek(cntRow,1);
if (field != "Blank")
{
if (match("amount>", strLwr(field)) == 1)
{
//when using Common as the table buffer we have generic method setFieldValue which will take (field name, Field Value) to set records
recBuff.setFieldValue(conPeek(cntRow,1),0.01*this.DynamicTypeConversion(conPeek(cntRow,2),typeVal));
}else
{
//when using Common as the table buffer we have generic method setFieldValue which will take (field name, Field Value) to set records
recBuff.setFieldValue(conPeek(cntRow,1),this.DynamicTypeConversion(conPeek(cntRow,2),typeVal));
}
}

}

Requesting your advise on the above and let me know if more details are needed.

Thanks

Mohan 

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    I would start by looking at what values you're passing to setFieldValue(). It's not visible in code above, because it depends on the content of cntRow() and logic inside DynamicTypeConversion().

    When you which value is wrong, you can start analyzing why.

  • Mohan_AX Profile Picture
    106 on at

    Hi Martin,

    Thank you very much for the reply.

    I have fixed this issue by adding another if()  to read the Invoice number to a container and assign it at the required position.

    Thanks

    Mohan

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans