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 

  • Mohan_AX Profile Picture
    106 on at
    RE: Lock box Import -Issue with reading the file

    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

  • Verified answer
    Martin Dráb Profile Picture
    234,593 Most Valuable Professional on at
    RE: Lock box Import -Issue with reading the file

    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.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 565

#2
Martin Dráb Profile Picture

Martin Dráb 536 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 402 Super User 2025 Season 1

Product updates

Dynamics 365 release plans