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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Argument 'value' is incompatible with the required type

(0) ShareShare
ReportReport
Posted on by 2,050

i'm trying to create RPD for my custom report by contract so i'v create this function

[SysEntryPointAttribute]
public void processReport()
{
    Query query;

    QueryRun qRun;

    QueryBuildRange qbr,qbr1,queryBuildRange;

    QueryBuildDataSource    queryBuildDataSource;

    PayrollPayStatementEarningLine  payrollPayStatementEarningLine;

    PayrollPayStatementLine         payrollPayStatementLine;

    PayrollPayStatement         payrollPayStatement;

     HcmWorker   hcmWorker;

    HcmPositionWorkerAssignment hcmPositionWorkerAssignment;

    HcmWorkerRecId hcmWorkerRecId;

    int64 Idforline,PeriodX;

    contract = this.parmDataContract() as PayStatmentRPDPContract;

    hcmWorkerRecId=contract.parmHcmWorkerRecId();


    PeriodX=contract.parmPayPeriod();

    select RecId from PayrollPayStatement
    where PayrollPayStatement.Worker==hcmWorkerRecId
    && PayrollPayStatement.PayPeriod==PeriodX;

    select PayStatement from payrollPayStatementEarningLine
    where payrollPayStatementEarningLine.PayStatement==PayrollPayStatement.RecId;

    Idforline=payrollPayStatementEarningLine.PayStatement;

    queryBuildDataSource = query.dataSourceTable(tablenum(payrollPayStatementEarningLine));

    if(Idforline)
    {
        queryBuildRange = queryBuildDataSource.findRange(fieldnum(payrollPayStatementEarningLine, PayStatement));
        if (!queryBuildRange)
            {
                queryBuildRange = queryBuildDataSource.addRange(fieldnum(payrollPayStatementEarningLine, PayStatement));
            }
        if(!queryBuildRange.value())
            {
                queryBuildRange.value(Idforline);
            }
    }

    qRun = new QueryRun(query);
    
     while(qRun.next())
     {
         payStatmentRPTemp.clear();
         payrollPayStatementEarningLine = qRun.get(tableNum(PayrollPayStatementEarningLine));

         payStatmentRPTemp.AccountingDate=payrollPayStatementEarningLine.AccountingDate;
         payStatmentRPTemp.EarningCode=payrollPayStatementEarningLine.EarningCode;
         payStatmentRPTemp.Quantity=payrollPayStatementEarningLine.Quantity;
         payStatmentRPTemp.EarningRate=payrollPayStatementEarningLine.EarningRate;
         payStatmentRPTemp.insert();

     }
}

but i got error here (i think type of parm or somthing)

problem-on-report.JPG

I have the same question (0)
  • Verified answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    the .value() method of QueryBuildRange always wants an argument that is of type string. You see this in the tooltip when you type "queryBuildRange.value(".

    The type of PayrollPayStatementEarningLine.PayStatement is int64.

    So you need to convert it to string: queryBuildRange.value(int642str(idForLine));

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi  Mohammed,

    The parameter type of queryBuildRange.value () should be str, but you define Idforline as int64.

    Please check Q class.

    public str value([str value])

    docs.microsoft.com/.../q-classes

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 617

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 298 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans